This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix for PR 37809 and 37807


Hello!

diff --git a/gcc/testsuite/gcc.target/i386/mmx-8.c b/gcc/testsuite/gcc.target/i386/mmx-8.c
new file mode 100644
index 0000000..9d665f0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/mmx-8.c
@@ -0,0 +1,136 @@
+/* PR middle-end/37809 */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -mmmx" } */
+
+#include <mmintrin.h>
+
+// Various tests of cases where it is incorrect to optimise vectors as if they
+// were integers of the same width.
+
+extern void abort (void);
+
+/* #include <stdio.h> */
+/* #define FAIL(...) printf (__VA_ARGS__); */
+#define FAIL(...) abort();

Please remove the definitions above and simply call abort() at FAIL site. Alternatively, you can check for DEBUG definition to enable additional debug information (see i.e. gcc.target/i386/mmx-4.c)


+
+
+void Sshift()
+{
+ volatile __m64 y = (__m64) 0xffffffffll;
+ __m64 x = y & (__m64) 0xffffffffll;
+ x = _m_psradi (x, 1);
+ x &= (__m64) 0x80000000ll;
+ if (0 == (long long) x)

Aliasing violation on x variable. You should use union here and through the source. You should check your testcase with -Wstrict-aliasing {,=n}.


+int main()
+{
+ Sshift();
+ shiftU1();
+ shiftU2();
+ shiftU3();
+ shiftU4();
+ add();
+ add2();
+
+ mult1();
+ mult2();
+ mult3();
+ div();
+ return 0;
+}

Please note, that since this is MMX runtime testcase, you should check for MMX support at runtime. Please look into gcc.target/i386/builtin-apply-mmx.c or gcc.target/i386/mmx-4.c how to use support for runtime check, as present in mmx-check.h header.


Thanks,
Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]