lenary wrote:

>From the [psABI](https://riscv-non-isa.github.io/riscv-elf-psabi-doc/) (which 
>covers C99 standard `_Complex` but not GCC's extensions):

> `_Complex` types have the same layout as a struct containing two fields of 
> the corresponding real type (`float`, `double`, or `long double`), with the 
> first member holding the real part and the second member holding the 
> imaginary part.

-- §4.4 "C/C++ Type Representations"

> Aggregates whose total size is no more than 2×XLEN bits are passed in a pair 
> of registers.

-- §2.1 "Integer Calling Convention"


I think there are a few different choices here:
- We declare these types not part of the ABI. This is pretty bad for users.
- we write up the ABI for these that either follows `_Complex <floating point>` 
(which clang does), or that follows what gcc does, with reasoning.




https://github.com/llvm/llvm-project/pull/216404
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to