[PATCH] D134717: [Clang][AArch64] Fix va_arg with -mgeneral-regs-only

2022-09-29 Thread Amanieu d'Antras via Phabricator via cfe-commits
Amanieu added a comment. I fully agree that this likely wasn't intentional, but this is still very useful for code that can't use FP registers for whatever reason (e.g. kernels). Regarding the ABI, it doesn't need to be officially defined: it just needs to be compatible with other code compiled

[PATCH] D134717: [Clang][AArch64] Fix va_arg with -mgeneral-regs-only

2022-09-29 Thread Dave Green via Phabricator via cfe-commits
dmgreen added a comment. > With -mgeneral-regs-only, all arguments are passed in GPRs, so we should use > gr_top/gr_offs in va_list even for floating-point types. I don't believe that -mgeneral-regs-only was intended to define an ABI passing floats in GPRs for AArch64. If it has that is likely

[PATCH] D134717: [Clang][AArch64] Fix va_arg with -mgeneral-regs-only

2022-09-29 Thread Amanieu d'Antras via Phabricator via cfe-commits
Amanieu added a comment. Currently using Clang with -mgeneral-regs-only generates perfectly fine soft-float AArch64, with the except of the va_arg() implementation which is fixed here. In fact Rust even has a aarch64-unknown-none-softfloat which relies on this behavior in LLVM. I believe this b

[PATCH] D134717: [Clang][AArch64] Fix va_arg with -mgeneral-regs-only

2022-09-28 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. It seems that the intention of `-mgeneral-regs-only` is to prevent FP and SIMD register use. aarch64-linux-gnu-gcc has such an error error: ‘-mgeneral-regs-only’ is incompatible with the use of floating-point types Clang doesn't reject FP in Sema yet, but I think ch

[PATCH] D134717: [Clang][AArch64] Fix va_arg with -mgeneral-regs-only

2022-09-27 Thread Amanieu d'Antras via Phabricator via cfe-commits
Amanieu created this revision. Amanieu added a reviewer: MaskRay. Herald added subscribers: StephenFan, kristof.beyls. Herald added a project: All. Amanieu requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. With -mgeneral-regs-only, all argume