[project @ 2002-07-16 12:05:37 by simonmar]
authorsimonmar <unknown>
Tue, 16 Jul 2002 12:05:37 +0000 (12:05 +0000)
committersimonmar <unknown>
Tue, 16 Jul 2002 12:05:37 +0000 (12:05 +0000)
un-rot one transformation on x86: we normally transform

movl $_blah, %eax
jmp  *%eax

into simply

jmp _blah

but the pattern had rotted w.r.t. gcc so this was no longer applying.
Should reduce code size measurably.

MERGE TO STABLE

ghc/driver/mangler/ghc-asm.lprl

index f3afb96..424477e 100644 (file)
@@ -1298,7 +1298,7 @@ sub print_doctored {
     #   jmp  *<bad-reg>
     #
 
-    s/^\tmovl\s+\$${T_US}(.*),(\%e[abcd]x)\n\tjmp\s+\*\2/\tjmp $T_US$1/g;
+    s/^\tmovl\s+\$${T_US}(.*),\s*(\%e[abcd]x)\n\tjmp\s+\*\2/\tjmp $T_US$1/g;
 
     if ($StolenX86Regs <= 2 ) { # YURGH! spurious uses of esi?
        s/^\tmovl\s+(.*),\s*\%esi\n\tjmp\s+\*%esi\n/\tmovl $1,\%eax\n\tjmp \*\%eax\n/g;