[project @ 1998-03-16 20:23:24 by sof]
authorsof <unknown>
Mon, 16 Mar 1998 20:23:24 +0000 (20:23 +0000)
committersof <unknown>
Mon, 16 Mar 1998 20:23:24 +0000 (20:23 +0000)
x86: Catch fast entry points fallthroughs via %esi and %edi

ghc/driver/ghc-asm.lprl

index 95aaa7d..6c6ac74 100644 (file)
@@ -994,9 +994,14 @@ sub mangle_asm {
                    } elsif ( $TargetPlatform =~ /^hppa/ ) {
                        $c =~ s/^\s+ldil.*\n\s+ldo.*\n\s+bv.*\n(.*\n)?\s+\.EXIT/$1\t.EXIT/;
                    } elsif ( $TargetPlatform =~ /^i386-/ ) {
+                       # Reg alloc depending, gcc generated code may jump to the fast entry point via
+                       # a number of registers.
                        $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%edx\n\tjmp \*\%edx\n//;
                        $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%ecx\n\tjmp \*\%ecx\n//;
                        $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%eax\n\tjmp \*\%eax\n//;
+                       # The next two only apply if we're not stealing %esi or %edi.
+                       $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%esi\n\tjmp \*\%esi\n// if ($StolenX86Regs < 3);
+                       $c =~ s/^\tmovl \$${T_US}${symb}_fast\d+,\%edi\n\tjmp \*\%edi\n// if ($StolenX86Regs < 4);
                    } elsif ( $TargetPlatform =~ /^mips-/ ) {
                        $c =~ s/^\tjmp \$31,\(\$27\),0\n\t\.align 4\n\t\.end/\t.align 4\n\t.end/;
                    } elsif ( $TargetPlatform =~ /^m68k-/ ) {