[Issue 10225] core.simd wrong codegen for XMM.STOUPS with __simd_sto
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 3 03:02:22 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10225
Manu <turkeyman at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |turkeyman at gmail.com
--- Comment #1 from Manu <turkeyman at gmail.com> 2013-06-03 03:02:18 PDT ---
(In reply to comment #0)
> For the follwing small test program:
>
> import core.simd;
> import std.stdio;
>
> void main(string[] args)
> {
> float[] value1 = [1.0f, 2.0f, 3.0f, 4.0f];
> float4 result = __simd(XMM.LODUPS, *cast(float4*)value1.ptr);
> result = __simd(XMM.ADDPS, result, result);
> __simd_sto(XMM.STOUPS, *cast(float4*)value1.ptr, result);
> writefln("%s", value1);
> }
>
> Dmd will generate the follwing assembly:
> mov rax,qword ptr [rbp-68h]
> movups xmm0,xmmword ptr [rax]
> movaps xmmword ptr [rbp-60h],xmm0
> movdqa xmm0,xmmword ptr [rbp-60h]
> addps xmm0,xmmword ptr [rbp-60h]
> movaps xmmword ptr [rbp-60h],xmm0
>
> As you can clearly see the last instruction is a movaps but it should be a
> movups because XMM.STOUPS was given (unaligned store)
Indeed. Wrong opcode >_<
I never use unaligned vectors, so I missed it!
Haven't widely tested the unaligned bit of std.simd yet.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list