ghc-lib-parser-9.4.6.20230808: The GHC API, decoupled from GHC versions
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Platform

Description

Platform description

Synopsis

Documentation

data Platform Source #

Platform description

This is used to describe platforms so that we can generate code for them.

Constructors

Platform 

Fields

platformArch :: Platform -> Arch Source #

Platform architecture

platformOS :: Platform -> OS Source #

Platform OS

data ArchOS Source #

Platform architecture and OS.

Constructors

ArchOS 

Fields

data Arch Source #

Architectures

TODO: It might be nice to extend these constructors with information about what instruction set extensions an architecture might support.

Instances

Instances details
Read Arch Source # 
Instance details

Defined in GHC.Platform.ArchOS

Show Arch Source # 
Instance details

Defined in GHC.Platform.ArchOS

Eq Arch Source # 
Instance details

Defined in GHC.Platform.ArchOS

Methods

(==) :: Arch -> Arch -> Bool Source #

(/=) :: Arch -> Arch -> Bool Source #

Ord Arch Source # 
Instance details

Defined in GHC.Platform.ArchOS

data OS Source #

Operating systems.

Using OSUnknown to generate code should produce a sensible default, but no promises.

Instances

Instances details
Read OS Source # 
Instance details

Defined in GHC.Platform.ArchOS

Show OS Source # 
Instance details

Defined in GHC.Platform.ArchOS

Eq OS Source # 
Instance details

Defined in GHC.Platform.ArchOS

Methods

(==) :: OS -> OS -> Bool Source #

(/=) :: OS -> OS -> Bool Source #

Ord OS Source # 
Instance details

Defined in GHC.Platform.ArchOS

Methods

compare :: OS -> OS -> Ordering Source #

(<) :: OS -> OS -> Bool Source #

(<=) :: OS -> OS -> Bool Source #

(>) :: OS -> OS -> Bool Source #

(>=) :: OS -> OS -> Bool Source #

max :: OS -> OS -> OS Source #

min :: OS -> OS -> OS Source #

data ArmISA Source #

ARM Instruction Set Architecture

Constructors

ARMv5 
ARMv6 
ARMv7 

data ArmABI Source #

ARM ABI

Constructors

SOFT 
SOFTFP 
HARD 

data ByteOrder Source #

Byte ordering.

Constructors

BigEndian

most-significant-byte occurs in lowest address.

LittleEndian

least-significant-byte occurs in lowest address.

Instances

Instances details
Bounded ByteOrder

Since: base-4.11.0.0

Instance details

Defined in GHC.ByteOrder

Enum ByteOrder

Since: base-4.11.0.0

Instance details

Defined in GHC.ByteOrder

Generic ByteOrder 
Instance details

Defined in GHC.ByteOrder

Associated Types

type Rep ByteOrder :: Type -> Type Source #

Read ByteOrder

Since: base-4.11.0.0

Instance details

Defined in GHC.ByteOrder

Show ByteOrder

Since: base-4.11.0.0

Instance details

Defined in GHC.ByteOrder

Eq ByteOrder

Since: base-4.11.0.0

Instance details

Defined in GHC.ByteOrder

Ord ByteOrder

Since: base-4.11.0.0

Instance details

Defined in GHC.ByteOrder

type Rep ByteOrder

Since: base-4.15.0.0

Instance details

Defined in GHC.ByteOrder

type Rep ByteOrder = D1 ('MetaData "ByteOrder" "GHC.ByteOrder" "base" 'False) (C1 ('MetaCons "BigEndian" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LittleEndian" 'PrefixI 'False) (U1 :: Type -> Type))

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.

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).

data BmiVersion Source #

x86 BMI (bit manipulation) instructions

Constructors

BMI1 
BMI2 

SSE and AVX

Platform constants

data PlatformConstants Source #

Constructors

PlatformConstants 

Fields

lookupPlatformConstants :: [FilePath] -> IO (Maybe PlatformConstants) Source #

Try to locate "GhclibDerivedConstants.h" file in the given dirs and to parse the PlatformConstants from it.

See Note [Platform constants]

Shared libraries