-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
Proposal Details
The RVA23U64 profile specifies a set of extensions, some mandatory and some optional (such as Zacas and Zabha). Currently, however, there is no flag to instruct the Go compiler when to generate code for these optional extensions.
A potential solution is to introduce an environment variable named GORISCV64OPT, which would accept a string array as input. This array would be converted into a map within the compiler. Additionally, macros derived from the input could be passed to the assembler, allowing the use of conditional compilation directives like #ifdef GORISCV64OPT_XXX to control whether optional extension assembly code is included. I also wrote a demo here: https://github.com/zte-riscv/go/pull/64/files#diff-7eb232fb2003a7305dd50315d163ac65a4f06658fecc5f3bf214330995b80e17