2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / other / i386-11.C
blob8e06617fca55e56ab527832031cf40fb3973d0a4
1 // PR target/80799
2 // { dg-do compile { target i?86-*-* x86_64-*-* } }
3 // { dg-require-effective-target c++11 }
4 // { dg-options "-O2 -msse2" }
6 #include <xmmintrin.h>
7 #include <emmintrin.h>
9 class alignas(16) GSVector4i
11 public:
12     __m128i m;
14         explicit GSVector4i(__m128i m)
15         {
16                 this->m = m;
17         }
19         static void storel(void* p, const GSVector4i& v)
20         {
21                 _mm_storel_epi64((__m128i*)p, v.m);
22         }
24         static GSVector4i loadl(const void* p)
25         {
26                 return GSVector4i(_mm_loadl_epi64((__m128i*)p));
27         }
29         bool eq(const GSVector4i& v) const
30         {
31                 return _mm_movemask_epi8(_mm_cmpeq_epi32(m, v.m)) == 0xffff;
32         }
36 union GIFRegTRXPOS
38         unsigned long long u64;
39         void operator = (const GSVector4i& v) {GSVector4i::storel(this, v);}
40         bool operator != (const union GIFRegTRXPOS& r) const {return !((GSVector4i)r).eq(*this);}
41         operator GSVector4i() const {return GSVector4i::loadl(this);}
44 extern void dummy_call();
45 extern GIFRegTRXPOS TRXPOS;
47 void GIFRegHandlerTRXPOS(const GIFRegTRXPOS&  p)
49         if(p != TRXPOS)
50         {
51                 dummy_call();
52         }
54         TRXPOS = (GSVector4i)p;
57 // { dg-final { scan-assembler-not "%mm" } }