how to write a define_peephole2 that uses custom registers in nios2

James E Wilson wilson@specifix.com
Wed Jul 27 19:14:00 GMT 2005


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 
register.  If you want a custom register, then you need to use a 
contraint letter that maps to a custom register.

If the port does not already support custom registers, then you need to 
modify many of the register allocation related macros to add support for 
the custom registers.  See the "Registers" and "Register Classes" 
sections of the documentation.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com



More information about the Gcc mailing list