Debian Codegraph @

gcc/testsuite/g++.dg/other/i386-11.C

raw
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" }
5 /* { dg-skip-if "requires hosted libstdc++ for cstdlib malloc" { ! hostedlib } } */
6
7 #include <xmmintrin.h>
8 #include <emmintrin.h>
9
10 class alignas(16) GSVector4i
11 {
12 public:
13 __m128i m;
14
15 explicit GSVector4i(__m128i m)
16 {
17 this->m = m;
18 }
19
20 static void storel(void* p, const GSVector4i& v)
21 {
22 _mm_storel_epi64((__m128i*)p, v.m);
23 }
24
25 static GSVector4i loadl(const void* p)
26 {
27 return GSVector4i(_mm_loadl_epi64((__m128i*)p));
28 }
29
30 bool eq(const GSVector4i& v) const
31 {
32 return _mm_movemask_epi8(_mm_cmpeq_epi32(m, v.m)) == 0xffff;
33 }
34 };
35
36
37 union GIFRegTRXPOS
38 {
39 unsigned long long u64;
40 void operator = (const GSVector4i& v) {GSVector4i::storel(this, v);}
41 bool operator != (const union GIFRegTRXPOS& r) const {return !((GSVector4i)r).eq(*this);}
42 operator GSVector4i() const {return GSVector4i::loadl(this);}
43 };
44
45 extern void dummy_call();
46 extern GIFRegTRXPOS TRXPOS;
47
48 void GIFRegHandlerTRXPOS(const GIFRegTRXPOS& p)
49 {
50 if(p != TRXPOS)
51 {
52 dummy_call();
53 }
54
55 TRXPOS = (GSVector4i)p;
56 }
57
58 // { dg-final { scan-assembler-not "%mm" } }