riscv-non-isa / riscv-c-api-doc

Documentation of the RISC-V C API
https://lf-riscv.atlassian.net/browse/RVG-4
Creative Commons Attribution 4.0 International
75 stars 41 forks source link

Should the macro __riscv_c and __riscv_compressed defined for Zca? #51

Closed KaiYG closed 5 months ago

KaiYG commented 1 year ago

Should the macro __riscv_c (and __riscv_compressed) defined when only Zca is enabled? Also, seems GCC and Clang behave differently in this case, e.g., for -march=rv32i_zca, GCC: undefined __riscv_c, while defined __riscv_compressed LLVM: undefined both.

cmuellner commented 1 year ago

Related questions:

kito-cheng commented 1 year ago

__riscv_compressed was deprecated, but I guess we should consider redefine that as defined if any extension provided compressed instruction is available? We have C and Zca now, but not guarantee we won't have more independent Zc* extensions .

cc @a4lg

a4lg commented 1 year ago

While deprecated (according to @kito-cheng), considering the context of __riscv_compressed, I think existence of the compressed instructions is better to be reported by Zca, as well as C (though I'm not sure whether I can use any stronger words like "should").

KaiYG commented 5 months ago

As the Zc spec v1.0.4-2 added the rule that C implies Zca, I think existence of the compressed instructions can be reported by __riscv_zca now.

cmuellner commented 5 months ago

Thanks for the update and closing the ticket!