From: Martin Liska Date: Fri, 23 Sep 2016 07:58:07 +0000 (+0200) Subject: Support movbe as a i386 target optimization node X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1822b732a37e5bae7ea25619f1b8a80a23c491ca;p=gcc.git Support movbe as a i386 target optimization node * gcc.target/i386/movbe-4.c: New test. * config/i386/i386.c (ix86_valid_target_attribute_inner_p): Handle movbe. From-SVN: r240394 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ecf6811457f..2ecd31e2279 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-09-23 Martin Liska + + * config/i386/i386.c (ix86_valid_target_attribute_inner_p): + Handle movbe. + 2016-09-23 Martin Liska * config/i386/i386.c (ix86_valid_target_attribute_inner_p): diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b1aa727a69f..143b905a341 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6526,6 +6526,7 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[], 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), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 80622c5805e..5db2a1c83c6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-09-23 Martin Liska + + * gcc.target/i386/movbe-4.c: New test. + 2016-09-23 Martin Liska * gcc.target/i386/crc32-5.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/movbe-4.c b/gcc/testsuite/gcc.target/i386/movbe-4.c new file mode 100644 index 00000000000..906709167e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/movbe-4.c @@ -0,0 +1,20 @@ +/* { 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 } } */