[PATCH] D12498: X86: add an interrupt calling convention

H.J. Lu via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 13:51:47 PST 2015


The current interrupt spec is

https://gcc.gnu.org/ml/gcc-patches/2015-11/msg00641.html

We added:

To be feature complete, compiler may implement the optional
'no_caller_saved_registers' attribute:

Use this attribute to indicate that the specified function has no
caller-saved registers.  That is, all registers are callee-saved.
The compiler generates proper function entry and exit sequences to
save and restore any modified registers.

The user can call functions specified with 'no_caller_saved_registers'
attribute from an interrupt handler without saving and restoring all
call clobbered registers.


H.J.

On 11/18/15, Peter Marheine <peterm at cs.utah.edu> wrote:
> tari added inline comments.
>
> ================
> Comment at: lib/Target/X86/X86CallingConv.td:711
> @@ -710,1 +710,3 @@
>
> +def CC_X86_Intr : CallingConv<[
> +  // Error codes aren't necessarily 32 bits wide, but fill a 32-bit slot.
> ----------------
> aaboud wrote:
>> I think we need to define argument convention for x86-32 and another for
>> x86-64.
>> X86-32: the arguments need to have size 4 and alignment 4
>> X86-64: the arguments need to have size 8 and alignment 8
>>
>> Also, why do we need to promote types to i32? Do we expect to have smaller
>> types? Should not that be considered as illegal interrupt?
> According to the AMD documentation, the error code in long mode (x86-64) is
> still 32 bits wide, but is padded to 64 bits when placed on the stack. So
> the handling of the error code from a user's perspective is the same in both
> 32- and 64-bit code.
>
> Arguments that are not 32 bits wide should probably be made illegal, yes.
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D12498
>
>
>
>


-- 
H.J.


More information about the llvm-commits mailing list