diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-16 16:46:39 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-21 06:39:32 -0400 |
commit | 747093b7c23a1cf92b564eb3d9efe2adc15330df (patch) | |
tree | 06b74ab72984f98036a40fc441d37438a49a26a8 /libraries | |
parent | f2a98996e7792f572ab685f29742e3476be81166 (diff) | |
download | haskell-747093b7c23a1cf92b564eb3d9efe2adc15330df.tar.gz |
CmmToAsm DynFlags refactoring (#17957)
* Remove `DynFlags` parameter from `isDynLinkName`: `isDynLinkName` used
to test the global `ExternalDynamicRefs` flag. Now we test it outside of
`isDynLinkName`
* Add new fields into `NCGConfig`: current unit id, sse/bmi versions,
externalDynamicRefs, etc.
* Replace many uses of `DynFlags` by `NCGConfig`
* Moved `BMI/SSE` datatypes into `GHC.Platform`
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/ghc-boot/GHC/Platform.hs | 84 |
1 files changed, 53 insertions, 31 deletions
diff --git a/libraries/ghc-boot/GHC/Platform.hs b/libraries/ghc-boot/GHC/Platform.hs index b5091ae8e8..7af9cc0890 100644 --- a/libraries/ghc-boot/GHC/Platform.hs +++ b/libraries/ghc-boot/GHC/Platform.hs @@ -2,37 +2,38 @@ -- | A description of the platform we're compiling for. -- -module GHC.Platform ( - PlatformMini(..), - PlatformWordSize(..), - Platform(..), platformArch, platformOS, - Arch(..), - OS(..), - ArmISA(..), - ArmISAExt(..), - ArmABI(..), - PPC_64ABI(..), - ByteOrder(..), - - target32Bit, - isARM, - osElfTarget, - osMachOTarget, - osSubsectionsViaSymbols, - platformUsesFrameworks, - platformWordSizeInBytes, - platformWordSizeInBits, - platformMinInt, - platformMaxInt, - platformMaxWord, - platformInIntRange, - platformInWordRange, - - PlatformMisc(..), - IntegerLibrary(..), - - stringEncodeArch, - stringEncodeOS, +module GHC.Platform + ( PlatformMini(..) + , PlatformWordSize(..) + , Platform(..) + , platformArch + , platformOS + , Arch(..) + , OS(..) + , ArmISA(..) + , ArmISAExt(..) + , ArmABI(..) + , PPC_64ABI(..) + , ByteOrder(..) + , target32Bit + , isARM + , osElfTarget + , osMachOTarget + , osSubsectionsViaSymbols + , platformUsesFrameworks + , platformWordSizeInBytes + , platformWordSizeInBits + , platformMinInt + , platformMaxInt + , platformMaxWord + , platformInIntRange + , platformInWordRange + , PlatformMisc(..) + , IntegerLibrary(..) + , stringEncodeArch + , stringEncodeOS + , SseVersion (..) + , BmiVersion (..) ) where @@ -338,3 +339,24 @@ platformInIntRange platform x = x >= platformMinInt platform && x <= platformMax -- | Test if the given Integer is representable with a platform Word platformInWordRange :: Platform -> Integer -> Bool platformInWordRange platform x = x >= 0 && x <= platformMaxWord platform + + +-------------------------------------------------- +-- Instruction sets +-------------------------------------------------- + +-- | x86 SSE instructions +data SseVersion + = SSE1 + | SSE2 + | SSE3 + | SSE4 + | SSE42 + deriving (Eq, Ord) + +-- | x86 BMI (bit manipulation) instructions +data BmiVersion + = BMI1 + | BMI2 + deriving (Eq, Ord) + |