aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-07-13 07:34:25 +0000
committerRichard Stallman <rms@gnu.org>1993-07-13 07:34:25 +0000
commit7a87bc57141f13a09196ae48a4cabc120f5f45b6 (patch)
tree5c8c31f61d9e4689ede8625d6bb712d3446952c6
parentda3c61151d5e85eb4723f3e8f5a2ed1c33e56ea6 (diff)
downloadgcc-7a87bc57141f13a09196ae48a4cabc120f5f45b6.zip
gcc-7a87bc57141f13a09196ae48a4cabc120f5f45b6.tar.gz
gcc-7a87bc57141f13a09196ae48a4cabc120f5f45b6.tar.bz2
(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
-rw-r--r--gcc/config/i386/i386.md25
1 files changed, 17 insertions, 8 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3b91864..983f497 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -4460,12 +4460,17 @@
""
"*
{
- rtx xops[2];
+ rtx xops[3];
xops[0] = operands[0];
- xops[1] = constm1_rtx;
- output_asm_insn (AS2 (mov%L0,%1,%0), xops);
- return AS2 (bsf%L0,%1,%0);
+ xops[1] = operands[1];
+ 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 (\"jnz 1f\", xops);
+ output_asm_insn (AS2 (mov%L0,%2,%0), xops);
+ output_asm_insn (\"1:\", xops);
+ return \"\";
}")
(define_expand "ffshi2"
@@ -4484,12 +4489,16 @@
""
"*
{
- rtx xops[2];
+ rtx xops[3];
xops[0] = operands[0];
- xops[1] = constm1_rtx;
- output_asm_insn (AS2 (mov%W0,%1,%0), xops);
- return AS2 (bsf%W0,%1,%0);
+ xops[1] = operands[1];
+ xops[2] = constm1_rtx;
+ 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,