Skip to content

C compatible Int128 layout on x64 #20415

@yuyichao

Description

@yuyichao

A recent discourse post just reminds me about this....

(Or in general, any C->LLVM mapping that requires explicit padding.)

The alignment for Int128 on x64 is currently 8 in julia and LLVM. However, AFAIK, it should be 16 in order to match the C ABI. Fixing this may require adding explicit padding fields when we declare the LLVM struct in the same way clang does it. The hard part is to fix all the use of gep on a struct in codegen to use the actual field index including the padding field rather than the julia field index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingThis change will break codecompiler:codegenGeneration of LLVM IR and native code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions