mirror of git://gcc.gnu.org/git/gcc.git
i386.md (ctz<mode>2): Emit rep;bsf only for TARGET_GENERIC, when not optimizing for size.
* config/i386/i386.md (ctz<mode>2): Emit rep;bsf only for TARGET_GENERIC, when not optimizing for size. (*ffs<mode>_1): Ditto. From-SVN: r187247
This commit is contained in:
parent
198fc9f199
commit
60197adbfd
|
@ -1,3 +1,9 @@
|
||||||
|
2012-05-07 Uros Bizjak <ubizjak@gmail.com>
|
||||||
|
|
||||||
|
* config/i386/i386.md (ctz<mode>2): Emit rep;bsf
|
||||||
|
only for TARGET_GENERIC, when not optimizing for size.
|
||||||
|
(*ffs<mode>_1): Ditto.
|
||||||
|
|
||||||
2012-05-07 Steven Bosscher <steven@gcc.gnu.org>
|
2012-05-07 Steven Bosscher <steven@gcc.gnu.org>
|
||||||
|
|
||||||
* tree-cfg.c (verify_gimple_switch): Tighten checks.
|
* tree-cfg.c (verify_gimple_switch): Tighten checks.
|
||||||
|
|
|
@ -12113,21 +12113,25 @@
|
||||||
(ctz:SWI48 (match_dup 1)))]
|
(ctz:SWI48 (match_dup 1)))]
|
||||||
""
|
""
|
||||||
{
|
{
|
||||||
if (optimize_function_for_size_p (cfun))
|
if (TARGET_BMI)
|
||||||
return "bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
|
||||||
else if (TARGET_BMI)
|
|
||||||
return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
|
return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||||
else
|
else if (optimize_function_for_size_p (cfun))
|
||||||
|
;
|
||||||
|
else if (TARGET_GENERIC)
|
||||||
/* tzcnt expands to rep;bsf and we can use it even if !TARGET_BMI. */
|
/* tzcnt expands to rep;bsf and we can use it even if !TARGET_BMI. */
|
||||||
return "rep; bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
return "rep; bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||||
|
|
||||||
|
return "bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||||
}
|
}
|
||||||
[(set_attr "type" "alu1")
|
[(set_attr "type" "alu1")
|
||||||
(set_attr "prefix_0f" "1")
|
(set_attr "prefix_0f" "1")
|
||||||
(set (attr "prefix_rep")
|
(set (attr "prefix_rep")
|
||||||
(if_then_else
|
(if_then_else
|
||||||
(match_test "optimize_function_for_size_p (cfun)")
|
(ior (match_test "TARGET_BMI")
|
||||||
(const_string "0")
|
(and (not (match_test "optimize_function_for_size_p (cfun)"))
|
||||||
(const_string "1")))
|
(match_test "TARGET_GENERIC")))
|
||||||
|
(const_string "1")
|
||||||
|
(const_string "0")))
|
||||||
(set_attr "mode" "<MODE>")])
|
(set_attr "mode" "<MODE>")])
|
||||||
|
|
||||||
(define_insn "ctz<mode>2"
|
(define_insn "ctz<mode>2"
|
||||||
|
@ -12136,21 +12140,25 @@
|
||||||
(clobber (reg:CC FLAGS_REG))]
|
(clobber (reg:CC FLAGS_REG))]
|
||||||
""
|
""
|
||||||
{
|
{
|
||||||
if (optimize_function_for_size_p (cfun))
|
if (TARGET_BMI)
|
||||||
return "bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
|
||||||
else if (TARGET_BMI)
|
|
||||||
return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
|
return "tzcnt{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||||
else
|
else if (optimize_function_for_size_p (cfun))
|
||||||
|
;
|
||||||
|
else if (TARGET_GENERIC)
|
||||||
/* tzcnt expands to rep;bsf and we can use it even if !TARGET_BMI. */
|
/* tzcnt expands to rep;bsf and we can use it even if !TARGET_BMI. */
|
||||||
return "rep; bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
return "rep; bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||||
|
|
||||||
|
return "bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
|
||||||
}
|
}
|
||||||
[(set_attr "type" "alu1")
|
[(set_attr "type" "alu1")
|
||||||
(set_attr "prefix_0f" "1")
|
(set_attr "prefix_0f" "1")
|
||||||
(set (attr "prefix_rep")
|
(set (attr "prefix_rep")
|
||||||
(if_then_else
|
(if_then_else
|
||||||
(match_test "optimize_function_for_size_p (cfun)")
|
(ior (match_test "TARGET_BMI")
|
||||||
(const_string "0")
|
(and (not (match_test "optimize_function_for_size_p (cfun)"))
|
||||||
(const_string "1")))
|
(match_test "TARGET_GENERIC")))
|
||||||
|
(const_string "1")
|
||||||
|
(const_string "0")))
|
||||||
(set_attr "mode" "<MODE>")])
|
(set_attr "mode" "<MODE>")])
|
||||||
|
|
||||||
(define_expand "clz<mode>2"
|
(define_expand "clz<mode>2"
|
||||||
|
|
Loading…
Reference in New Issue