This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: register usage
Petar Bajic writes:
>
>
> For this, I had to make two new register classes (machine has 32 regs and
> basicly just one reg class GENERAL_REGS)
> I added two new classes: HI_REGS, and LO_REGS to "enum reg_classes" wich are
> lower and higher 16 regs of GENERAL_REGS.
> REG_CLASS_CONTENTS is expanded with { 0xffff0000 } and { 0x0000ffff }
> REG_CLASS_NAMES has two more names "HI_REGS" and "LO_REGS"
>
> in machine.c file I modified "reg_class_from_letter" making letter 'j' and
> 'k' return HI_REGS and LO_REGS
>
> in machine.md I finally wrote a rule that uses j and k regs to distinct
> input and output....
> (define_insn "*movsicc_insn"
> [(set (match_operand:SI 0 "register_operand" "=j,j")
> (if_then_else:SI (match_operator 1 "comparison_operator" [(match_operand:SI
> 4 "register_operand" "=k,k") (const_int 0)])
> (match_operand:SI 2 "register_operand" "=d,d")
> (match_operand:SI 3 "register_operand" "=d,d")))]
> ""
> "..."
>
> and the error is:
> ../../gcc/libgcc2.c:785: internal compiler error: in copy_to_mode_reg, at
> explow.c:581
>
> what else do I have to do for this to work?
I would look in the debugger to see what copy_to_mode_reg was trying
to do.
I suspect you haven't defined a pattern to move into one of the
register classes.
Andrew.