[Git][ghc/ghc][wip/ncg-simd] test: Eq/Ord RealRegUsage

sheaf (@sheaf) gitlab at gitlab.haskell.org
Thu Jun 20 15:31:29 UTC 2024



sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC


Commits:
71c19ee0 by sheaf at 2024-06-20T17:31:22+02:00
test: Eq/Ord RealRegUsage

- - - - -


1 changed file:

- compiler/GHC/CmmToAsm/Reg/Linear/Base.hs


Changes:

=====================================
compiler/GHC/CmmToAsm/Reg/Linear/Base.hs
=====================================
@@ -39,6 +39,8 @@ import GHC.Cmm.Dataflow.Label
 import GHC.CmmToAsm.Reg.Utils
 import GHC.CmmToAsm.Format
 
+import Data.Function ( on )
+
 data ReadingOrWriting = Reading | Writing deriving (Eq,Ord)
 
 -- | Used to store the register assignment on entry to a basic block.
@@ -105,13 +107,18 @@ data Loc
         -- | vreg is held in both a register and stack slots
         | InBoth   {-# UNPACK #-} !RealRegUsage
                    {-# UNPACK #-} !StackSlot
-        deriving (Eq, Show, Ord)
+        deriving (Eq, Ord, Show)
 
 data RealRegUsage
   = RealRegUsage
     { realReg :: !RealReg
     , realRegFormat :: !Format
-    } deriving (Eq, Show, Ord)
+    } deriving Show
+
+instance Eq RealRegUsage where
+  (==) = (==) `on` realReg
+instance Ord RealRegUsage where
+  compare = compare `on` realReg
 
 instance Outputable Loc where
         ppr l = text (show l)



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/71c19ee0400a1a3a63c05fa3909e2039ac71bc86

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/71c19ee0400a1a3a63c05fa3909e2039ac71bc86
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240620/8038752a/attachment-0001.html>


More information about the ghc-commits mailing list