X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdriver%2Fmangler%2Fghc-asm.lprl;h=63b753fdfd8a7b1545b5dd4767dd64a1f30cb70d;hb=085a9ce77c7c1b42941af23b2f41c910a4a35720;hp=8a66422a81efb6bbf7ca433794a5670ce4fdd506;hpb=0546faf2e57f78739e6a00a61dd6ba034289cf82;p=ghc-hetmet.git diff --git a/ghc/driver/mangler/ghc-asm.lprl b/ghc/driver/mangler/ghc-asm.lprl index 8a66422..63b753f 100644 --- a/ghc/driver/mangler/ghc-asm.lprl +++ b/ghc/driver/mangler/ghc-asm.lprl @@ -1430,12 +1430,24 @@ sub hppa_mash_prologue { # OK, epilogue, too sub print_doctored { local($_, $need_fallthru_patch) = @_; + if ( $TargetPlatform =~ /^x86_64-/ ) { + # Catch things like + # + # movq -4(%ebp), %rax + # jmp *%rax + # + # and optimise: + # + s/^\tmovq\s+(-?\d*\(\%r(bx|bp)\)),\s*(\%r(ax|cx|dx|10|11))\n\tjmp\s+\*\3/\tjmp\t\*$1/g; + } + if ( $TargetPlatform !~ /^i386-/ || ! /^\t[a-z]/ # no instructions in here, apparently || /^${T_US}__stginit_[A-Za-z0-9_]+${T_POST_LBL}/) { print OUTASM $_; return; } + # OK, must do some x86 **HACKING** local($entry_patch) = '';