diff options
author | Michal Terepeta <michal.terepeta@gmail.com> | 2018-11-07 08:03:16 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-11-07 08:09:40 -0500 |
commit | f424515fd8cbc2b7380cdf8427f972d062940bd5 (patch) | |
tree | 858b1de592ee06c335a8e5572d7b87f7fb447910 /compiler/llvmGen | |
parent | 406978c478e4b14e677f396499420d7b8e5d21fd (diff) | |
download | haskell-f424515fd8cbc2b7380cdf8427f972d062940bd5.tar.gz |
[LlvmCodeGen] Fixes for Int8#/Word8#
This fixes two isssues:
- Using bitcast for MO_XX_Conv
Arguments to a bitcast must be of the same size. We should be using
`trunc` and `zext` instead.
- Using unsupported MO_*_QuotRem for LLVM
The two primops `MO_*_QuotRem` are not supported by the LLVM backend,
so
we shouldn't use them for `Int8#`/`Word8#` (just as we do not use
them for
`Int#`/`Word#`).
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
Test Plan: manually run tests with WAY=llvm
Reviewers: bgamari, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, carter
GHC Trac Issues: #15864
Differential Revision: https://phabricator.haskell.org/D5304
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index efc870993c..d24075ec7c 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1194,7 +1194,7 @@ genMachOp _ op [x] = case op of -> sameConv from (widthToLlvmInt to) LM_Trunc LM_Zext MO_XX_Conv from to - -> sameConv from (widthToLlvmInt to) LM_Bitcast LM_Bitcast + -> sameConv from (widthToLlvmInt to) LM_Trunc LM_Zext MO_FF_Conv from to -> sameConv from (widthToLlvmFloat to) LM_Fptrunc LM_Fpext |