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

Documentation of the RISC-V C API
https://jira.riscv.org/browse/RVG-4
Creative Commons Attribution 4.0 International
68 stars 38 forks source link

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

Closed KaiYG closed 2 months ago

KaiYG commented 12 months 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 11 months ago

Related questions:

kito-cheng commented 11 months 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 10 months 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 2 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 2 months ago

Thanks for the update and closing the ticket!