I am trying to add a custom instruction which has 4 operands. It does multiply and accumulate (a*b+c) to the first 3 source registers and then store the result in the destination register. It multiplies the first 2 source registers and then add the value to the 3rd register and the stores it in the destination register.
I used inline assembly to call the custom instruction. When I converted the C-code to assembly the instruction was called successfully. But when I am trying to compile the C-code I am getting this error.
riscv64-unknown-elf-gcc mac4op.c
/home/chaitanya/riscv_custom/lib/gcc/riscv64-unknown-elf/14.2.0/../../../../riscv64-unknown-elf/bin/ld: /tmp/cc5VUpL0.o: in function main': mac4op.c:(.text+0x30): undefined reference to a3'
collect2: error: ld returned 1 exit status
Do anyone know the reason for this?
I added the custom instruction into the tool chain and I also converted into the assembly language successfully. But I am facing the above error when I am compiling the code.