+2016-09-23 Martin Liska <mliska@suse.cz>
+
+ * config/i386/i386.c (ix86_valid_target_attribute_inner_p):
+ Handle crc32.
+
2016-09-23 Martin Liska <mliska@suse.cz>
PR target/71652
IX86_ATTR_ISA ("mmx", OPT_mmmx),
IX86_ATTR_ISA ("pclmul", OPT_mpclmul),
IX86_ATTR_ISA ("popcnt", OPT_mpopcnt),
+ IX86_ATTR_ISA ("crc32", OPT_mcrc32),
IX86_ATTR_ISA ("sse", OPT_msse),
IX86_ATTR_ISA ("sse2", OPT_msse2),
IX86_ATTR_ISA ("sse3", OPT_msse3),
+2016-09-23 Martin Liska <mliska@suse.cz>
+
+ * gcc.target/i386/crc32-5.c: New test.
+
2016-09-23 Martin Liska <mliska@suse.cz>
* gcc.target/i386/pr71652.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "crc32b\[^\\n\]*eax" } } */
+/* { dg-final { scan-assembler "crc32w\[^\\n\]*eax" } } */
+/* { dg-final { scan-assembler "crc32l\[^\\n\]*eax" } } */
+
+#pragma GCC target ("crc32")
+
+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);
+}