diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2016-12-19 21:23:08 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2016-12-19 21:23:08 +0100 |
commit | 6418b07737eb2dc44e9941812c665dc91fa962ed (patch) | |
tree | 5f095451827efcf4f167e9d971707070889f08ee /gcc/config/i386/i386.md | |
parent | f56013e5416cfddd5078e49df50f2a2db187392a (diff) | |
download | gcc-6418b07737eb2dc44e9941812c665dc91fa962ed.zip gcc-6418b07737eb2dc44e9941812c665dc91fa962ed.tar.gz gcc-6418b07737eb2dc44e9941812c665dc91fa962ed.tar.bz2 |
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
Diffstat (limited to 'gcc/config/i386/i386.md')
-rw-r--r-- | gcc/config/i386/i386.md | 18 |
1 files changed, 18 insertions, 0 deletions
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" "<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 |