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

--- Comment #2 from Hongtao.liu <crazylht at gmail dot com> ---
334Failed to match this instruction:
335(set (reg/v:SI 88 [ z ])
336    (if_then_else:SI (eq (zero_extract:SI (reg:SI 92)
337                (const_int 1 [0x1])
338                (zero_extend:SI (subreg:QI (reg:SI 93) 0)))
339            (const_int 0 [0]))
340        (reg:SI 95)
341        (reg:SI 94)))
342Failed to match this instruction:
343(set (reg/v:SI 88 [ z ])
344    (if_then_else:SI (eq (zero_extract:SI (reg:SI 92)
345                (const_int 1 [0x1])
346                (and:SI (reg:SI 93)
347                    (const_int 255 [0xff])))
348            (const_int 0 [0]))
349        (reg:SI 95)
350        (reg:SI 94)))

And original splitter is

+;; Help combine recognize bt followed by cmov
+(define_split
+  [(set (match_operand:SWI248 0 "register_operand")
+       (if_then_else:SWI248
+        (ne
+         (zero_extract:SWI48
+          (match_operand:SWI48 1 "register_operand")
+          (const_int 1)
+          (zero_extend:SI (match_operand:QI 2 "register_operand")))
+         (const_int 0))
+        (match_operand:SWI248 3 "nonimmediate_operand")
+        (match_operand:SWI248 4 "nonimmediate_operand")))]
+  "TARGET_USE_BT && TARGET_CMOVE
+   && !(MEM_P (operands[3]) && MEM_P (operands[4]))
+   && ix86_pre_reload_split ()"
+  [(set (reg:CCC FLAGS_REG)
+       (compare:CCC
+        (zero_extract:SWI48 (match_dup 1) (const_int 1) (match_dup 2))
+        (const_int 0)))
+   (set (match_dup 0)
+       (if_then_else:SWI248 (eq (reg:CCC FLAGS_REG) (const_int 0))
+                            (match_dup 3)
+                            (match_dup 4)))]
+{
+  operands[2] = lowpart_subreg (SImode, operands[2], QImode);
+})

Reply via email to