For example, the following assembler statement should translate to the opcode 0x0000000b
custom0 0,0,0,0
With an older version of riscv-gnu-toolchain (built on Jun 4th) no -march= option was needed to assemble this. However, with todays git head of riscv-tools I get:
$ /opt/riscv_new/bin/riscv64-unknown-elf-as -m32 test.s
test.s: Assembler messages:
test.s:1: Error: unrecognized opcode `custom0 0,0,0,0'
From reading the source code I'd guess passing the arch Xcustom to the tools should fix that, but:
$ /opt/riscv_new/bin/riscv64-unknown-elf-as -m32 -march=RV32IMXcustom test.s
test.s: Assembler messages:
test.s:1: Error: unrecognized opcode `custom0 0,0,0,0'
(At the moment the PicoRV32 test firmware does not build with the latest riscv-gnu-toolchain because of this.)
Edit: The last version of riscv-tools that work for me is commit 84a47e0b4e from Aug 20. With that version the custom0 opcode is recognized with and without the -march= option.