* gcc.target/i386/movbe-4.c: New test.
* config/i386/i386.c (ix86_valid_target_attribute_inner_p):
Handle movbe.
From-SVN: r240394
+2016-09-23 Martin Liska <mliska@suse.cz>
+
+ * config/i386/i386.c (ix86_valid_target_attribute_inner_p):
+ Handle movbe.
+
2016-09-23 Martin Liska <mliska@suse.cz>
* config/i386/i386.c (ix86_valid_target_attribute_inner_p):
IX86_ATTR_ISA ("mmx", OPT_mmmx),
IX86_ATTR_ISA ("pclmul", OPT_mpclmul),
IX86_ATTR_ISA ("popcnt", OPT_mpopcnt),
+ IX86_ATTR_ISA ("movbe", OPT_mmovbe),
IX86_ATTR_ISA ("crc32", OPT_mcrc32),
IX86_ATTR_ISA ("sse", OPT_msse),
IX86_ATTR_ISA ("sse2", OPT_msse2),
+2016-09-23 Martin Liska <mliska@suse.cz>
+
+ * gcc.target/i386/movbe-4.c: New test.
+
2016-09-23 Martin Liska <mliska@suse.cz>
* gcc.target/i386/crc32-5.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#pragma GCC target ("movbe")
+
+extern int x;
+
+void
+foo (int i)
+{
+ x = __builtin_bswap32 (i);
+}
+
+int
+bar ()
+{
+ return __builtin_bswap32 (x);
+}
+
+/* { dg-final { scan-assembler-times "movbe\[ \t\]" 2 } } */