riscv-rust-toolchain icon indicating copy to clipboard operation
riscv-rust-toolchain copied to clipboard

riscv64imac-unknown-none-elf cross compiler got "error: instruction requires the following: 'M' (Integer Multiplication and Division)"

Open elliott10 opened this issue 3 years ago • 1 comments

When I cross-compile RISCV assembly instructions in file.asm with "rustc 1.60.0-nightly (5e57faa78 2022-01-19) riscv64imac-unknown-none-elf" toolchain. I got the following error:

error: instruction requires the following: 'M' (Integer Multiplication and Division)
        mul t0, t0, a0
        ^

Please help, How should I avoid this error ?

elliott10 avatar Mar 24 '22 08:03 elliott10

Try adding this to your asm file(hope this would work):

.attribute arch, "rv64gc"

sslime336 avatar Jun 06 '23 21:06 sslime336