diff options
author | H.J. Lu <hjl@gcc.gnu.org> | 2009-06-11 21:27:34 -0700 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2009-06-11 21:27:34 -0700 |
commit | 8ed0ce9982d3a3ae3317d5fa44b96b391f58c385 (patch) | |
tree | cd70cca5a8136571862ac9c47c322e9e1e935637 /gcc/testsuite | |
parent | 9fd68a1f1b247b2145a4fb8517ffbf937c9cc36d (diff) | |
download | gcc-8ed0ce9982d3a3ae3317d5fa44b96b391f58c385.zip gcc-8ed0ce9982d3a3ae3317d5fa44b96b391f58c385.tar.gz gcc-8ed0ce9982d3a3ae3317d5fa44b96b391f58c385.tar.bz2 |
i386.c (OPTION_MASK_ISA_CRC32_SET): New.
gcc/
2009-06-11 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (OPTION_MASK_ISA_CRC32_SET): New.
(OPTION_MASK_ISA_CRC32_UNSET): Likewise.
(ix86_handle_option): Handle OPT_mcrc32.
(ix86_target_string): Add -mcrc32.
(bdesc_args): Enable crc32 builtins with OPTION_MASK_ISA_CRC32.
* config/i386/i386.h (TARGET_CRC32): New.
* config/i386/i386.md (sse4_2_crc32<mode>): Also check
TARGET_CRC32.
(sse4_2_crc32di): Likewise.
* config/i386/i386.opt (mcrc32: New.
* doc/invoke.texi: Document -mcrc32.
gcc/testsuite/
2009-06-11 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/crc32-1.c: New.
* gcc.target/i386/crc32-2.c: Likewise.
From-SVN: r148410
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/crc32-1.c | 23 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/crc32-2.c | 9 |
3 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8d1a113..f64d23f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-06-11 H.J. Lu <hongjiu.lu@intel.com> + + * gcc.target/i386/crc32-1.c: New. + * gcc.target/i386/crc32-2.c: Likewise. + 2009-06-11 David Daney <ddaney@caviumnetworks.com> PR c/39252 diff --git a/gcc/testsuite/gcc.target/i386/crc32-1.c b/gcc/testsuite/gcc.target/i386/crc32-1.c new file mode 100644 index 0000000..b3ed5b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/crc32-1.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcrc32" } */ +/* { dg-final { scan-assembler "crc32b\[^\\n\]*eax" } } */ +/* { dg-final { scan-assembler "crc32w\[^\\n\]*eax" } } */ +/* { dg-final { scan-assembler "crc32l\[^\\n\]*eax" } } */ + +unsigned int +crc32b (unsigned int x, unsigned char y) +{ + return __builtin_ia32_crc32qi (x, y); +} + +unsigned int +crc32w (unsigned int x, unsigned short y) +{ + return __builtin_ia32_crc32hi (x, y); +} + +unsigned int +crc32d (unsigned int x, unsigned int y) +{ + return __builtin_ia32_crc32si (x, y); +} diff --git a/gcc/testsuite/gcc.target/i386/crc32-2.c b/gcc/testsuite/gcc.target/i386/crc32-2.c new file mode 100644 index 0000000..e7af9ab --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/crc32-2.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcrc32" } */ +/* { dg-final { scan-assembler "crc32q\[^\\n\]*rax" { target lp64 } } } */ + +unsigned long long +crc32d (unsigned long long x, unsigned long long y) +{ + return __builtin_ia32_crc32di (x, y); +} |