(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_expand "crc_rev<SWI124:mode>si4"
+ [(match_operand:SI 0 "register_operand")
+ (match_operand:SI 1 "register_operand")
+ (match_operand:SWI124 2 "nonimmediate_operand")
+ (match_operand:SI 3)]
+ "TARGET_CRC32"
+{
+ /* crc32 uses iSCSI polynomial */
+ if (INTVAL (operands[3]) == 0x1EDC6F41)
+ emit_insn (gen_sse4_2_crc32<mode> (operands[0], operands[1], operands[2]));
+ else
+ expand_reversed_crc_table_based (operands[0], operands[1], operands[2],
+ operands[3], <SWI124:MODE>mode,
+ generate_reflecting_code_standard);
+ DONE;
+})
+
(define_insn "rdpmc"
[(set (match_operand:DI 0 "register_operand" "=A")
(unspec_volatile:DI [(match_operand:SI 1 "register_operand" "c")]
--- /dev/null
+/* PR target/120719 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcrc32" } */
+
+#include <stdint-gcc.h>
+
+int32_t rev_crc32_data8 (int8_t v)
+{
+ return __builtin_rev_crc32_data8 (0xffffffff, v, 0x1EDC6F41);
+}
+
+int32_t rev_crc32_data16 (int16_t v)
+{
+ return __builtin_rev_crc32_data16 (0xffffffff, v, 0x1EDC6F41);
+}
+
+int32_t rev_crc32_data32 (int32_t v)
+{
+ return __builtin_rev_crc32_data32 (0xffffffff, v, 0x1EDC6F41);
+}
+
+/* { dg-final { scan-assembler-times "\tcrc32" 3 } } */