-
Notifications
You must be signed in to change notification settings - Fork 1.5k
cranelift: Implement TLS on aarch64 Mach-O (Apple Silicon) #5434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cfallin
merged 5 commits into
bytecodealliance:main
from
nathanwhit:aarch64-macho-support-tls
Mar 24, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2cb2458
Implement TLS on Aarch64 Mach-O
nathanwhit 59f3e35
Add aarch64 macho TLS filetest
nathanwhit bebbb41
Address review comments
nathanwhit 62b2228
Use x1 as temporary register in emission
nathanwhit e5aa875
Update aarch64 mach-o TLS filetest
nathanwhit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
test compile precise-output | ||
set tls_model=macho | ||
target aarch64 | ||
|
||
function u0:0(i32) -> i32, i64 { | ||
gv0 = symbol colocated tls u1:0 | ||
|
||
block0(v0: i32): | ||
v1 = global_value.i64 gv0 | ||
return v0, v1 | ||
} | ||
|
||
; VCode: | ||
; stp fp, lr, [sp, #-16]! | ||
; mov fp, sp | ||
; str x24, [sp, #-16]! | ||
; stp d14, d15, [sp, #-16]! | ||
; stp d12, d13, [sp, #-16]! | ||
; stp d10, d11, [sp, #-16]! | ||
; stp d8, d9, [sp, #-16]! | ||
; block0: | ||
; mov x24, x0 | ||
; macho_tls_get_addr x0, userextname0 | ||
; mov x1, x0 | ||
; mov x0, x24 | ||
; ldp d8, d9, [sp], #16 | ||
; ldp d10, d11, [sp], #16 | ||
; ldp d12, d13, [sp], #16 | ||
; ldp d14, d15, [sp], #16 | ||
; ldr x24, [sp], #16 | ||
; ldp fp, lr, [sp], #16 | ||
; ret | ||
; | ||
; Disassembled: | ||
; block0: ; offset 0x0 | ||
; stp x29, x30, [sp, #-0x10]! | ||
; mov x29, sp | ||
; str x24, [sp, #-0x10]! | ||
; stp d14, d15, [sp, #-0x10]! | ||
; stp d12, d13, [sp, #-0x10]! | ||
; stp d10, d11, [sp, #-0x10]! | ||
; stp d8, d9, [sp, #-0x10]! | ||
; block1: ; offset 0x1c | ||
; mov x24, x0 | ||
; adrp x0, #0 ; reloc_external MachOAarch64TlsAdrPage21 u1:0 0 | ||
; ldr x0, [x0] ; reloc_external MachOAarch64TlsAdrPageOff12 u1:0 0 | ||
; ldr x1, [x0] | ||
; blr x1 | ||
; mov x1, x0 | ||
; mov x0, x24 | ||
; ldp d8, d9, [sp], #0x10 | ||
; ldp d10, d11, [sp], #0x10 | ||
; ldp d12, d13, [sp], #0x10 | ||
; ldp d14, d15, [sp], #0x10 | ||
; ldr x24, [sp], #0x10 | ||
; ldp x29, x30, [sp], #0x10 | ||
; ret | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.