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