module GHC.CmmToAsm.SPARC.Base (
wordLength,
wordLengthInBits,
spillSlotSize,
extraStackArgsHere,
fits13Bits,
is32BitInteger,
largeOffsetError
)
where
import GHC.Prelude
import GHC.Utils.Panic
import Data.Int
wordLength :: Int
wordLength :: Int
wordLength = Int
4
wordLengthInBits :: Int
wordLengthInBits :: Int
wordLengthInBits
= Int
wordLength forall a. Num a => a -> a -> a
* Int
8
spillSlotSize :: Int
spillSlotSize :: Int
spillSlotSize = Int
8
extraStackArgsHere :: Int
= Int
23
{-# SPECIALIZE fits13Bits :: Int -> Bool, Integer -> Bool #-}
fits13Bits :: Integral a => a -> Bool
fits13Bits :: forall a. Integral a => a -> Bool
fits13Bits a
x = a
x forall a. Ord a => a -> a -> Bool
>= -a
4096 Bool -> Bool -> Bool
&& a
x forall a. Ord a => a -> a -> Bool
< a
4096
is32BitInteger :: Integer -> Bool
is32BitInteger :: Integer -> Bool
is32BitInteger Integer
i
= Int64
i64 forall a. Ord a => a -> a -> Bool
<= Int64
0x7fffffff Bool -> Bool -> Bool
&& Int64
i64 forall a. Ord a => a -> a -> Bool
>= -Int64
0x80000000
where i64 :: Int64
i64 = forall a b. (Integral a, Num b) => a -> b
fromIntegral Integer
i :: Int64
largeOffsetError :: (Show a) => a -> b
largeOffsetError :: forall a b. Show a => a -> b
largeOffsetError a
i
= forall a. String -> a
panic (String
"ERROR: SPARC native-code generator cannot handle large offset ("
forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show a
i forall a. [a] -> [a] -> [a]
++ String
");\nprobably because of large constant data structures;" forall a. [a] -> [a] -> [a]
++
String
"\nworkaround: use -fllvm on this module.\n")