summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs11
-rw-r--r--compiler/nativeGen/X86/Ppr.hs24
2 files changed, 2 insertions, 33 deletions
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index 531213dc7f..d797b8014c 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -2616,17 +2616,8 @@ genSwitch dflags expr ids
JMP_TBL (OpReg tableReg) ids Text lbl
]
_ ->
- -- HACK: On x86_64 binutils<2.17 is only able
- -- to generate PC32 relocations, hence we only
- -- get 32-bit offsets in the jump table. As
- -- these offsets are always negative we need
- -- to properly sign extend them to 64-bit.
- -- This hack should be removed in conjunction
- -- with the hack in PprMach.hs/pprDataItem
- -- once binutils 2.17 is standard.
e_code `appOL` t_code `appOL` toOL [
- MOVSxL II32 op (OpReg reg),
- ADD (intSize (wordWidth dflags)) (OpReg reg) (OpReg tableReg),
+ ADD (intSize (wordWidth dflags)) op (OpReg tableReg),
JMP_TBL (OpReg tableReg) ids ReadOnlyData lbl
]
| otherwise
diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs
index 7022e59647..9d290f299c 100644
--- a/compiler/nativeGen/X86/Ppr.hs
+++ b/compiler/nativeGen/X86/Ppr.hs
@@ -470,29 +470,7 @@ pprDataItem' dflags lit
<> int (fromIntegral
(fromIntegral (x `shiftR` 32) :: Word32))]
_ -> panic "X86.Ppr.ppr_item: no match for II64"
- | otherwise ->
- [ptext (sLit "\t.quad\t") <> pprImm imm]
- _
- | target32Bit platform ->
- [ptext (sLit "\t.quad\t") <> pprImm imm]
- | otherwise ->
- -- x86_64: binutils can't handle the R_X86_64_PC64
- -- relocation type, which means we can't do
- -- pc-relative 64-bit addresses. Fortunately we're
- -- assuming the small memory model, in which all such
- -- offsets will fit into 32 bits, so we have to stick
- -- to 32-bit offset fields and modify the RTS
- -- appropriately
- --
- -- See Note [x86-64-relative] in includes/rts/storage/InfoTables.h
- --
- case lit of
- -- A relative relocation:
- CmmLabelDiffOff _ _ _ ->
- [ptext (sLit "\t.long\t") <> pprImm imm,
- ptext (sLit "\t.long\t0")]
- _ ->
- [ptext (sLit "\t.quad\t") <> pprImm imm]
+ _ -> [ptext (sLit "\t.quad\t") <> pprImm imm]
ppr_item _ _
= panic "X86.Ppr.ppr_item: no match"