Commit ad626759 by Michael Meissner

Add comment on ffs to say why optimizing it further is a bad idea.

From-SVN: r8564
parent 00f8ff66
...@@ -5439,6 +5439,10 @@ ...@@ -5439,6 +5439,10 @@
"" ""
"operands[2] = gen_reg_rtx (SImode);") "operands[2] = gen_reg_rtx (SImode);")
;; Note, you cannot optimize away the branch following the bsfl by assuming
;; that the destination is not modified if the input is 0, since not all
;; x86 implementations do this.
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "general_operand" "=&r") [(set (match_operand:SI 0 "general_operand" "=&r")
(plus:SI (ffs:SI (match_operand:SI 1 "general_operand" "rm")) (plus:SI (ffs:SI (match_operand:SI 1 "general_operand" "rm"))
...@@ -5453,7 +5457,6 @@ ...@@ -5453,7 +5457,6 @@
xops[0] = operands[0]; xops[0] = operands[0];
xops[1] = operands[1]; xops[1] = operands[1];
xops[2] = constm1_rtx; xops[2] = constm1_rtx;
/* Can there be a way to avoid the jump here? */
output_asm_insn (AS2 (bsf%L0,%1,%0), xops); output_asm_insn (AS2 (bsf%L0,%1,%0), xops);
#ifdef LOCAL_LABEL_PREFIX #ifdef LOCAL_LABEL_PREFIX
sprintf (buffer, \"jnz %sLFFSSI%d\", sprintf (buffer, \"jnz %sLFFSSI%d\",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment