diff options
author | nineonine <mail4chemik@gmail.com> | 2022-02-17 00:01:44 -0800 |
---|---|---|
committer | nineonine <mail4chemik@gmail.com> | 2022-02-23 10:00:45 -0800 |
commit | cabc9c32eaa49734d9873973c99787278e194aee (patch) | |
tree | aed180f70eb6d3a3a419e46bf39ffecc8c63c585 /compiler | |
parent | 59b7f764489d3eb765e0b40e916b1438ff76e1fa (diff) | |
download | haskell-wip/T20214.tar.gz |
ghci: show helpful error message when loading module with SIMD vector operations (#20214)wip/T20214
Previously, when trying to load module with SIMD vector operations, ghci would panic
in 'GHC.StgToByteCode.findPushSeq'. Now, a more helpful message is displayed.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/StgToByteCode.hs | 3 | ||||
-rw-r--r-- | compiler/GHC/StgToCmm/ArgRep.hs | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/StgToByteCode.hs b/compiler/GHC/StgToByteCode.hs index 885af12944..a5931c2dd6 100644 --- a/compiler/GHC/StgToByteCode.hs +++ b/compiler/GHC/StgToByteCode.hs @@ -784,6 +784,9 @@ findPushSeq (D: rest) = (PUSH_APPLY_D, 1, rest) findPushSeq (L: rest) = (PUSH_APPLY_L, 1, rest) +findPushSeq argReps + | any (`elem` [V16, V32, V64]) argReps + = sorry "SIMD vector operations are not available in GHCi" findPushSeq _ = panic "GHC.StgToByteCode.findPushSeq" diff --git a/compiler/GHC/StgToCmm/ArgRep.hs b/compiler/GHC/StgToCmm/ArgRep.hs index cc618a16ed..9db0ed7afc 100644 --- a/compiler/GHC/StgToCmm/ArgRep.hs +++ b/compiler/GHC/StgToCmm/ArgRep.hs @@ -52,6 +52,7 @@ data ArgRep = P -- GC Ptr | V16 -- 16-byte (128-bit) vectors of Float/Double/Int8/Word32/etc. | V32 -- 32-byte (256-bit) vectors of Float/Double/Int8/Word32/etc. | V64 -- 64-byte (512-bit) vectors of Float/Double/Int8/Word32/etc. + deriving Eq instance Outputable ArgRep where ppr = text . argRepString argRepString :: ArgRep -> String |