-
Notifications
You must be signed in to change notification settings - Fork 275
How can i add a custom insn in riscv.md? #362
Comments
You didn't post the pattern for I would suggest you could send some time to read those slide first before continue your gcc hack: http://www.cse.iitb.ac.in/grc/gcc-workshop-12/index.php?page=slides , especially for the day 3 part, that is very helpful to understand how it work and how to write a md pattern in right way. |
It seems that you want to use GCC "Canonicalization of Instructions". First, use -fdump-rtl-combine-details to check whether GCC has a chance to combine operations. (set (reg/i:DI 10 a0) According to this information, you can define a machine description like this: (define_insn "" You can directly copy this machine description and try. For more details about GCC combining operation, please read this: |
I try to add a custom insn named "adds", which use to describe "a = b + c - a".
in riscv.md, I write
I just start to learn gcc, so i try to add a new insn first to let gcc translate C code in md witch this insn .I have added this in binutils and gcc can identify successfully。
here is my simple test:
The text was updated successfully, but these errors were encountered: