summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-06-22 13:27:35 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-06-28 03:24:24 -0400
commit57a5f88cf70ec6dd65ff4a2df0c11805ec1db018 (patch)
tree7804632f5245eea0c8d7a22ca5210091231c9783
parentb43d140b3f79e024489bbd9338d81d2ac23fc437 (diff)
downloadhaskell-57a5f88cf70ec6dd65ff4a2df0c11805ec1db018.tar.gz
Mark AArch64/Darwin as requiring sign-extension
Apple's AArch64 ABI requires that the caller sign-extend small integer arguments. Set platformCConvNeedsExtension to reflect this fact. Fixes #21773.
-rw-r--r--compiler/GHC/Platform.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/GHC/Platform.hs b/compiler/GHC/Platform.hs
index 831418dd61..39294c9a9a 100644
--- a/compiler/GHC/Platform.hs
+++ b/compiler/GHC/Platform.hs
@@ -262,6 +262,11 @@ platformCConvNeedsExtension platform = case platformArch platform of
ArchPPC_64 _ -> True
ArchS390X -> True
ArchRISCV64 -> True
+ ArchAArch64
+ -- Apple's AArch64 ABI requires that the caller sign-extend
+ -- small integer arguments. See
+ -- https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
+ | OSDarwin <- platformOS platform -> True
_ -> False