refactor: CInt Integer
All checks were successful
build / build (push) Successful in 1m22s

This commit is contained in:
2026-04-24 13:36:53 -06:00
parent e03e918bf4
commit d204ccc2ec
3 changed files with 5 additions and 5 deletions

3
.gitignore vendored
View File

@@ -6,4 +6,5 @@ dist-newstyle
*.hi *.hi
.ghc.environment.* .ghc.environment.*
*.tix *.tix
.direnv .direnv
result

View File

@@ -24,7 +24,7 @@
shell.tools = { shell.tools = {
cabal = {}; cabal = {};
# hlint = {}; # hlint = {};
# haskell-language-server = {}; haskell-language-server = {};
}; };
# Non-Haskell shell tools go here # Non-Haskell shell tools go here
shell.buildInputs = with final; [ shell.buildInputs = with final; [

View File

@@ -170,15 +170,14 @@ instance Pretty ExtTy where
-- | Constant/immediate -- | Constant/immediate
data Const data Const
-- MAYBE just use a signed type -- MAYBE just use a signed type
= CInt Bool Word64 -- ^ 64 bit integer. The 'Bool' is whether to negate. = CInt Integer -- ^ Integer
| CSingle Float -- ^ Single-precision float | CSingle Float -- ^ Single-precision float
| CDouble Double -- ^ Double-precision float | CDouble Double -- ^ Double-precision float
| CGlobal (Ident 'Global) -- ^ Global symbol | CGlobal (Ident 'Global) -- ^ Global symbol
deriving (Show, Eq) deriving (Show, Eq)
instance Pretty Const where instance Pretty Const where
pretty (CInt negative int) | negative = pretty '-' <> pretty int pretty (CInt int) = pretty int
| otherwise = pretty int
pretty (CSingle float) = "s_" <> pretty float pretty (CSingle float) = "s_" <> pretty float
pretty (CDouble double) = "d_" <> pretty double pretty (CDouble double) = "d_" <> pretty double
pretty (CGlobal ident) = pretty ident pretty (CGlobal ident) = pretty ident