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!