i386.md (ctz<mode>2): Emit rep;bsf even for !TARGET_BMI.
* config/i386/i386.md (ctz<mode>2): Emit rep;bsf even for !TARGET_BMI. Emit bsf when optimizing for size. (*ffs<mode>_1): Ditto. Co-Authored-By: Paolo Bonzini <bonzini@gnu.org> From-SVN: r187219
This commit is contained in:
parent
0345d1dd2a
commit
19010925aa
|
@ -1,3 +1,10 @@
|
|||
2012-05-07 Uros Bizjak <ubizjak@gmail.com>
|
||||
Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* config/i386/i386.md (ctz<mode>2): Emit rep;bsf even for !TARGET_BMI.
|
||||
Emit bsf when optimizing for size.
|
||||
(*ffs<mode>_1): Ditto.
|
||||
|
||||
2012-05-07 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
PR target/53250
|
||||
|
|
|
@ -12112,9 +12112,22 @@
|
|||
(set (match_operand:SWI48 0 "register_operand" "=r")
|
||||
(ctz:SWI48 (match_dup 1)))]
|
||||
""
|
||||
"bsf{<imodesuffix>}\t{%1, %0|%0, %1}"
|
||||
{
|
||||
if (optimize_function_for_size_p (cfun))
|
||||
return "bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||
else if (TARGET_BMI)
|
||||
return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||
else
|
||||
/* tzcnt expands to rep;bsf and we can use it even if !TARGET_BMI. */
|
||||
return "rep; bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||
}
|
||||
[(set_attr "type" "alu1")
|
||||
(set_attr "prefix_0f" "1")
|
||||
(set (attr "prefix_rep")
|
||||
(if_then_else
|
||||
(match_test "optimize_function_for_size_p (cfun)")
|
||||
(const_string "0")
|
||||
(const_string "1")))
|
||||
(set_attr "mode" "<MODE>")])
|
||||
|
||||
(define_insn "ctz<mode>2"
|
||||
|
@ -12123,14 +12136,21 @@
|
|||
(clobber (reg:CC FLAGS_REG))]
|
||||
""
|
||||
{
|
||||
if (TARGET_BMI)
|
||||
return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||
else
|
||||
if (optimize_function_for_size_p (cfun))
|
||||
return "bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||
else if (TARGET_BMI)
|
||||
return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||
else
|
||||
/* tzcnt expands to rep;bsf and we can use it even if !TARGET_BMI. */
|
||||
return "rep; bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||
}
|
||||
[(set_attr "type" "alu1")
|
||||
(set_attr "prefix_0f" "1")
|
||||
(set (attr "prefix_rep") (symbol_ref "TARGET_BMI"))
|
||||
(set (attr "prefix_rep")
|
||||
(if_then_else
|
||||
(match_test "optimize_function_for_size_p (cfun)")
|
||||
(const_string "0")
|
||||
(const_string "1")))
|
||||
(set_attr "mode" "<MODE>")])
|
||||
|
||||
(define_expand "clz<mode>2"
|
||||
|
|
Loading…
Reference in New Issue