Re: Adding a float with all four elements of a float4

2016-04-21 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 21 Apr 2016 00:14:53 + schrieb Straivers : > Hi, > > I want to make a utility wrapper around a core.simd.float4, and > have been trying to make the following code work, but have been > met with no success. > > auto add(float rhs) > { > return __simd(XMM.ADDPS, lhs, rhs); > }

Re: Adding a float with all four elements of a float4

2016-04-20 Thread Straivers via Digitalmars-d-learn
On Thursday, 21 April 2016 at 01:49:19 UTC, Nicholas Wilson wrote: [...] you want to broadcast the rhs to a float4 and then adds them. Can you post the errors (if any) you get during compilation. Urgh, autocorrect. That should be addps them. I get a "Error: floating point constant expressi

Re: Adding a float with all four elements of a float4

2016-04-20 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 21 April 2016 at 01:48:15 UTC, Nicholas Wilson wrote: On Thursday, 21 April 2016 at 00:14:53 UTC, Straivers wrote: Hi, I want to make a utility wrapper around a core.simd.float4, and have been trying to make the following code work, but have been met with no success. [...] yo

Re: Adding a float with all four elements of a float4

2016-04-20 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 21 April 2016 at 00:14:53 UTC, Straivers wrote: Hi, I want to make a utility wrapper around a core.simd.float4, and have been trying to make the following code work, but have been met with no success. [...] you want to broadcast the rhs to a float4 and then adds them. Can you

Adding a float with all four elements of a float4

2016-04-20 Thread Straivers via Digitalmars-d-learn
Hi, I want to make a utility wrapper around a core.simd.float4, and have been trying to make the following code work, but have been met with no success. auto add(float rhs) { return __simd(XMM.ADDPS, lhs, rhs); } Then I tried auto add(float4 lhs, float rhs) { float4 tmp = [rhs, rhs,