Skip to content

ILP32E and Variadic Arguments #125

@lenary

Description

@lenary

I would like some clarity around variadic arguments on ILP32E.

At the moment, the ILP32E Calling Convention does not contain any exceptions for the variadic argument behaviour in the base integer calling convention.

The Base integer calling convention says the following about variadic arguments, none of which is predicated on the current stack alignment:

In the base integer calling convention, variadic arguments are passed in the same manner as named arguments, with one exception. Variadic arguments with 2✕XLEN-bit alignment and size at most 2✕XLEN bits are passed in an aligned register pair (i.e., the first register in the pair is even-numbered), or on the stack by value if none is available. After a variadic argument has been passed on the stack, all future arguments will also be passed on the stack (i.e. the last argument register may be left unused due to the aligned register pair rule).

During the implementation of ILP32E in LLVM, it was noted that we were not required to use aligned pairs for these cases, but I'm not sure how the specification supports this claim as currently written.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions