GHC.Platform
Platform description
Documentation
Platform description
This is used to describe platforms so that we can generate code for them.
Constructors
Platform | |
Fields
|
Instances
data PlatformWordSize Source #
Instances
Read PlatformWordSize Source # | |
Defined in GHC.Platform | |
Show PlatformWordSize Source # | |
Defined in GHC.Platform | |
Eq PlatformWordSize Source # | |
Defined in GHC.Platform Methods (==) :: PlatformWordSize -> PlatformWordSize -> Bool # (/=) :: PlatformWordSize -> PlatformWordSize -> Bool # | |
Ord PlatformWordSize Source # | |
Defined in GHC.Platform Methods compare :: PlatformWordSize -> PlatformWordSize -> Ordering # (<) :: PlatformWordSize -> PlatformWordSize -> Bool # (<=) :: PlatformWordSize -> PlatformWordSize -> Bool # (>) :: PlatformWordSize -> PlatformWordSize -> Bool # (>=) :: PlatformWordSize -> PlatformWordSize -> Bool # max :: PlatformWordSize -> PlatformWordSize -> PlatformWordSize # min :: PlatformWordSize -> PlatformWordSize -> PlatformWordSize # |
platformArch :: Platform -> Arch Source #
Platform architecture
platformOS :: Platform -> OS Source #
Platform OS
Platform architecture and OS.
Constructors
ArchOS | |
Fields
|
Architectures
TODO: It might be nice to extend these constructors with information about what instruction set extensions an architecture might support.
Constructors
ArchUnknown | |
ArchX86 | |
ArchX86_64 | |
ArchPPC | |
ArchPPC_64 PPC_64ABI | |
ArchS390X | |
ArchARM ArmISA [ArmISAExt] ArmABI | |
ArchAArch64 | |
ArchAlpha | |
ArchMipseb | |
ArchMipsel | |
ArchRISCV64 | |
ArchJavaScript |
Operating systems.
Using OSUnknown to generate code should produce a sensible default, but no promises.
Constructors
OSUnknown | |
OSLinux | |
OSDarwin | |
OSSolaris2 | |
OSMinGW32 | |
OSFreeBSD | |
OSDragonFly | |
OSOpenBSD | |
OSNetBSD | |
OSKFreeBSD | |
OSHaiku | |
OSQNXNTO | |
OSAIX | |
OSHurd |
ARM extensions
Instances
Read ArmISAExt | |
Show ArmISAExt | |
Eq ArmISAExt | |
Ord ArmISAExt | |
PowerPC 64-bit ABI
Instances
Read PPC_64ABI | |
Show PPC_64ABI | |
Eq PPC_64ABI | |
Ord PPC_64ABI | |
Byte ordering.
Constructors
BigEndian | most-significant-byte occurs in lowest address. |
LittleEndian | least-significant-byte occurs in lowest address. |
Instances
Bounded ByteOrder | Since: base-4.11.0.0 |
Enum ByteOrder | Since: base-4.11.0.0 |
Defined in GHC.ByteOrder Methods succ :: ByteOrder -> ByteOrder Source # pred :: ByteOrder -> ByteOrder Source # toEnum :: Int -> ByteOrder Source # fromEnum :: ByteOrder -> Int Source # enumFrom :: ByteOrder -> [ByteOrder] Source # enumFromThen :: ByteOrder -> ByteOrder -> [ByteOrder] Source # enumFromTo :: ByteOrder -> ByteOrder -> [ByteOrder] Source # enumFromThenTo :: ByteOrder -> ByteOrder -> ByteOrder -> [ByteOrder] Source # | |
Generic ByteOrder | |
Read ByteOrder | Since: base-4.11.0.0 |
Show ByteOrder | Since: base-4.11.0.0 |
Eq ByteOrder | Since: base-4.11.0.0 |
Ord ByteOrder | Since: base-4.11.0.0 |
type Rep ByteOrder | Since: base-4.15.0.0 |
target32Bit :: Platform -> Bool Source #
This predicate tells us whether the platform is 32-bit.
osElfTarget :: OS -> Bool Source #
This predicate tells us whether the OS supports ELF-like shared libraries.
osMachOTarget :: OS -> Bool Source #
This predicate tells us whether the OS support Mach-O shared libraries.
osSubsectionsViaSymbols :: OS -> Bool Source #
platformWordSizeInBits :: Platform -> Int Source #
platformMinInt :: Platform -> Integer Source #
Minimum representable Int value for the given platform
platformMaxInt :: Platform -> Integer Source #
Maximum representable Int value for the given platform
platformMaxWord :: Platform -> Integer Source #
Maximum representable Word value for the given platform
platformInIntRange :: Platform -> Integer -> Bool Source #
Test if the given Integer is representable with a platform Int
platformInWordRange :: Platform -> Integer -> Bool Source #
Test if the given Integer is representable with a platform Word
platformCConvNeedsExtension :: Platform -> Bool Source #
For some architectures the C calling convention is that any integer shorter than 64 bits is replaced by its 64 bits representation using sign or zero extension.
data PlatformMisc Source #
Platform-specific settings formerly hard-coded in Config.hs.
These should probably be all be triaged whether they can be computed from
other settings or belong in another another place (like Platform
above).
Constructors
PlatformMisc | |
data SseVersion Source #
x86 SSE instructions
Instances
Eq SseVersion Source # | |
Defined in GHC.Platform | |
Ord SseVersion Source # | |
Defined in GHC.Platform Methods compare :: SseVersion -> SseVersion -> Ordering # (<) :: SseVersion -> SseVersion -> Bool # (<=) :: SseVersion -> SseVersion -> Bool # (>) :: SseVersion -> SseVersion -> Bool # (>=) :: SseVersion -> SseVersion -> Bool # max :: SseVersion -> SseVersion -> SseVersion # min :: SseVersion -> SseVersion -> SseVersion # |
data BmiVersion Source #
x86 BMI (bit manipulation) instructions
Instances
Eq BmiVersion Source # | |
Defined in GHC.Platform | |
Ord BmiVersion Source # | |
Defined in GHC.Platform Methods compare :: BmiVersion -> BmiVersion -> Ordering # (<) :: BmiVersion -> BmiVersion -> Bool # (<=) :: BmiVersion -> BmiVersion -> Bool # (>) :: BmiVersion -> BmiVersion -> Bool # (>=) :: BmiVersion -> BmiVersion -> Bool # max :: BmiVersion -> BmiVersion -> BmiVersion # min :: BmiVersion -> BmiVersion -> BmiVersion # |
wordAlignment :: Platform -> Alignment Source #
SSE and AVX
isSseEnabled :: Platform -> Bool Source #
isSse2Enabled :: Platform -> Bool Source #
Platform constants
data PlatformConstants Source #
Constructors
Instances
Read PlatformConstants Source # | |
Defined in GHC.Platform.Constants | |
Show PlatformConstants Source # | |
Defined in GHC.Platform.Constants | |
Eq PlatformConstants Source # | |
Defined in GHC.Platform.Constants Methods (==) :: PlatformConstants -> PlatformConstants -> Bool # (/=) :: PlatformConstants -> PlatformConstants -> Bool # | |
Ord PlatformConstants Source # | |
Defined in GHC.Platform.Constants Methods compare :: PlatformConstants -> PlatformConstants -> Ordering # (<) :: PlatformConstants -> PlatformConstants -> Bool # (<=) :: PlatformConstants -> PlatformConstants -> Bool # (>) :: PlatformConstants -> PlatformConstants -> Bool # (>=) :: PlatformConstants -> PlatformConstants -> Bool # max :: PlatformConstants -> PlatformConstants -> PlatformConstants # min :: PlatformConstants -> PlatformConstants -> PlatformConstants # |
lookupPlatformConstants :: [FilePath] -> IO (Maybe PlatformConstants) Source #
Try to locate "DerivedConstants.h" file in the given dirs and to parse the PlatformConstants from it.
See Note [Platform constants]
Shared libraries
platformSOExt :: Platform -> FilePath Source #