[PATCH] D40023: [RISCV] Implement ABI lowering

Alex Bradbury via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 23 00:33:35 PST 2017


asb added a comment.

In https://reviews.llvm.org/D40023#933464, @majnemer wrote:

> So how does something like the following work:
>
>   union U { float f; int i; };
>   void f(union U u);
>   
>
> The flattening described in https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#hardware-floating-point-calling-convention makes sense for arrays and structs but I couldn't find where unions were described.


You're right that's not currently described - I have an issue tracking this here: https://github.com/riscv/riscv-elf-psabi-doc/issues/24. Last time I tried to check gcc behaviour it seemed that such cases would be passed according to the integer calling convention, but I'd be happier if one of the GCC devs would confirm.


https://reviews.llvm.org/D40023





More information about the cfe-commits mailing list