[Git][ghc/ghc][wip/supersven/riscv-ncg] Minimum to compile empty Cmm files

Sven Tennie (@supersven) gitlab at gitlab.haskell.org
Mon Apr 10 10:10:37 UTC 2023



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


Commits:
aae14179 by Sven Tennie at 2023-04-10T10:10:05+00:00
Minimum to compile empty Cmm files

- - - - -


4 changed files:

- compiler/GHC/CmmToAsm/RISCV64.hs
- compiler/GHC/CmmToAsm/RISCV64/CodeGen.hs
- compiler/GHC/Driver/Backend.hs
- compiler/ghc.cabal.in


Changes:

=====================================
compiler/GHC/CmmToAsm/RISCV64.hs
=====================================
@@ -38,7 +38,7 @@ ncgRISCV64 config = NcgImpl
    , invertCondBranches        = \_ _ -> id
    }
 
--- | Instruction instance for powerpc
+-- | Instruction instance for RISC-V 64bit
 instance Instruction RISCV64.Instr where
    regUsageOfInstr     = RISCV64.regUsageOfInstr
    patchRegsOfInstr    = RISCV64.patchRegsOfInstr


=====================================
compiler/GHC/CmmToAsm/RISCV64/CodeGen.hs
=====================================
@@ -8,7 +8,8 @@ import Prelude
 cmmTopCodeGen
         :: RawCmmDecl
         -> NatM [NatCmmDecl RawCmmStatics Instr]
-cmmTopCodeGen _ = error "TODO: cmmTopCodeGen"
+-- "TODO: cmmTopCodeGen"
+cmmTopCodeGen _ = pure []
 
 generateJumpTableForInstr :: Instr
                           -> Maybe (NatCmmDecl RawCmmStatics Instr)


=====================================
compiler/GHC/Driver/Backend.hs
=====================================
@@ -217,6 +217,7 @@ platformNcgSupported platform = if
          ArchPPC_64 {} -> True
          ArchAArch64   -> True
          ArchWasm32    -> True
+         ArchRISCV64   -> True
          _             -> False
 
 -- | Is the platform supported by the JS backend?


=====================================
compiler/ghc.cabal.in
=====================================
@@ -261,6 +261,12 @@ Library
         GHC.CmmToAsm.Reg.Liveness
         GHC.CmmToAsm.Reg.Target
         GHC.CmmToAsm.Reg.Utils
+        GHC.CmmToAsm.RISCV64
+        GHC.CmmToAsm.RISCV64.CodeGen
+        GHC.CmmToAsm.RISCV64.Instr
+        GHC.CmmToAsm.RISCV64.Ppr
+        GHC.CmmToAsm.RISCV64.RegInfo
+        GHC.CmmToAsm.RISCV64.Regs
         GHC.CmmToAsm.Types
         GHC.CmmToAsm.Utils
         GHC.CmmToAsm.X86



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aae14179e71d0430e45a43d323e693d7e33d47ea
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/20230410/392a6e3e/attachment-0001.html>


More information about the ghc-commits mailing list