(define_insn ""
[(set (match_operand:QI 0 "bit_operand" "=r,U")
(ior:QI (match_operand:QI 1 "bit_operand" "%0,0")
- (match_operand:QI 2 "nonmemory_operand" "rn,P")))]
- "register_operand (operands[0], QImode) || p_operand (operands[2], QImode)"
- "@
- or %X2,%X0
- bset %V2,%R0"
+ (match_operand:QI 2 "nonmemory_operand" "rn,n")))]
+ "register_operand (operands[0], QImode)
+ || (GET_CODE (operands[2]) == CONST_INT
+ && exact_log2 (INTVAL (operands[2]) & 0xff) != -1)"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return \"or\t%X2,%X0\";
+ case 1:
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xff);
+ return \"bset\t%V2,%R0\";
+ default:
+ abort ();
+ }
+}"
[(set_attr "length" "2,8")
(set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])
(define_insn ""
[(set (match_operand:QI 0 "bit_operand" "=r,U")
(xor:QI (match_operand:QI 1 "bit_operand" "%0,0")
- (match_operand:QI 2 "nonmemory_operand" "rn,P")))]
- "register_operand (operands[0], QImode) || p_operand (operands[2], QImode)"
- "@
- xor %X2,%X0
- bnot %V2,%R0"
+ (match_operand:QI 2 "nonmemory_operand" "rn,n")))]
+ "register_operand (operands[0], QImode)
+ || (GET_CODE (operands[2]) == CONST_INT
+ && exact_log2 (INTVAL (operands[2]) & 0xff) != -1)"
+ "*
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return \"xor\t%X2,%X0\";
+ case 1:
+ operands[2] = GEN_INT (INTVAL (operands[2]) & 0xff);
+ return \"bnot\t%V2,%R0\";
+ default:
+ abort ();
+ }
+}"
[(set_attr "length" "2,8")
(set_attr "adjust_length" "no")
(set_attr "cc" "set_znv,none_0hit")])