summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/i386-11.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/i386-11.C')
-rw-r--r--gcc/testsuite/g++.dg/other/i386-11.C57
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/i386-11.C b/gcc/testsuite/g++.dg/other/i386-11.C
new file mode 100644
index 00000000000..8e06617fca5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/i386-11.C
@@ -0,0 +1,57 @@
+// PR target/80799
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target c++11 }
+// { dg-options "-O2 -msse2" }
+
+#include <xmmintrin.h>
+#include <emmintrin.h>
+
+class alignas(16) GSVector4i
+{
+public:
+ __m128i m;
+
+ explicit GSVector4i(__m128i m)
+ {
+ this->m = m;
+ }
+
+ static void storel(void* p, const GSVector4i& v)
+ {
+ _mm_storel_epi64((__m128i*)p, v.m);
+ }
+
+ static GSVector4i loadl(const void* p)
+ {
+ return GSVector4i(_mm_loadl_epi64((__m128i*)p));
+ }
+
+ bool eq(const GSVector4i& v) const
+ {
+ return _mm_movemask_epi8(_mm_cmpeq_epi32(m, v.m)) == 0xffff;
+ }
+};
+
+
+union GIFRegTRXPOS
+{
+ unsigned long long u64;
+ void operator = (const GSVector4i& v) {GSVector4i::storel(this, v);}
+ bool operator != (const union GIFRegTRXPOS& r) const {return !((GSVector4i)r).eq(*this);}
+ operator GSVector4i() const {return GSVector4i::loadl(this);}
+};
+
+extern void dummy_call();
+extern GIFRegTRXPOS TRXPOS;
+
+void GIFRegHandlerTRXPOS(const GIFRegTRXPOS& p)
+{
+ if(p != TRXPOS)
+ {
+ dummy_call();
+ }
+
+ TRXPOS = (GSVector4i)p;
+}
+
+// { dg-final { scan-assembler-not "%mm" } }