[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)
Phoebe Wang via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 15 07:37:44 PDT 2024
================
@@ -1185,6 +1189,9 @@ Currently, only the following parameter attributes are defined:
value should be sign-extended to the extent required by the target's
ABI (which is usually 32-bits) by the caller (for a parameter) or
the callee (for a return value).
+``noext`` This indicates to the code generator that the parameter or return
+ value has the high bits undefined, as for a struct in register, and
+ therefore does not need to be sign or zero extended.
----------------
phoebewang wrote:
> Sorry, I don't follow - what part is incorrect according to you?
Oh, I should have quoted what I replied for
>> There doesn't exist an "IR ABI".
>
> There absolutely is. A given IR signature has a backend interpretation. That is the IR ABI. It doesn't matter if this is documented or standardized in any way, it is what it is.
For the question
> The target ABI is independent of the implementation - it is how things are done on a specific platform. On some machines this type of extensions must be done, and this will not change. Other machines do not care about this at all. How could this become more clear in the LangRef.rst do you mean?
The target ABI (from C's perspective) is a subset of what IR can represent. I mean to those representation out of the scope. They are subject to change, because ABI can be defined rather late than the implementation and possible different with it. An example is the `half` type on X86. It uses GPR for a couple of year by the implementation before ABI specifies FPR.
https://github.com/llvm/llvm-project/pull/100757
More information about the cfe-commits
mailing list