[project @ 2000-06-13 15:35:29 by simonm]
authorsimonm <unknown>
Tue, 13 Jun 2000 15:35:29 +0000 (15:35 +0000)
committersimonm <unknown>
Tue, 13 Jun 2000 15:35:29 +0000 (15:35 +0000)
Bring in rev. 1.22.2.1 - Don't apply -monly-n-reg patches to _regBlah
functions (profiling cost-centre register things)

ghc/driver/mangler/ghc-asm.lprl

index 2b297ef..e640f42 100644 (file)
@@ -89,7 +89,7 @@ sub init_TARGET_STUFF {
     $T_COPY_DIRVS   = '^\s+\.(IMPORT|EXPORT)';
 
     $T_hsc_cc_PAT   = '\.STRING.*\)(hsc|cc) (.*)\\\\x09(.*)\\\\x00"';
-    $T_DOT_WORD            = '\.(blockz|word|half|byte)';
+    $T_DOT_WORD            = '\.word';
     $T_DOT_GLOBAL   = '^\s+\.EXPORT';
     $T_HDR_literal  = "\t.SPACE \$TEXT\$\n\t.SUBSPA \$LIT\$\n";
     $T_HDR_misc            = "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
@@ -126,7 +126,6 @@ sub init_TARGET_STUFF {
     $T_HDR_data            = "\.data\n\t\.align 2\n";
     $T_HDR_consist  = "\.text\n";
     $T_HDR_closure  = "\.data\n\t\.align 2\n";
-    $T_HDR_closure  = "\.data\n\t\.align 2\n\t.long 0\n" if ( $TargetPlatform =~ /.*-mingw32$/ );
     $T_HDR_srt      = "\.data\n\t\.align 2\n";
     $T_HDR_info            = "\.text\n\t\.align 2\n"; # NB: requires padding
     $T_HDR_entry    = "\.text\n"; # no .align so we're right next to _info (arguably wrong...?)
@@ -164,11 +163,11 @@ sub init_TARGET_STUFF {
     $T_HDR_consist  = "\.text\n";
     $T_HDR_closure  = "\.data\n\t\.align 4\n"; # ToDo: change align?
     $T_HDR_srt      = "\.data\n\t\.align 4\n"; # ToDo: change align?
-    $T_HDR_info            = "\.text\n\t\.align 4\n"; # NB: requires padding
+    $T_HDR_info            = "\.text\n\t\.align 16\n"; # NB: requires padding
     $T_HDR_entry    = "\.text\n"; # no .align so we're right next to _info (arguably wrong...?)
-    $T_HDR_fast            = "\.text\n\t\.align 4\n";
-    $T_HDR_vector   = "\.text\n\t\.align 4\n"; # NB: requires padding
-    $T_HDR_direct   = "\.text\n\t\.align 4\n";
+    $T_HDR_fast            = "\.text\n\t\.align 16\n";
+    $T_HDR_vector   = "\.text\n\t\.align 16\n"; # NB: requires padding
+    $T_HDR_direct   = "\.text\n\t\.align 16\n";
 
     #--------------------------------------------------------#
     } elsif ( $TargetPlatform =~ /^m68k-.*-sunos4/ ) {
@@ -265,7 +264,7 @@ sub init_TARGET_STUFF {
     $T_COPY_DIRVS   = '\.(global|proc|stab)';
 
     $T_hsc_cc_PAT   = '\.asciz.*\)(hsc|cc) (.*)\\\\t(.*)"';
-    $T_DOT_WORD            = '\.(word|byte|half|skip|uahalf|uaword)';
+    $T_DOT_WORD            = '\.(word|byte|half|skip)';
     $T_DOT_GLOBAL   = '^\t\.global';
     $T_HDR_literal  = "\.text\n\t\.align 8\n";
     $T_HDR_misc            = "\.text\n\t\.align 4\n";
@@ -644,7 +643,6 @@ sub mangle_asm {
                if ($TargetPlatform =~ /^i386-/) {
                    $p =~ s/^\tpushl \%edi\n//;
                    $p =~ s/^\tpushl \%esi\n//;
-                   $p =~ s/^\tpushl \%ebx\n//;
                    $p =~ s/^\tsubl \$\d+,\%esp\n//;
                     $p =~ s/^\tmovl \$\d+,\%eax\n\tcall __alloca\n// if ($TargetPlatform =~ /^.*-cygwin32/);
                } elsif ($TargetPlatform =~ /^m68k-/) {
@@ -704,7 +702,6 @@ sub mangle_asm {
                    $e =~ s/^\tret\n//;
                    $e =~ s/^\tpopl \%edi\n//;
                    $e =~ s/^\tpopl \%esi\n//;
-                   $e =~ s/^\tpopl \%ecx\n//;
                    $e =~ s/^\taddl \$\d+,\%esp\n//;
                } elsif ($TargetPlatform =~ /^m68k-/) {
                    $e =~ s/^\tunlk a6\n//;
@@ -1158,7 +1155,7 @@ sub print_doctored {
 
     if ( $TargetPlatform !~ /^i386-/ 
       || ! /^\t[a-z]/  # no instructions in here, apparently
-      || /^${T_US}_reg[A-Za-z0-9_]+${T_POST_LBL}/) {
+      || /^${T_US}_reg[A-Za-z0-9_]+:/) {
        print OUTASM $_;
        return;
     }
@@ -1336,7 +1333,7 @@ sub rev_tbl {
            push(@words, $lines[$i]);
        }
     } else { # hppa weirdness
-       for ( ; $i <= $#lines && $lines[$i] =~ /^\s+($TDOTWORD|\.IMPORT)/; $i++) {
+       for ( ; $i <= $#lines && $lines[$i] =~ /^\s+\.(word|IMPORT)/; $i++) {
            if ($lines[$i] =~ /^\s+\.IMPORT/) {
                push(@imports, $lines[$i]);
            } else {
@@ -1351,8 +1348,7 @@ sub rev_tbl {
     # now throw away the first word (SRT) iff it is empty.
     # The .zero business is for Linux/ELF.
     # The .skip business is for Sparc/Solaris/ELF.
-    # The .blockz business is for HPPA.
-    if ($discard1 && $words[0] =~ /^\t?($TDOTWORD\s+0|\.zero\s+4|\.skip\s+4|\.blockz\s+4)/) {
+    if ($discard1 && $words[0] =~ /^\t?($TDOTWORD\s+0|\.zero\s+4|\.skip\s+4)/) {
        shift(@words)
     }