Skip to content

Commit 4130dfd

Browse files
authored
Merge pull request #21251 from rjmccall/revert-memory-tagging-future-proofing-5.0
[5.0] Revert "Future-proof the ARM64 ABI..."
2 parents c4a23c4 + 68e126c commit 4130dfd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

stdlib/public/SwiftShims/System.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,9 @@
136136
/// Darwin reserves the low 4GB of address space.
137137
#define SWIFT_ABI_DARWIN_ARM64_LEAST_VALID_POINTER 0x100000000ULL
138138

139-
// TBI guarantees the top byte of pointers is unused, but ARMv8.5-A
140-
// claims the bottom four bits of that for memory tagging.
139+
// TBI guarantees the top byte of pointers is unused.
141140
// Heap objects are eight-byte aligned.
142-
#define SWIFT_ABI_ARM64_SWIFT_SPARE_BITS_MASK 0xF000000000000007ULL
141+
#define SWIFT_ABI_ARM64_SWIFT_SPARE_BITS_MASK 0xFF00000000000007ULL
143142

144143
// Objective-C reserves just the high bit for tagged pointers.
145144
#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)