[Issue 10225] New: core.simd wrong codegen for XMM.STOUPS with __simd_sto
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jun 1 03:05:11 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10225
Summary: core.simd wrong codegen for XMM.STOUPS with __simd_sto
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: code at benjamin-thaut.de
--- Comment #0 from Benjamin Thaut <code at benjamin-thaut.de> 2013-06-01 03:05:09 PDT ---
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)
--
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