[Git][ghc/ghc][wip/supersven/riscv64-ncg] Delete unnecessary Ppr cases

Sven Tennie (@supersven) gitlab at gitlab.haskell.org
Sat Jan 6 19:03:20 UTC 2024



Sven Tennie pushed to branch wip/supersven/riscv64-ncg at Glasgow Haskell Compiler / GHC


Commits:
fef187b4 by Sven Tennie at 2024-01-06T20:02:57+01:00
Delete unnecessary Ppr cases

- - - - -


2 changed files:

- compiler/GHC/CmmToAsm/RV64/Ppr.hs
- compiler/GHC/CmmToAsm/RV64/Regs.hs


Changes:

=====================================
compiler/GHC/CmmToAsm/RV64/Ppr.hs
=====================================
@@ -634,8 +634,6 @@ pprInstr platform instr = case instr of
   STR II64 o1 o2 -> op2 (text "\tsd") o1 o2
   STR FF32 o1 o2 -> op2 (text "\tfsw") o1 o2
   STR FF64 o1 o2 -> op2 (text "\tfsd") o1 o2
-  STR f o1 o2    -> pprPanic "RV64.pprInstr - STR not implemented for ... "
-                              (text "STR" <+> (text.show) f <+> pprOp platform o1 <+> pprOp platform o2)
 
   LDR _f o1 (OpImm (ImmIndex lbl off)) ->
     lines_ [ text "\tla" <+> pprOp platform o1 <> comma <+> pprAsmLabel platform lbl
@@ -653,12 +651,6 @@ pprInstr platform instr = case instr of
     -- op_add o1 (text "%pcrel_lo(" <> pprAsmLabel platform lbl <> text ")")
     line $ text "\tla" <+> pprOp platform o1 <> comma <+> pprAsmLabel platform lbl
 
-  -- TODO: Are these two special cases really needed?
-  LDR _f o1@(OpReg W8 reg) o2 | isIntRealReg reg ->
-    op2 (text "\tlb") o1 o2
-  LDR _f o1@(OpReg W16 reg) o2 | isIntRealReg reg ->
-    op2 (text "\tlh") o1 o2
-
   LDR II8  o1 o2 -> op2 (text "\tlb") o1 o2
   LDR II16 o1 o2 -> op2 (text "\tlh") o1 o2
   LDR II32 o1 o2 -> op2 (text "\tlw") o1 o2


=====================================
compiler/GHC/CmmToAsm/RV64/Regs.hs
=====================================
@@ -145,10 +145,6 @@ classOfRealReg (RealRegSingle i)
         | i < 32        = RcInteger
         | otherwise     = RcDouble
 
-isIntRealReg :: Reg -> Bool
-isIntRealReg (RegReal r) = classOfRealReg r == RcInteger
-isIntRealReg _ = False
-
 regDotColor :: RealReg -> SDoc
 regDotColor reg
  = case classOfRealReg reg of



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fef187b4b52ac84140b50765301383c72104c8c4
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/20240106/e16bc9bf/attachment-0001.html>


More information about the ghc-commits mailing list