Skip to content

Commit 190943e

Browse files
committed
Revert "Future-proof the ARM64 ABI by not reserving the entire top byte."
This reverts commit d448513. This patch does not work with our current assumptions about BridgeObject.
1 parent 724c192 commit 190943e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

stdlib/public/SwiftShims/System.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@
142142
/// Darwin reserves the low 4GB of address space.
143143
#define SWIFT_ABI_DARWIN_ARM64_LEAST_VALID_POINTER 0x100000000ULL
144144

145-
// TBI guarantees the top byte of pointers is unused, but ARMv8.5-A
146-
// claims the bottom four bits of that for memory tagging.
145+
// TBI guarantees the top byte of pointers is unused.
147146
// Heap objects are eight-byte aligned.
148-
#define SWIFT_ABI_ARM64_SWIFT_SPARE_BITS_MASK 0xF000000000000007ULL
147+
#define SWIFT_ABI_ARM64_SWIFT_SPARE_BITS_MASK \
148+
SWIFT_ABI_DEFAULT_64BIT_SPARE_BITS_MASK
149149

150150
// Objective-C reserves just the high bit for tagged pointers.
151151
#define SWIFT_ABI_ARM64_OBJC_RESERVED_BITS_MASK 0x8000000000000000ULL

test/IRGen/bridge_object_arm64.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ entry(%c : $C, %w : $Builtin.Word):
3535
// CHECK: [[TAGGED_RESULT:%.*]] = bitcast [[BRIDGE]] %0 to [[C:%objc_object\*]]
3636
// CHECK: br label %tagged-cont
3737
// CHECK: not-tagged-pointer:
38-
// -- 0x0fff_ffff_ffff_fff8
39-
// CHECK: [[MASKED_BITS:%.*]] = and i64 [[BOBITS]], 1152921504606846968
38+
// -- 0x00ff_ffff_ffff_fff8
39+
// CHECK: [[MASKED_BITS:%.*]] = and i64 [[BOBITS]], 72057594037927928
4040
// CHECK: [[MASKED_RESULT:%.*]] = inttoptr i64 [[MASKED_BITS]] to [[C]]
4141
// CHECK: br label %tagged-cont
4242
// CHECK: tagged-cont:

0 commit comments

Comments
 (0)