summaryrefslogtreecommitdiff
path: root/compiler/GHC/Platform
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-01-26 22:09:43 -0500
committerBen Gamari <ben@smart-cactus.org>2022-01-29 14:52:56 -0500
commit5771b69007f1c218db8ddc1652ffd3c0ba6d0682 (patch)
treeb836629d532848f1df47b58af79b555f3c3514a4 /compiler/GHC/Platform
parenta67c2471a0bf18adf2916fbaa6a7e3f676279b7f (diff)
downloadhaskell-5771b69007f1c218db8ddc1652ffd3c0ba6d0682.tar.gz
CmmToAsm: Drop RegPair
SPARC was its last and only user.
Diffstat (limited to 'compiler/GHC/Platform')
-rw-r--r--compiler/GHC/Platform/Reg.hs18
1 files changed, 1 insertions, 17 deletions
diff --git a/compiler/GHC/Platform/Reg.hs b/compiler/GHC/Platform/Reg.hs
index 8203b9bbea..8b4757744b 100644
--- a/compiler/GHC/Platform/Reg.hs
+++ b/compiler/GHC/Platform/Reg.hs
@@ -6,7 +6,6 @@
module GHC.Platform.Reg (
RegNo,
Reg(..),
- regPair,
regSingle,
realRegSingle,
isRealReg, takeRealReg,
@@ -143,32 +142,24 @@ getHiVRegFromLo reg
-- the usual way. We know what class they are, because that's part of
-- the processor's architecture.
--
--- RealRegPairs are pairs of real registers that are allocated together
--- to hold a larger value, such as with Double regs on SPARC.
---
data RealReg
= RealRegSingle {-# UNPACK #-} !RegNo
- | RealRegPair {-# UNPACK #-} !RegNo {-# UNPACK #-} !RegNo
deriving (Eq, Show, Ord)
instance Uniquable RealReg where
getUnique reg
= case reg of
RealRegSingle i -> mkRegSingleUnique i
- RealRegPair r1 r2 -> mkRegPairUnique (r1 * 65536 + r2)
instance Outputable RealReg where
ppr reg
= case reg of
RealRegSingle i -> text "%r" <> int i
- RealRegPair r1 r2 -> text "%r(" <> int r1
- <> vbar <> int r2 <> text ")"
regNosOfRealReg :: RealReg -> [RegNo]
regNosOfRealReg rr
= case rr of
RealRegSingle r1 -> [r1]
- RealRegPair r1 r2 -> [r1, r2]
realRegsAlias :: RealReg -> RealReg -> Bool
@@ -178,11 +169,7 @@ realRegsAlias rr1 rr2 =
-- write out all the cases which gives us nice non-allocating code.
case rr1 of
RealRegSingle r1 ->
- case rr2 of RealRegPair r2 r3 -> r1 == r2 || r1 == r3
- RealRegSingle r2 -> r1 == r2
- RealRegPair r1 r2 ->
- case rr2 of RealRegPair r3 r4 -> r1 == r3 || r1 == r4 || r2 == r3 || r2 == r4
- RealRegSingle r3 -> r1 == r3 || r2 == r3
+ case rr2 of RealRegSingle r2 -> r1 == r2
--------------------------------------------------------------------------------
-- | A register, either virtual or real
@@ -197,9 +184,6 @@ regSingle regNo = RegReal (realRegSingle regNo)
realRegSingle :: RegNo -> RealReg
realRegSingle regNo = RealRegSingle regNo
-regPair :: RegNo -> RegNo -> Reg
-regPair regNo1 regNo2 = RegReal $ RealRegPair regNo1 regNo2
-
-- We like to have Uniques for Reg so that we can make UniqFM and UniqSets
-- in the register allocator.