From 6418b07737eb2dc44e9941812c665dc91fa962ed Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 19 Dec 2016 21:23:08 +0100 Subject: i386.md (*popcounthi2_1): New insn_and_split pattern. * config/i386/i386.md (*popcounthi2_1): New insn_and_split pattern. testsuite/ChangeLog: * gcc.target/i386/pr59874-3.c: New test. From-SVN: r243811 --- gcc/config/i386/i386.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gcc/config/i386/i386.md') diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 2123914..a88c0b8 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -13221,6 +13221,24 @@ (set_attr "type" "bitmanip") (set_attr "mode" "")]) +(define_insn_and_split "*popcounthi2_1" + [(set (match_operand:SI 0 "register_operand") + (popcount:SI + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand")))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_POPCNT + && can_create_pseudo_p ()" + "#" + "&& 1" + [(const_int 0)] +{ + rtx tmp = gen_reg_rtx (HImode); + + emit_insn (gen_popcounthi2 (tmp, operands[1])); + emit_insn (gen_zero_extendhisi2 (operands[0], tmp)); + DONE; +}) + (define_insn "popcounthi2" [(set (match_operand:HI 0 "register_operand" "=r") (popcount:HI -- cgit v1.1