summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-11-08 08:31:24 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-12-02 18:13:30 -0500
commit78b78ac463b0b8aad688edcea3c4af447854b929 (patch)
tree88cd3cef67c37f50ff83752f1d36a015debfdb38
parent5b950a7f939a35538abf61ea8e86ddd07cc75237 (diff)
downloadhaskell-78b78ac463b0b8aad688edcea3c4af447854b929.tar.gz
ncg/aarch64: Don't sign extend loads
Previously we would emit the sign-extending LDS[HB] instructions for sub-word loads. However, this is wrong, as noted in #20638.
-rw-r--r--compiler/GHC/CmmToAsm/AArch64/Ppr.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/CmmToAsm/AArch64/Ppr.hs b/compiler/GHC/CmmToAsm/AArch64/Ppr.hs
index 9c50a46292..9d1dea085a 100644
--- a/compiler/GHC/CmmToAsm/AArch64/Ppr.hs
+++ b/compiler/GHC/CmmToAsm/AArch64/Ppr.hs
@@ -544,9 +544,9 @@ pprInstr platform instr = case instr of
#endif
LDR _f o1@(OpReg W8 (RegReal (RealRegSingle i))) o2 | i < 32 ->
- text "\tldrsb" <+> pprOp platform o1 <> comma <+> pprOp platform o2
+ text "\tldrb" <+> pprOp platform o1 <> comma <+> pprOp platform o2
LDR _f o1@(OpReg W16 (RegReal (RealRegSingle i))) o2 | i < 32 ->
- text "\tldrsh" <+> pprOp platform o1 <> comma <+> pprOp platform o2
+ text "\tldrh" <+> pprOp platform o1 <> comma <+> pprOp platform o2
LDR _f o1 o2 -> text "\tldr" <+> pprOp platform o1 <> comma <+> pprOp platform o2
STP _f o1 o2 o3 -> text "\tstp" <+> pprOp platform o1 <> comma <+> pprOp platform o2 <> comma <+> pprOp platform o3