summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-06-22 13:27:35 -0400
committerMatthew Pickering <matthewtpickering@gmail.com>2022-07-05 11:13:09 +0100
commit32ce86fe10614c4fa93d39199b52848e97c6c40f (patch)
tree8d577b4f17c5e1e68cea4dff1806c28081cd5ad5
parentb2a1f15153182c206c3358c944a58596ec223e63 (diff)
downloadhaskell-32ce86fe10614c4fa93d39199b52848e97c6c40f.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. (cherry picked from commit 57a5f88cf70ec6dd65ff4a2df0c11805ec1db018)
-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