Skip to content

Commit

Permalink
Merge pull request #6763 from WalterBright/fix17356
Browse files Browse the repository at this point in the history
fix Issue 17356 - [Reg 2.075] __simd_sto no longer executed
merged-on-behalf-of: Martin Nowak <code@dawg.eu>
  • Loading branch information
dlang-bot authored May 16, 2017
2 parents c3ddfaa + b85beb2 commit 1d29b79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/ddmd/e2ir.d
Original file line number Diff line number Diff line change
Expand Up @@ -416,23 +416,20 @@ if (!global.params.is64bit) assert(tysize(TYnptr) == 4);
{
e = ep;
/* Recognize store operations as:
* ((op OPparam op1) OPparam op2)
* (op OPparam (op1 OPparam op2))
* Rewrite as:
* (op1 OPvecsto (op OPparam op2))
* A separate operation is used for stores because it
* has a side effect, and so takes a different path through
* the optimizer.
*/
if (e.Eoper == OPparam &&
e.EV.E1.Eoper == OPparam &&
e.EV.E1.EV.E1.Eoper == OPconst &&
isXMMstore(cast(uint)el_tolong(e.EV.E1.EV.E1)))
{
//printf("OPvecsto\n");
elem *tmp = e.EV.E2;
e.EV.E2 = e.EV.E1;
e.EV.E1 = e.EV.E2.EV.E2;
e.EV.E2.EV.E2 = tmp;
e.EV.E1.Eoper == OPconst &&
isXMMstore(cast(uint)el_tolong(e.EV.E1)))
{
elem *tmp = e.EV.E1;
e.EV.E1 = e.EV.E2.EV.E1;
e.EV.E2.EV.E1 = tmp;
e.Eoper = OPvecsto;
e.Ety = tyret;
}
Expand Down
12 changes: 12 additions & 0 deletions test/runnable/testxmm.d
Original file line number Diff line number Diff line change
Expand Up @@ -1874,6 +1874,17 @@ void test17344()

/*****************************************/

// https://issues.dlang.org/show_bug.cgi?id=17356

void test17356()
{
float4 a = 13, b = 0;
__simd_sto(XMM.STOUPS, b, a);
assert(b.array == [13, 13, 13, 13]);
}

/*****************************************/

int main()
{
test1();
Expand Down Expand Up @@ -1912,6 +1923,7 @@ int main()
testOPvecunsto();
test10447();
test17344();
test17356();

return 0;
}
Expand Down

0 comments on commit 1d29b79

Please sign in to comment.