Skip to content

Commit a4e2990

Browse files
committed
RISC-V: ".option norvc" to disable 'C' and subsets
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.
1 parent a315a71 commit a4e2990

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gas/config/tc-riscv.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4339,7 +4339,11 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
43394339
}
43404340
else if (strcmp (name, "norvc") == 0)
43414341
{
4342-
riscv_update_subset (&riscv_rps_as, "-c");
4342+
/* Compatibility:
4343+
Disable classic 'C' extension and its subsets.
4344+
It won't completely disable them if other enabled extensions
4345+
depend on 'C' or 'Zc*'. */
4346+
riscv_update_subset (&riscv_rps_as, "-c,-zca,-zcf,-zcd");
43434347
riscv_reset_subsets_list_arch_str ();
43444348
riscv_set_rvc (false);
43454349
}

0 commit comments

Comments
 (0)