Repository navigation
[Arm64EC] Add support for fp128
#206980
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
[Arm64EC] Add support for fp128
#206980
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
44b3954
[Arm64EC] Add support for `fp128`
folkertdev d39f514
clarify comment
folkertdev 7465bc5
add test for __llvm_Q__ mangling
folkertdev ad07a97
add tests for f16 and f128 returns
folkertdev df1b859
Merge remote-tracking branch 'upstream/main' into arm64ec-f128
folkertdev 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -333,9 +333,16 @@ ThunkArgInfo AArch64Arm64ECCallLowering::canonicalizeThunkType( | |
| return direct(T); | ||
| } | ||
|
|
||
| if (T->isFP128Ty()) { | ||
| // Prefix with `llvm` since MSVC doesn't specify `_Float128` | ||
| Out << "__llvm_q__"; | ||
| // f128 uses sret for compatibility with GCC. | ||
| return pointerIndirection(T); | ||
| } | ||
|
|
||
| if (T->isFloatingPointTy()) { | ||
| report_fatal_error("Only 16, 32, and 64 bit floating points are supported " | ||
| "for ARM64EC thunks"); | ||
| report_fatal_error("Only 16, 32, 64, and 128 bit IEEE floating points " | ||
| "are supported for ARM64EC thunks"); | ||
| } | ||
|
|
||
| auto &DL = M->getDataLayout(); | ||
|
|
@@ -350,14 +357,17 @@ ThunkArgInfo AArch64Arm64ECCallLowering::canonicalizeThunkType( | |
| uint64_t ElementSizePerBytes = DL.getTypeSizeInBits(ElementTy) / 8; | ||
| uint64_t TotalSizeBytes = ElementCnt * ElementSizePerBytes; | ||
| if (ElementTy->isHalfTy() || ElementTy->isFloatTy() || | ||
| ElementTy->isDoubleTy()) { | ||
| ElementTy->isDoubleTy() || ElementTy->isFP128Ty()) { | ||
| if (ElementTy->isHalfTy()) | ||
| // Prefix with `llvm` since MSVC doesn't specify `_Float16` | ||
| Out << "__llvm_H__"; | ||
| else if (ElementTy->isFloatTy()) | ||
| Out << "F"; | ||
| else if (ElementTy->isDoubleTy()) | ||
| Out << "D"; | ||
| else if (ElementTy->isFP128Ty()) | ||
| // Prefix with `llvm` since MSVC doesn't specify `_Float128` | ||
| Out << "__llvm_Q__"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing test coverage. |
||
| Out << TotalSizeBytes; | ||
| if (Alignment.value() >= 16 && !Ret) | ||
| Out << "a" << Alignment.value(); | ||
|
|
@@ -370,9 +380,8 @@ ThunkArgInfo AArch64Arm64ECCallLowering::canonicalizeThunkType( | |
| return pointerIndirection(T); | ||
| } | ||
| } else if (T->isFloatingPointTy()) { | ||
| report_fatal_error( | ||
| "Only 16, 32, and 64 bit floating points are supported " | ||
| "for ARM64EC thunks"); | ||
| report_fatal_error("Only 16, 32, 64, and 128 bit IEEE floating points " | ||
| "are supported for ARM64EC thunks"); | ||
| } | ||
| } | ||
|
|
||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also handles the pass ABI right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, you mean the comment should also mention that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just for my clarification, but the comment doesn't hurt