[Bug target/122018] x86 doesn't use BTS bitmanip instruction to both set and test bit

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Aug 12 12:17:37 GMT 2026


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

--- Comment #19 from Uroš Bizjak <ubizjak at gmail dot com> ---
Comment on attachment 65301
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65301
i386: include bit test patterns in bts, btc and btr to remove redundant bt

>+(define_insn_and_split "*<btsc><mode>_old"
>+  [(set (match_operand:SWI48 0 "register_operand" "=r")
>+	(any_or:SWI48
>+	  (ashift:SWI48 (const_int 1)
>+			(match_operand:QI 2 "register_operand" "r"))
>+	  (match_operand:SWI48 1 "register_operand" "0")))
>+   (clobber (reg:CC FLAGS_REG))]
>+  "TARGET_USE_BT
>+   && ix86_pre_reload_split ()"

You don't need constraints for pre-reload splitter.


More information about the Gcc-bugs mailing list