-
Notifications
You must be signed in to change notification settings - Fork 60
[AIX] Port to 64-bit AIX #75
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
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9ca91a0
Port to 64-bit AIX
5b45db1
Change .file
6fb1b1e
Fix indentation
27b8416
Add more comments
ce8669f
Add comments
23fafc3
Add comments
b4b60df
Updated README.mkd
e673b75
Updated README.mkd
ef5bbd7
Remove newline
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
.csect .text[PR],2 | ||
.file "powerpc64_aix.s" | ||
|
||
.globl rust_psm_stack_direction[DS] | ||
.globl .rust_psm_stack_direction | ||
.align 4 | ||
.csect rust_psm_stack_direction[DS],3 | ||
.vbyte 8, .rust_psm_stack_direction | ||
.vbyte 8, TOC[TC0] | ||
.vbyte 8, 0 | ||
.csect .text[PR],2 | ||
.rust_psm_stack_direction: | ||
# extern "C" fn() -> u8 | ||
li 3, 2 | ||
blr | ||
L..rust_psm_stack_direction_end: | ||
# Following bytes form the traceback table on AIX. | ||
# For specification, see https://www.ibm.com/docs/en/aix/7.2?topic=processor-traceback-tables. | ||
# For implementation, see https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp, | ||
# `PPCAIXAsmPrinter::emitTracebackTable`. | ||
.vbyte 4, 0x00000000 # Traceback table begin, for unwinder to search the table. | ||
.byte 0x00 # Version = 0 | ||
.byte 0x09 # Language = CPlusPlus, since rust is using C++-like LSDA. | ||
.byte 0x20 # -IsGlobaLinkage, -IsOutOfLineEpilogOrPrologue | ||
# +HasTraceBackTableOffset, -IsInternalProcedure | ||
# -HasControlledStorage, -IsTOCless | ||
# -IsFloatingPointPresent | ||
# -IsFloatingPointOperationLogOrAbortEnabled | ||
.byte 0x40 # -IsInterruptHandler, +IsFunctionNamePresent, -IsAllocaUsed | ||
# OnConditionDirective = 0, -IsCRSaved, -IsLRSaved | ||
.byte 0x80 # +IsBackChainStored, -IsFixup, NumOfFPRsSaved = 0 | ||
.byte 0x00 # -HasExtensionTable, -HasVectorInfo, NumOfGPRsSaved = 0 | ||
.byte 0x00 # NumberOfFixedParms = 0 | ||
.byte 0x01 # NumberOfFPParms = 0, +HasParmsOnStack | ||
.vbyte 4, L..rust_psm_stack_direction_end-.rust_psm_stack_direction #Function size | ||
.vbyte 2, 0x0018 # Function name len = 24 | ||
.byte "rust_psm_stack_direction" # Function Name | ||
|
||
.globl rust_psm_stack_pointer[DS] | ||
.globl .rust_psm_stack_pointer | ||
.align 4 | ||
.csect rust_psm_stack_pointer[DS],3 | ||
.vbyte 8, .rust_psm_stack_pointer | ||
.vbyte 8, TOC[TC0] | ||
.vbyte 8, 0 | ||
.csect .text[PR],2 | ||
.rust_psm_stack_pointer: | ||
# extern "C" fn() -> *mut u8 | ||
mr 3, 1 | ||
blr | ||
L..rust_psm_stack_pointer_end: | ||
.vbyte 4, 0x00000000 | ||
.byte 0x00 | ||
.byte 0x09 | ||
.byte 0x20 | ||
.byte 0x40 | ||
.byte 0x80 | ||
.byte 0x00 | ||
.byte 0x00 | ||
.byte 0x01 | ||
.vbyte 4, L..rust_psm_stack_pointer_end-.rust_psm_stack_pointer | ||
.vbyte 2, 0x0016 | ||
.byte "rust_psm_stack_pointer" | ||
|
||
.globl rust_psm_replace_stack[DS] | ||
.globl .rust_psm_replace_stack | ||
.align 4 | ||
.csect rust_psm_replace_stack[DS],3 | ||
.vbyte 8, .rust_psm_replace_stack | ||
.vbyte 8, TOC[TC0] | ||
.vbyte 8, 0 | ||
.csect .text[PR],2 | ||
.rust_psm_replace_stack: | ||
# extern "C" fn(3: usize, 4: extern "C" fn(usize), 5: *mut u8) | ||
# Load the function pointer and toc pointer from TOC and make the call. | ||
ld 2, 8(4) | ||
ld 4, 0(4) | ||
addi 5, 5, -48 | ||
mr 1, 5 | ||
mtctr 4 | ||
bctr | ||
L..rust_psm_replace_stack_end: | ||
.vbyte 4, 0x00000000 | ||
.byte 0x00 | ||
.byte 0x09 | ||
.byte 0x20 | ||
.byte 0x40 | ||
.byte 0x80 | ||
.byte 0x00 | ||
.byte 0x03 | ||
.byte 0x01 | ||
.vbyte 4, 0x00000000 # Parameter type = i, i, i | ||
.vbyte 4, L..rust_psm_replace_stack_end-.rust_psm_replace_stack | ||
.vbyte 2, 0x0016 | ||
.byte "rust_psm_replace_stack" | ||
|
||
.globl rust_psm_on_stack[DS] | ||
.globl .rust_psm_on_stack | ||
.align 4 | ||
.csect rust_psm_on_stack[DS],3 | ||
.vbyte 8, .rust_psm_on_stack | ||
.vbyte 8, TOC[TC0] | ||
.vbyte 8, 0 | ||
.csect .text[PR],2 | ||
.rust_psm_on_stack: | ||
# extern "C" fn(3: usize, 4: usize, 5: extern "C" fn(usize, usize), 6: *mut u8) | ||
mflr 0 | ||
std 2, -72(6) | ||
std 0, -8(6) | ||
sub 6, 6, 1 | ||
addi 6, 6, -112 | ||
stdux 1, 1, 6 | ||
ld 2, 8(5) | ||
ld 5, 0(5) | ||
mtctr 5 | ||
bctrl | ||
ld 2, 40(1) | ||
ld 0, 104(1) | ||
mtlr 0 | ||
ld 1, 0(1) | ||
blr | ||
L..rust_psm_on_stack_end: | ||
.vbyte 4, 0x00000000 | ||
.byte 0x00 | ||
.byte 0x09 | ||
.byte 0x20 | ||
.byte 0x41 | ||
.byte 0x80 | ||
.byte 0x00 | ||
.byte 0x04 | ||
.byte 0x01 | ||
.vbyte 4, 0x00000000 # Parameter type = i, i, i, i | ||
.vbyte 4, L..rust_psm_on_stack_end-.rust_psm_on_stack | ||
.vbyte 2, 0x0011 | ||
.byte "rust_psm_on_stack" | ||
|
||
.toc |
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.