Skip to content

Commit

Permalink
partly resolve Issue 10226 - inefficient core.simd codegen
Browse files Browse the repository at this point in the history
- fix localization of float vector expressions passed to
  void16 parameters of simd intrinsics
  • Loading branch information
MartinNowak committed Mar 14, 2017
1 parent 0089ae0 commit 194fa0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ddmd/backend/glocal.c
Expand Up @@ -341,7 +341,12 @@ STATIC void local_exp(elem *e,int goal)
{
if (tysize(em->Ety) == tysize(e->Ety) &&
em->E1->EV.sp.Voffset == e->EV.sp.Voffset &&
(tyfloating(em->Ety) != 0) == (tyfloating(e->Ety) != 0) &&
((tyfloating(em->Ety) != 0) == (tyfloating(e->Ety) != 0) ||
/** Hack to fix https://issues.dlang.org/show_bug.cgi?id=10226
* Recognize assignments of float vectors to void16, as used by
* core.simd intrinsics. The backend type for void16 is Tschar16!
*/
(tyvector(em->Ety) != 0) == (tyvector(e->Ety) != 0) && tybasic(e->Ety) == TYschar16) &&
!local_preserveAssignmentTo(em->E1->Ety))
{
#ifdef DEBUG
Expand Down

0 comments on commit 194fa0a

Please sign in to comment.