Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22096

RISC-V GCC .insn directive for I type instructions

$
0
0

I am attempting to test a custom extension on RISC-V QEMU, the instruction is of i-type, and I am using a PC variable as an immediate to be offsetted, my standard technique has been to use

asm volatile(".insn i opcode, func3, %0, %1, %2" : "=r"(result) : "r"(rs1) : "imm"(someconstant));

However, I am thrown the error "error: expected ')' before '(' token" Leading me to believe that I am not substituting in the immediate value correctly, I am unsure what exactly is used in directive call to refer to the immediate as I can scarcely find anything for I-type instructions online, only examples referring to the R-type instructions. Would anyone be able to point me in the appropriate syntax for an I-type directive?


Viewing all articles
Browse latest Browse all 22096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>