-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Implement AArch64 ABI #14519
Merged
Merged
Implement AArch64 ABI #14519
Conversation
This file contains 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
yuyichao
added
system:arm
ARMv7 and AArch64
compiler:codegen
Generation of LLVM IR and native code
needs tests
Unit tests are required for this change
labels
Dec 31, 2015
yuyichao
force-pushed
the
yyc/aarch64-abi
branch
2 times, most recently
from
January 1, 2016 22:53
b72c604
to
4ecabcc
Compare
yuyichao
force-pushed
the
yyc/aarch64-abi
branch
from
January 1, 2016 23:54
4ecabcc
to
d0fbd71
Compare
i believe tests will be covered by #14215 since this is a strict improvement, i'm going to merge this now. |
Nice!! |
Can we backport this to support it on 0.4? |
Putting the label on for now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
This fixes a few SegFault in the test (similar to the ones on ARM) and make the ccall test pass.
A few notes about this PR,
va_list
and we don't have that yet.abi_aarch64.cpp
are comments copied from the calling convension doc, which I use when writing this PR. I think keeping those lines can help reviewing and other people reading the code.__fp16
(Float16
) is allowed as C argument on AArch64 and is passed in a SIMD and floating-point register if possible (different fromInt16
).byval
attribute to abyRef
argument breaks the code generation for that argument. See repro here. Note that in the working case themov x0, sp
correctly set the pass-by-pointer argument while in the broken case this instruction is missing. This is on LLVM 3.7.0 and I couldn't find any docs about how thebyval
attribute affects ABI or how is it processes in a target-dependent way so I'm not sure if this is an LLVM bug or if we are using it incorrectly (on AArch64 at least) (@Keno @vtjnash ). Clang doesn't emit such attribute for these arguments so I just leave it out.__int128
in C is 16 bytes on AArch64 so I increase theMAX_ALIGN
for AArch64. This also seems to be the case on x64 although I haven't find any document for this.