(set_attr "mode" "SI")])
(define_insn "bsr_rex64"
- [(set (match_operand:DI 0 "register_operand" "=r")
+ [(set (reg:CCZ FLAGS_REG)
+ (compare:CCZ (match_operand:DI 1 "nonimmediate_operand" "rm")
+ (const_int 0)))
+ (set (match_operand:DI 0 "register_operand" "=r")
(minus:DI (const_int 63)
- (clz:DI (match_operand:DI 1 "nonimmediate_operand" "rm"))))
- (clobber (reg:CC FLAGS_REG))]
+ (clz:DI (match_dup 1))))]
"TARGET_64BIT"
"bsr{q}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")
(set_attr "mode" "DI")])
(define_insn "bsr"
- [(set (match_operand:SI 0 "register_operand" "=r")
+ [(set (reg:CCZ FLAGS_REG)
+ (compare:CCZ (match_operand:SI 1 "nonimmediate_operand" "rm")
+ (const_int 0)))
+ (set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (const_int 31)
- (clz:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))))
- (clobber (reg:CC FLAGS_REG))]
+ (clz:SI (match_dup 1))))]
""
"bsr{l}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")
(set_attr "znver1_decode" "vector")
(set_attr "mode" "SI")])
-(define_insn "*bsrhi"
- [(set (match_operand:HI 0 "register_operand" "=r")
- (minus:HI (const_int 15)
- (clz:HI (match_operand:HI 1 "nonimmediate_operand" "rm"))))
- (clobber (reg:CC FLAGS_REG))]
- ""
- "bsr{w}\t{%1, %0|%0, %1}"
- [(set_attr "type" "alu1")
- (set_attr "prefix_0f" "1")
- (set_attr "znver1_decode" "vector")
- (set_attr "mode" "HI")])
-
(define_expand "clz<mode>2"
[(parallel
- [(set (match_operand:SWI48 0 "register_operand")
+ [(set (reg:CCZ FLAGS_REG)
+ (compare:CCZ (match_operand:SWI48 1 "nonimmediate_operand" "rm")
+ (const_int 0)))
+ (set (match_operand:SWI48 0 "register_operand")
(minus:SWI48
(match_dup 2)
- (clz:SWI48 (match_operand:SWI48 1 "nonimmediate_operand"))))
- (clobber (reg:CC FLAGS_REG))])
+ (clz:SWI48 (match_dup 1))))])
(parallel
[(set (match_dup 0) (xor:SWI48 (match_dup 0) (match_dup 2)))
(clobber (reg:CC FLAGS_REG))])]