(set_attr "mode" "SI,DI,DI,SI")])
(define_insn_and_split "*anddi_1_btr"
- [(set (match_operand:DI 0 "register_operand" "=r")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(and:DI
- (match_operand:DI 1 "register_operand" "%0")
+ (match_operand:DI 1 "nonimmediate_operand" "%0")
(match_operand:DI 2 "const_int_operand" "n")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_USE_BT
+ && ix86_binary_operator_ok (AND, DImode, operands)
&& IN_RANGE (exact_log2 (~INTVAL (operands[2])), 31, 63)"
"#"
"&& reload_completed"
(set_attr "mode" "<MODE>")])
(define_insn_and_split "*iordi_1_bts"
- [(set (match_operand:DI 0 "register_operand" "=r")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(ior:DI
- (match_operand:DI 1 "register_operand" "%0")
+ (match_operand:DI 1 "nonimmediate_operand" "%0")
(match_operand:DI 2 "const_int_operand" "n")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_USE_BT
+ && ix86_binary_operator_ok (IOR, DImode, operands)
&& IN_RANGE (exact_log2 (INTVAL (operands[2])), 31, 63)"
"#"
"&& reload_completed"
(set_attr "mode" "DI")])
(define_insn_and_split "*xordi_1_btc"
- [(set (match_operand:DI 0 "register_operand" "=r")
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(xor:DI
- (match_operand:DI 1 "register_operand" "%0")
+ (match_operand:DI 1 "nonimmediate_operand" "%0")
(match_operand:DI 2 "const_int_operand" "n")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_USE_BT
+ && ix86_binary_operator_ok (XOR, DImode, operands)
&& IN_RANGE (exact_log2 (INTVAL (operands[2])), 31, 63)"
"#"
"&& reload_completed"
;; Bit set / bit test instructions
;; %%% bts, btr, btc, bt.
-;; In general these instructions are *slow* when applied to memory,
-;; since they enforce atomic operation. When applied to registers,
-;; it depends on the cpu implementation. They're never faster than
-;; the corresponding and/ior/xor operations, so with 32-bit there's
+;; In general these instructions are *slow* with variable operand
+;; when applied to memory. When applied to registers, it depends
+;; on the cpu implementation. They're never faster than the
+;; corresponding and/ior/xor operations, so with 32-bit there's
;; no point. But in 64-bit, we can't hold the relevant immediates
;; within the instruction itself, so operating on bits in the high
;; 32-bits of a register becomes easier.
;; negdf respectively, so they can never be disabled entirely.
(define_insn "*btsq"
- [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r")
+ [(set (zero_extract:DI (match_operand:DI 0 "nonimmediate_operand" "+rm")
(const_int 1)
(match_operand 1 "const_0_to_63_operand" "J"))
(const_int 1))
(set_attr "mode" "DI")])
(define_insn "*btrq"
- [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r")
+ [(set (zero_extract:DI (match_operand:DI 0 "nonimmediate_operand" "+rm")
(const_int 1)
(match_operand 1 "const_0_to_63_operand" "J"))
(const_int 0))
(set_attr "mode" "DI")])
(define_insn "*btcq"
- [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r")
+ [(set (zero_extract:DI (match_operand:DI 0 "nonimmediate_operand" "+rm")
(const_int 1)
(match_operand 1 "const_0_to_63_operand" "J"))
(not:DI (zero_extract:DI (match_dup 0) (const_int 1) (match_dup 1))))
(define_peephole2
[(match_scratch:DI 2 "r")
(parallel [(set (zero_extract:DI
- (match_operand:DI 0 "register_operand")
+ (match_operand:DI 0 "nonimmediate_operand")
(const_int 1)
(match_operand 1 "const_0_to_63_operand"))
(const_int 1))
(define_peephole2
[(match_scratch:DI 2 "r")
(parallel [(set (zero_extract:DI
- (match_operand:DI 0 "register_operand")
+ (match_operand:DI 0 "nonimmediate_operand")
(const_int 1)
(match_operand 1 "const_0_to_63_operand"))
(const_int 0))
(define_peephole2
[(match_scratch:DI 2 "r")
(parallel [(set (zero_extract:DI
- (match_operand:DI 0 "register_operand")
+ (match_operand:DI 0 "nonimmediate_operand")
(const_int 1)
(match_operand 1 "const_0_to_63_operand"))
(not:DI (zero_extract:DI
(zero_extract:SWI48
(match_operand:SWI48 0 "register_operand" "r")
(const_int 1)
- (match_operand:SI 1 "nonmemory_operand" "rN"))
+ (match_operand:SI 1 "nonmemory_operand" "r<S>"))
(const_int 0)))]
""
{