Re: how to write a define_peephole2 that uses custom registers in nios2

2005-07-28 Thread James E Wilson
Liu Haibin wrote: to "c". However, it seems very difficult here. The old insn patterns are all general registers, but the new insn patterns are defined as custom registers. The peephole pass does not do register allocation. So you can't use it to magically change "r" registers to "c" register

Re: how to write a define_peephole2 that uses custom registers in nios2

2005-07-28 Thread Liu Haibin
Thanks. I modified the related macros, like reg_class, REG_CLASS_FROM_LETTER(CHAR) and so on. But I have a problem on define_peephole2. After I modified the related macros, I replaced the "r" in "custom_inii" with "c". (define_insn "custom_inii" [(set (match_operand:SI 0 "register_operand" "=

Re: how to write a define_peephole2 that uses custom registers in nios2

2005-07-27 Thread James E Wilson
Liu Haibin wrote: (match_operand:SI 2 "register_operand" "r") But the problem is it uses normal register, like r8, r9. How can I write the define_peephole2 so that it uses custom registers? See the "Constraints" section of the documentation. "r" means a general reg

how to write a define_peephole2 that uses custom registers in nios2

2005-07-26 Thread Liu Haibin
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"