Skip to content
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 a custom lowering of vaarg for xtensa. #201

Closed
wants to merge 1 commit into from

Commits on Oct 18, 2023

  1. Add a custom lowering of vaarg for xtensa.

    LLVM does not include an implementation of the va_arg instruction for
    Xtensa. From what I understand, this is a conscious decision and
    instead language frontends are encouraged to implement it themselves.
    The rationale seems to be that loading values correctly requires
    language and ABI-specific knowledge that LLVM lacks.
    
    This is true of most architectures, and rustc already provides
    implementation for a number of them. This commit extends the support to
    include Xtensa.
    
    See https://lists.llvm.org/pipermail/llvm-dev/2017-August/116337.html
    for some discussion on the topic.
    
    Unfortunately there does not seem to be a reference document for the
    semantics of the va_list and va_arg on Xtensa. The most reliable source
    is the GCC implementation, which this commit tries to follow. Clang also
    provides its own compatible implementation.
    
    This was tested for all the types that rustc allows in variadics.
    plietar committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    1860557 View commit details
    Browse the repository at this point in the history