D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21037 - AVX code sometimes fails to set VEX prefix
Summary: AVX code sometimes fails to set VEX prefix
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 All
: P1 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2020-07-11 10:32 UTC by Walter Bright
Modified: 2020-07-11 19:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Walter Bright 2020-07-11 10:32:19 UTC
Suddenly this started failing in the test suite. The failing code is extracted from runnable/testxmm.d:

------------------------------------
import core.simd;
import core.stdc.string;
import core.stdc.stdio;

version (D_AVX)
{
    void foo_byte32(byte t, byte s)
    {
        byte32 f = s;  (***)
        auto p = cast(byte*)&f;
        foreach (i; 0 .. 32)
	{
	    printf("[%d]: %d\n", i, p[i]);
            assert(p[i] == s);
	}
    }

    void main()
    {
        foo_byte32(5, -10);
    }
}

The (***) is where the problem is, the MOVDQA instruction generated should be VMOVDQA.
Comment 1 Dlang Bot 2020-07-11 19:29:34 UTC
dlang/dmd pull request #11406 "fix Issue 21037 - AVX code sometimes fails to set VEX prefix" was merged into master:

- 9f6bd4504a85ef86b84f41a36e8759c8cec02bb7 by Walter Bright:
  fix Issue 21037 - AVX code sometimes fails to set VEX prefix

https://github.com/dlang/dmd/pull/11406