You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 7, 2024. It is now read-only.
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:
int adds_sz1(int a, int b, int c){ a = b + c - a; return a;}
I know the gimple says that _1 = b + c; a = _1 - a; D.1599 = a;
I don`t know why my insn doesnt work, could someone help me
The text was updated successfully, but these errors were encountered:
You didn't post the pattern for addssi3, that would be the key to teach GCC how to synthesis instructions, in another word: you don't really need to write a define_insn_and_rewrite pattern, just get addssi3 with right RTL pattern, and then GCC will synthesis if possible...but it's hard to describe in a short comment.
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".
Well, to use "combine" PASS combine the operation.
First, use -fdump-rtl-combine-details to check whether GCC has a chance to combine operations.
In your example, I saw this following information:
Failed to match this instruction:
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: