custom asm mnemonics unrecognized in current riscv-gnu-toolchain

1

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.

riscv
asked on Stack Overflow Oct 26, 2015 by CliffordVienna • edited Oct 27, 2015 by CliffordVienna

2 Answers

3

Sorry this took so long to find -- I don't read stackoverflow. For future reference, if you submit a github issue/PR or email me directly, I'll deal with these sorts of things.

A fix should be here, do you mind verifying it? https://github.com/riscv/riscv-gnu-toolchain/pull/97

Sorry for introducing the regression!

answered on Stack Overflow Oct 29, 2015 by Palmer Dabbelt
1

I also faced this issue, in yesterdays update of the gnu toolchain if you look into the opcodes.custom file in the risv-opcodes folder, all the custom opcodes are commented, you need to uncomment those that you need and recompile the toolchain

answered on Stack Overflow Oct 27, 2015 by Prashant Ravi

User contributions licensed under CC BY-SA 3.0