fix and test va_arg on f128 on x86 - #163037
Open
folkertdev wants to merge 1 commit into
Open
folkertdev wants to merge 1 commit into
folkertdev wants to merge 1 commit into
Conversation
Member
|
Is there a way to poke this into being a problem in the runtime tests? |
Contributor
Author
|
Hmm, maybe with |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
tracking issue: #116909
Or well, maybe not fix but clarify. There are no actual behavioral changes, but I do think the new code is more correct.
The clang logic for
va_argis kind of (weirdly) complicated.EmitVAArglooks simple, but the complexity is hiding in the "messing with TypeInfo" bit:https://github.com/llvm/llvm-project/blob/0e2786dcb5b28f754a1144c27e708d1c42676af9/clang/lib/CodeGen/Targets/X86.cpp#L1080-L1101
Relevant for us is that it makes an exception for
f128, for which a higher align (16, instead of the slot size of 4) is used.https://github.com/llvm/llvm-project/blob/0e2786dcb5b28f754a1144c27e708d1c42676af9/clang/lib/CodeGen/Targets/X86.cpp#L575-L583
Our code does not have this
TypeInfoidea, and it's not correct in general to just useAllowHigherAlign::Yes. But using it only forf128works. We don't need to consider more complicated cases like structs containingf128fields.The code here used
is_like_windowsbefore. I'm not exactly sure why, the behavior is the same for all accepted types, except nowf128. But windows does not have that type, so its (c-variadic) ABI is just an LLVM fabrication. The x86 code does not seem to make a distinction based on the ABI, so having the same behavior across targets seems best to me.va_argto fetch ani128argument is currently broken in clang.i128on the target is apparently a clang extension anyway, so kind of low priority.f128I only fixed somewhat recently in llvm/llvm-project#218017.r? beetrees or @tgross35
(this may cause a small conflict with #163021)