Commit 7a87bc57 by Richard Stallman

(ffssi2, ffshi2): Assume bsf produces garbage if input is 0.

(ffssi2, ffshi2): Assume bsf produces
garbage if input is 0.  Use jumps to load output in that case.

From-SVN: r4911
parent da3c6115
...@@ -4460,12 +4460,17 @@ ...@@ -4460,12 +4460,17 @@
"" ""
"* "*
{ {
rtx xops[2]; rtx xops[3];
xops[0] = operands[0]; xops[0] = operands[0];
xops[1] = constm1_rtx; xops[1] = operands[1];
output_asm_insn (AS2 (mov%L0,%1,%0), xops); xops[2] = constm1_rtx;
return AS2 (bsf%L0,%1,%0); /* Can there be a way to avoid the jump here? */
output_asm_insn (AS2 (bsf%L0,%1,%0), xops);
output_asm_insn (\"jnz 1f\", xops);
output_asm_insn (AS2 (mov%L0,%2,%0), xops);
output_asm_insn (\"1:\", xops);
return \"\";
}") }")
(define_expand "ffshi2" (define_expand "ffshi2"
...@@ -4484,12 +4489,16 @@ ...@@ -4484,12 +4489,16 @@
"" ""
"* "*
{ {
rtx xops[2]; rtx xops[3];
xops[0] = operands[0]; xops[0] = operands[0];
xops[1] = constm1_rtx; xops[1] = operands[1];
output_asm_insn (AS2 (mov%W0,%1,%0), xops); xops[2] = constm1_rtx;
return AS2 (bsf%W0,%1,%0); output_asm_insn (AS2 (bsf%W0,%1,%0), xops);
output_asm_insn (\"jnz 1f\", xops);
output_asm_insn (AS2 (mov%W0,%2,%0), xops);
output_asm_insn (\"1:\", xops);
return \"\";
}") }")
;; These patterns match the binary 387 instructions for addM3, subM3, ;; These patterns match the binary 387 instructions for addM3, subM3,
......
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