-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add initial f16
and f128
support to the s390x backend
#10691
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
Add initial f16
and f128
support to the s390x backend
#10691
Conversation
cc @uweigand -- would you mind reviewing the s390x backend changes here? (Thanks!) |
Subscribe to Label Action
This issue or pull request has been labeled: "cranelift", "cranelift:area:machinst", "isle"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Thanks for working on s390x! For f128, current hardware actually has two different ways of representing them - there's the "traditional" way of splitting an f128 value across a pair of 64-bit floating-point registers, but since z14 we can also hold f128 values in a single vector register, with a full set of arithmetic operations available. This patch is based on the traditional FPR pair approach, but I would much prefer using single vector registers, for several reasons:
Note that the one place where we'd still require pairs (even when using VRs everywhere else) is for function arguments and returns, as the ABI was defined for older systems. But for the ABI we have to hard-code registers anyway, so that should be much less of an issue. (For our own non-system ABIs, we could even chose to pass f128 in VR as well.) LLVM (and GCC) will also use VRs to hold f128 if you build with -march=z14 or higher. |
989d9aa
to
950b490
Compare
950b490
to
578707c
Compare
Done.
I'm unsure what you mean by this; according to the s390x ABI specification |
Thanks, I'll have a closer look shortly.
Sorry, I must have gotten confused. You're correct, of course. |
OK, this all LGTM now. Thanks again! |
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.
Thanks for the review, @uweigand! Giving this an approval based on that, and merging.
@alexcrichton it looks like the merge queue checks failed on a diff of a C++ header -- IIRC you had worked on this recently? |
I think that was a failure to download |
This PR adds initial support for passing
f16
andf128
values around to the s390x backend. Support is added for theload
,store
,bitcast
,f16const
andf128const
CLIF instructions.Note that the s390x ABI specification currently does not specify the ABI for
f16
. However, Clang recently added support forf16
in llvm/llvm-project#109164 (as opposed to LLVM just supporting it at the LLVM IR level) using a straightforward extrapolation of the ABI (passingf16
in floating point registers just likef32
andf64
), so on that basis I've not put thef16
ABI behind theenable_llvm_abi_extensions
setting.f16
/f128
issue: #8312