[Bug target/107671] i386: Missed optimization: use of bt in bit test pattern (using -O2 -mtune=core2)

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Nov 15 01:27:11 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107671

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---
We already have
----------cut from i386.md--------
15204;; Help combine recognize bt followed by setc
15205(define_insn_and_split "*bt<mode>_setcqi"
15206  [(set (subreg:SWI48 (match_operand:QI 0 "register_operand") 0)
15207        (zero_extract:SWI48
15208         (match_operand:SWI48 1 "register_operand")
15209         (const_int 1)
15210         (zero_extend:SI (match_operand:QI 2 "register_operand"))))
15211   (clobber (reg:CC FLAGS_REG))]
15212  "TARGET_USE_BT && ix86_pre_reload_split ()"
....

15262;; Help combine recognize bt followed by setnc
15263(define_insn_and_split "*bt<mode>_setncqi"
15264  [(set (match_operand:QI 0 "register_operand")
15265        (and:QI
15266         (not:QI
15267          (subreg:QI
15268           (lshiftrt:SWI48 (match_operand:SWI48 1 "register_operand")
15269                           (match_operand:QI 2 "register_operand")) 0))
15270         (const_int 1)))
15271   (clobber (reg:CC FLAGS_REG))]
15272  "TARGET_USE_BT && ix86_pre_reload_split ()"
15273  "#"
15274  "&& 1"


-----------cut end-------------

Guess we need more variants for that.


More information about the Gcc-bugs mailing list