binutils-gdb/gas/doc
Nelson Chu d3ffd7f776 RISC-V: Support new .option arch directive.
https://github.com/riscv/riscv-asm-manual/pull/67

Format:
.option arch, +<extension><version>, ...
.option arch, -<extension>
.option arch, =<ISA string>

The new direcitve is used to enable/disable extensions for the specific
code region.  For example,

.attribute arch, "rv64ic"   # arch = rv64i2p0_c2p0
.option push
.option arch, +d2p0, -c     # arch = rv64i2p0_f2p0_d2p0, f is added implied
.option arch, =rv32gc       # arch = rv32i2p0_m2p0_a2p0_f2p0_d2p0_c2p0
.option pop                 # arch = rv64i2p0_c2p0

Note that,
1. ".option rvc/norvc" have the same behavior as ".option arch +c/-c".
2. ".option arch -i" is illegal, since we cannot remove base i extension.
3. If arch=rv64i2p0, then ".option arch, +i3p0" will update the i's version
   from 2.0 to 3.0.
4. If arch=rv64i3p0, then ".option arch, +i" will update the i's version
   from 2.0 to the default one according to the chosen isa spec.

bfd/
	* elfxx-riscv.c (riscv_add_subset): If the subset is already added,
	and the new versions are not RISCV_UNKNOWN_VERSION, then update the
	versions to the subset list.
	(riscv_copy_subset): New function.  Copy the subset from list.
	(riscv_copy_subset_list): New function.  Return the new copyed list.
	(riscv_update_subset): Updated to make .option arch directives workable.
	* elfxx-riscv.h: Updated.
gas/
	* config/tc-riscv.c (riscv_subsets): Defined as a pointer.
	(riscv_rps_as): Init the subset_list to NULL, we will set it later
	once riscv_opts_stack is created or updated.
	(struct riscv_option_stack, riscv_opts_stack): Moved forward.
	(riscv_set_arch): Updated.
	(s_riscv_option): Support new .option arch directive, to add, remove
	or update subsets for the specific code region.
	(riscv_write_out_attrs): Updated.
	* doc/c-riscv.texi: Added document for new .option arch directive.
	* testsuite/gas/riscv/option-arch-01a.d: New testcase.
	* testsuite/gas/riscv/option-arch-01b.d: Likewise.
	* testsuite/gas/riscv/option-arch-01.s: Likewise..
	* testsuite/gas/riscv/option-arch-02.d: Likewise.
	* testsuite/gas/riscv/option-arch-02.s: Likewise.
	* testsuite/gas/riscv/option-arch-fail.d: Likewise.
	* testsuite/gas/riscv/option-arch-fail.l: Likewise.
	* testsuite/gas/riscv/option-arch-fail.s: Likewise.
2021-11-19 18:50:27 +08:00
..
all.texi
as.texi Add multibyte character warning option to the assembler. 2021-11-18 16:48:19 +00:00
c-aarch64.texi aarch64: [SME] Add +sme option to -march 2021-11-17 19:16:48 +00:00
c-alpha.texi
c-arc.texi
c-arm.texi arm: enable Cortex-A710 CPU 2021-11-10 14:09:05 +00:00
c-avr.texi Add a -mno-dollar-line-separator command line option to the AVR assembler. 2021-08-11 10:03:19 +01:00
c-bfin.texi
c-bpf.texi
c-cr16.texi
c-cris.texi
c-csky.texi
c-d10v.texi
c-d30v.texi
c-epiphany.texi
c-h8300.texi
c-hppa.texi
c-i386.texi x86: Add -muse-unaligned-vector-move to assembler 2021-10-22 14:45:13 -07:00
c-ia64.texi
c-ip2k.texi
c-lm32.texi
c-loongarch.texi LoongArch gas support 2021-10-24 21:36:32 +10:30
c-m32c.texi
c-m32r.texi
c-m68hc11.texi
c-m68k.texi
c-metag.texi
c-microblaze.texi
c-mips.texi
c-mmix.texi
c-msp430.texi
c-mt.texi
c-nds32.texi
c-nios2.texi
c-ns32k.texi
c-or1k.texi
c-pdp11.texi
c-pj.texi
c-ppc.texi
c-pru.texi
c-riscv.texi RISC-V: Support new .option arch directive. 2021-11-19 18:50:27 +08:00
c-rl78.texi
c-rx.texi Fix mistake in RX assembler documentation (special section names) 2021-10-01 16:44:10 +01:00
c-s12z.texi
c-s390.texi
c-score.texi
c-sh.texi
c-sparc.texi
c-tic6x.texi
c-tic54x.texi
c-tilegx.texi
c-tilepro.texi
c-v850.texi
c-vax.texi
c-visium.texi
c-wasm32.texi
c-xc16x.texi
c-xgate.texi
c-xstormy16.texi
c-xtensa.texi
c-z8k.texi
c-z80.texi
fdl.texi
h8.texi
internals.texi
Makefile.am
Makefile.in