[RFC,3/3] RISC-V: ".option norvc" to disable 'C' and subsets
Checks
Commit Message
From: Tsukasa OI <research_trasio@irq.a4lg.com>
Despite its deprecation, ".option norvc" may used to turn off the 'C'
extension. This commit also disables its subsets, 'Zca', 'Zcf' and 'Zcd'
and clarifies that it won't completely do the job if other enabled
extensions depend on 'C' or 'Zc*'.
Note that, even if it does not "completely" work, we cannot emit any
compressed instructions after the ".option norvc" directive since it
disables RVC and prevents any 2-byte instructions from assembling.
gas/ChangeLog:
* config/tc-riscv.c (s_riscv_option): Also turn off 'Zca', 'Zcf'
and 'Zcd'. Clarify the limitation of this directive.
---
gas/config/tc-riscv.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -4351,7 +4351,11 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
}
else if (strcmp (name, "norvc") == 0)
{
- riscv_update_subset (&riscv_rps_as, "-c");
+ /* Compatibility:
+ Disable classic 'C' extension and its subsets.
+ It won't completely disable them if other enabled extensions
+ depend on 'C' or 'Zc*'. */
+ riscv_update_subset (&riscv_rps_as, "-c,-zca,-zcf,-zcd");
riscv_reset_subsets_list_arch_str ();
riscv_set_rvc (false);
}