最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

gcc - Problem adding custom MAC instruction with 4 operands to the RISCV architecture - Stack Overflow

programmeradmin3浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论