diff options
| author | Simon Marlow <marlowsd@gmail.com> | 2018-04-22 12:48:11 +0100 |
|---|---|---|
| committer | Simon Marlow <marlowsd@gmail.com> | 2018-05-16 13:36:13 +0100 |
| commit | fbd28e2c6b5f1302cd2d36d79149e3b0a9f01d84 (patch) | |
| tree | 347862078aab1df4d1c268ae4cd880e46fc55de3 /compiler/nativeGen/X86/CodeGen.hs | |
| parent | eb8e692cab7970c495681e14721d05ecadd21581 (diff) | |
| download | haskell-fbd28e2c6b5f1302cd2d36d79149e3b0a9f01d84.tar.gz | |
Allow CmmLabelDiffOff with different widths
Summary:
This change makes it possible to generate a static 32-bit relative label
offset on x86_64. Currently we can only generate word-sized label
offsets.
This will be used in D4634 to shrink info tables. See D4632 for more
details.
Test Plan: See D4632
Reviewers: bgamari, niteria, michalt, erikd, jrtc27, osa1
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D4633
Diffstat (limited to 'compiler/nativeGen/X86/CodeGen.hs')
| -rw-r--r-- | compiler/nativeGen/X86/CodeGen.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs index 9dc1053683..579c726923 100644 --- a/compiler/nativeGen/X86/CodeGen.hs +++ b/compiler/nativeGen/X86/CodeGen.hs @@ -2869,10 +2869,11 @@ createJumpTable :: DynFlags -> [Maybe BlockId] -> Section -> CLabel createJumpTable dflags ids section lbl = let jumpTable | positionIndependent dflags = - let jumpTableEntryRel Nothing - = CmmStaticLit (CmmInt 0 (wordWidth dflags)) + let ww = wordWidth dflags + jumpTableEntryRel Nothing + = CmmStaticLit (CmmInt 0 ww) jumpTableEntryRel (Just blockid) - = CmmStaticLit (CmmLabelDiffOff blockLabel lbl 0) + = CmmStaticLit (CmmLabelDiffOff blockLabel lbl 0 ww) where blockLabel = blockLbl blockid in map jumpTableEntryRel ids | otherwise = map (jumpTableEntry dflags) ids |
