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

RISCV inline assembly compilation

$
0
0

To start with optimizing my code I have to start with adding assembly code into my C which is crosscompiled with gcc riscv toolchain, to start with I trying to implement simple riscv inline as follows

int src = 1;int dst;   asm ("mov %1, %0\n\t""add $1, %0\n\t": "=r" (dst) : "r" (src));

But error while crosscompiling it as

Error: unrecognized opcode `mov a1,a1'

Error: illegal operands `add $1,a1'

Should I add any specific flags for inline assembly implementation? any help would be great!


Viewing all articles
Browse latest Browse all 22016

Trending Articles



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