;; For all sCOND expanders, also expand the compare or test insn that
;; generates cc0. Generate an equality comparison if `seq' or `sne'.
+;; The 386 sCOND opcodes can write to memory. But a gcc sCOND insn may
+;; not have any input reloads. A MEM write might need an input reload
+;; for the address of the MEM. So don't allow MEM as the SET_DEST.
+
(define_expand "seq"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(eq:QI (cc0) (const_int 0)))]
""
"
}")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(eq:QI (cc0) (const_int 0)))]
""
"*
(define_expand "sne"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(ne:QI (cc0) (const_int 0)))]
""
"
}")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(ne:QI (cc0) (const_int 0)))]
""
"*
(define_expand "sgt"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(gt:QI (cc0) (const_int 0)))]
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(gt:QI (cc0) (const_int 0)))]
""
"*
(define_expand "sgtu"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(gtu:QI (cc0) (const_int 0)))]
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(gtu:QI (cc0) (const_int 0)))]
""
"* return \"seta %0\"; ")
(define_expand "slt"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(lt:QI (cc0) (const_int 0)))]
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(lt:QI (cc0) (const_int 0)))]
""
"*
(define_expand "sltu"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(ltu:QI (cc0) (const_int 0)))]
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(ltu:QI (cc0) (const_int 0)))]
""
"* return \"setb %0\"; ")
(define_expand "sge"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(ge:QI (cc0) (const_int 0)))]
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(ge:QI (cc0) (const_int 0)))]
""
"*
(define_expand "sgeu"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(geu:QI (cc0) (const_int 0)))]
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(geu:QI (cc0) (const_int 0)))]
""
"* return \"setae %0\"; ")
(define_expand "sle"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(le:QI (cc0) (const_int 0)))]
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(le:QI (cc0) (const_int 0)))]
""
"*
(define_expand "sleu"
[(match_dup 1)
- (set (match_operand:QI 0 "general_operand" "")
+ (set (match_operand:QI 0 "register_operand" "")
(leu:QI (cc0) (const_int 0)))]
""
"operands[1] = (*i386_compare_gen)(i386_compare_op0, i386_compare_op1);")
(define_insn ""
- [(set (match_operand:QI 0 "general_operand" "=qm")
+ [(set (match_operand:QI 0 "register_operand" "=q")
(leu:QI (cc0) (const_int 0)))]
""
"* return \"setbe %0\"; ")