This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
how to write a define_peephole2 that uses custom registers in nios2
- From: Liu Haibin <liu dot haibin at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 26 Jul 2005 17:26:03 +0800
- Subject: how to write a define_peephole2 that uses custom registers in nios2
- Reply-to: Liu Haibin <liu dot haibin at gmail dot com>
Hi,
nios2 has a set of custom registers for custom instructions. They all
start with "c", like
custom 1 c4, c2, c0
I want to define a peephole to replace a sequence of codes with this
above custom instruction.
custom instruction is defined as following in nios2.md
(define_insn "custom_inii"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec_volatile:SI [(match_operand:SI 1 "custom_insn_opcode" "N")
(match_operand:SI 2 "register_operand" "r")
(match_operand:SI 3 "register_operand"
"r")] CUSTOM_INII))]
""
"custom\\t%1, %0, %2, %3"
[(set_attr "type" "custom")])
But the problem is it uses normal register, like r8, r9. How can I
write the define_peephole2 so that it uses custom registers?
Thanks
Haibin