Open lenary opened 3 years ago
These affect the calling convention, struct layout, etc., so I think we basically have to codify them.
It looks like, for GCC, all glibc targets use the same definitions: fast8 is char
; the others are long
. I can't say I understand why fast8 is the way that it is--maybe they felt that in this case potential for memory waste outweighed the perf gain from using a register-sized type?--but the rest are sensible. https://github.com/gcc-mirror/gcc/blob/master/gcc/config/glibc-stdint.h
My opinion is that this stuff really belongs in the C API. See, e.g., https://github.com/riscv/riscv-c-api-doc/pull/14 However, there is (apparently) now a psABI working group, whereas I don't think the same is true for the C API.
Ah, yeah, I agree; I suppose my point is that it should be standardized, not that it should be standardized in this doc.
I think clang and gcc currently disagree on the size and alignment of
int_fastN_t
andint_leastN_t
in some places. GCC is likely correct, as clang will always match those two.Do we want to codify this in the psABI?
I looked at making the Clang changes required, and they were fairly involved - https://reviews.llvm.org/D80963 was the initial bit, but clang also has a
stdint.h
implementation for freestanding mode which is not very much fun to edit and improve.If we don't want to codify it, we should also say that, maybe. I don't know what people feel is reasonable.