RISC-V: Replace .option rvc/norvc with .option arch, +c/-c.

Since the .option rvc/norvc directives are obsolete, replace them with
the new proposed diretives: .option arch, +c/-c.  And also reset the
riscv_opts.rvc flag for the .option arch directives.

gas/
	* config/tc-riscv.c (s_riscv_option): Reset the riscv_opts.rvc
	for the .option arch directives.
	* testsuite/gas/riscv/align-1.s: Replace the obsolete .option
	rvc/norvc with .option arch, +c/-c.
	* testsuite/gas/riscv/c-add-addi.s: Likewise.
	* testsuite/gas/riscv/c-nonzero-imm.s: Likewise.
	* testsuite/gas/riscv/c-nonzero-reg.s: Likewise.
	* testsuite/gas/riscv/c-zero-imm-64.s: Likewise.
	* testsuite/gas/riscv/c-zero-imm.s: Likewise.
	* testsuite/gas/riscv/c-zero-reg.s: Likewise.
	* testsuite/gas/riscv/ext.s: Likewise.
	* testsuite/gas/riscv/mapping-01.s: Likewise.
	* testsuite/gas/riscv/mapping-02.s: Likewise.
	* testsuite/gas/riscv/mapping-03.s: Likewise.
	* testsuite/gas/riscv/mapping-04.s: Likewise.
	* testsuite/gas/riscv/no-relax-align-2.s: Likewise.
	* testsuite/gas/riscv/shamt-32.s: Likewise.
	* testsuite/gas/riscv/shamt-64.s: Likewise.
This commit is contained in:
Nelson Chu 2021-11-22 18:21:15 +08:00
parent a92d031d7e
commit e7e599a156
16 changed files with 22 additions and 18 deletions

View File

@ -3773,6 +3773,10 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
if (ISSPACE (*name) && *name != '\0')
name++;
riscv_update_subset (&riscv_rps_as, name);
riscv_set_rvc (false);
if (riscv_subset_supports (&riscv_rps_as, "c"))
riscv_set_rvc (true);
}
else if (strcmp (name, "push") == 0)
{

View File

@ -1,3 +1,3 @@
.option norvc
.option arch, -c
.align 2
.align 1

View File

@ -1,3 +1,3 @@
.option rvc
.option arch, +c
addi a2, zero, 1
add a0, zero, a1

View File

@ -1,3 +1,3 @@
.option rvc
.option arch, +c
c.nop 0
c.nop 1

View File

@ -1,3 +1,3 @@
.option rvc
.option arch, +c
c.addiw x0, 10
c.jr x0

View File

@ -1,4 +1,4 @@
.option rvc
.option arch, +c
# These are valid instructions.
addiw a6,a6,0
c.addiw a7,0

View File

@ -1,4 +1,4 @@
.option rvc
.option arch, +c
# These are valid instructions.
li a0,0
c.li a1,0

View File

@ -1,4 +1,4 @@
.option rvc
.option arch, +c
# These are hints.
c.li x0, 1
c.lui x0, 2

View File

@ -1,5 +1,5 @@
target:
.option norvc
.option arch, -c
zext.b a0, a0
zext.h a0, a0
sext.b a0, a0
@ -18,7 +18,7 @@ target:
sext.w a1, a2
.endif
.option rvc
.option arch, +c
zext.b a0, a0
zext.h a0, a0
sext.b a0, a0

View File

@ -1,4 +1,4 @@
.option norvc
.option arch, -c
.text
.global funcA
funcA:

View File

@ -1,4 +1,4 @@
.option norvc
.option arch, -c
.text
.word 1
add a0, a0, a0

View File

@ -1,4 +1,4 @@
.option norvc
.option arch, -c
.text
add a0, a0, a0
.long 0

View File

@ -1,5 +1,5 @@
.text
.option norvc
.option arch, -c
.fill 2, 4, 0x1001
.byte 1
.word 0

View File

@ -1,5 +1,5 @@
.option norelax
.option rvc
.option arch, +c
.byte 0
.align 4
nop

View File

@ -1,4 +1,4 @@
.option norvc
.option arch, -c
slli a0, a0, 0
slli a0, a0, 31
slli a0, a0, 32
@ -14,7 +14,7 @@
srai a0, a0, 32
srai a0, a0, 63
.option rvc
.option arch, +c
slli a0, a0, 0
slli a0, a0, 31
slli a0, a0, 32

View File

@ -1,4 +1,4 @@
.option norvc
.option arch, -c
slli a0, a0, 0
slli a0, a0, 31
slli a0, a0, 32
@ -29,7 +29,7 @@
sraiw a0, a0, 32
sraiw a0, a0, 63
.option rvc
.option arch, +c
slli a0, a0, 0
slli a0, a0, 31
slli a0, a0, 32