This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how to write a define_peephole2 that uses custom registers in nios2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]