Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
28afcb27
Commit
28afcb27
authored
25 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-07-30 14:20:22 by simonmar]
Fix -monly-3-regs problem.
parent
d43851fc
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/driver/ghc-asm.lprl
+15
-6
15 additions, 6 deletions
ghc/driver/ghc-asm.lprl
with
15 additions
and
6 deletions
ghc/driver/ghc-asm.lprl
+
15
−
6
View file @
28afcb27
...
...
@@ -147,7 +147,7 @@ sub init_TARGET_STUFF {
$T_X86_PRE_LLBL = '.L';
$T_X86_BADJMP = '^\tjmp [^\.\*]';
$T_MOVE_DIRVS = '^(\s*(\.(p2)?align\s+\d+(,0x90)?|\.globl\s+\S+|\.text|\.data|\.section\s+.*|\.type\s+.*|\.Lfe.*\n\t\.size\s+.*|\.
size\s+.*|\.
ident.*)\n)';
$T_MOVE_DIRVS = '^(\s*(\.(p2)?align\s+\d+(,0x90)?|\.globl\s+\S+|\.text|\.data|\.section\s+.*|\.
size\s+.*|\.
type\s+.*|\.Lfe.*\n\t\.size\s+.*|\.ident.*)\n)';
$T_COPY_DIRVS = '\.(globl)';
if ( $TargetPlatform =~ /freebsd3/ ) {
...
...
@@ -684,7 +684,7 @@ sub mangle_asm {
}
die "Prologue junk?: $p\n" if $p =~ /^\t[^\.]/
&& $TargetPlatform !~ /^powerpc-/; #ToDo: remove test
&& $TargetPlatform !~ /^
(
powerpc-
|i386-)
/; #ToDo: remove test
# glue together what's left
$c = $p . $r;
...
...
@@ -704,6 +704,7 @@ sub mangle_asm {
$e =~ s/^\tret\n//;
$e =~ s/^\tpopl \%edi\n//;
$e =~ s/^\tpopl \%esi\n//;
$e =~ s/^\tpopl \%ebx\n//;
$e =~ s/^\tpopl \%ecx\n//;
$e =~ s/^\taddl \$\d+,\%esp\n//;
} elsif ($TargetPlatform =~ /^m68k-/) {
...
...
@@ -744,7 +745,7 @@ sub mangle_asm {
# On Alphas, the prologue mangling is done a little later (below)
# toss all calls to __DISCARD__
$c =~ s/^\t(call|jbsr|jal)\s+$TUS[@]?__DISCARD__\n//go;
$c =~ s/^\t(call|jbsr|jal)\s+$TUS[@]?__DISCARD__
(\@PLT)?
\n//go;
# MIPS: that may leave some gratuitous asm macros around
# (no harm done; but we get rid of them to be tidier)
...
...
@@ -970,7 +971,9 @@ sub mangle_asm {
$chk[$infochk{$symb}] =~ s/\.long ([A-Za-z]\S+_upd)/\.long \.\1/;
print OUTASM $chk[$infochk{$symb}];
} else {
print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
# for shared libs --SDM
print OUTASM $chk[$infochk{$symb}];
# print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
}
# entry code will be put here!
...
...
@@ -1009,6 +1012,10 @@ sub mangle_asm {
# 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);
# for PIC code
$c =~ s/^\tleal ${T_US}${symb}_fast\d*\@GOTOFF\(\%ebx\),\%eax\n\tjmp \*\%eax\n//;
$c =~ s/^\tjmp \*${T_US}${symb}_fast\d*\@GOT\(\%ebx\)\n//;
$c =~ s/^\.LPR\d+\:\n\tmovl \(\%esp\),\%ebx\n\tret\n//;
} 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-/ ) {
...
...
@@ -1081,7 +1088,9 @@ sub mangle_asm {
print OUTASM ".${symb}_vtbl:\n";
print OUTASM $chk[$vectorchk{$symb}];
} else {
print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
# for shared libs --SDM print OUTASM $chk[$vectorchk{$symb}];
print OUTASM $chk[$vectorchk{$symb}];
# print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
}
# direct return code will be put here!
$chkcat[$vectorchk{$symb}] = 'DONE ALREADY';
...
...
@@ -1217,7 +1226,7 @@ sub print_doctored {
}
if ($StolenX86Regs <= 3 ) { # spurious uses of edi?
s/^\tmovl (.*),\%edi\n\tjmp \*%edi\n/\tmovl $1,\%eax\n\tjmp \*\%eax\n/g;
s/^\tjmp \*(-?\d*
)\(
(.*\%edi.*
)
\)\n/\tmovl $
2
,\%eax\n\tjmp \*
$1\(
\%eax\
)\
n/g;
s/^\tjmp \*(-?\d*
\
(.*\%edi.*\)
)
\n/\tmovl $
1
,\%eax\n\tjmp \*\%eax\n/g;
s/^\tjmp \*\%edi\n/\tmovl \%edi,\%eax\n\tjmp \*\%eax\n/g;
die "$Pgm: (mangler) still have jump involving \%edi!\n$_"
if /(jmp|call) .*\%edi/;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment