Hi,
  I had wrote doloop_end instruction to support hwloop.
  When try to compile linux kernel, I meet a reload problem,
  the error message as follow.

  What kinds of instuction pattern should I add to support
  the reload that compiler need ?

  Thanks,
  Aladdin


  the constrant 'q' mean the non-general "counter" register
========================================================
(define_expand "doloop_end"
  [(use (match_operand:SI 0 "register_operand" ""))
   (use (match_operand:SI 1 "const_int_operand" ""))
   (use (match_operand:SI 2 "const_int_operand" ""))
   (use (match_operand:SI 3 "const_int_operand" ""))
   (use (label_ref (match_operand 4 "" "")))]
  ""
{
        if(operands[3] != const1_rtx || flag_unroll_loops ||
flag_unroll_all_loops)
                FAIL;
    emit_jump_insn(gen_bcounter(operands[0], operands[4]));
    DONE;
})

(define_insn "bcounter"
  [(set(pc) (if_then_else
                (ge (match_operand:SI 0 "register_operand" "=q") (const_int 0))
                 (label_ref (match_operand 1 "" ""))
                        (pc)))
   (set(match_dup 0)
        (plus:SI (match_dup 0)
            (const_int -1)))]
  ""
  "bcnz %1"
  [(set_attr "type" "branch")])


Error message
===================================================================
panic.c: In function `panic':
panic.c:104: error: unable to generate reloads for:
(jump_insn 222 152 158 7 (parallel [
            (set (pc)
                (if_then_else (ge (reg:SI 5 r5 [orig:199 msec ] [199])
                        (const_int 0 [0x0]))
                    (label_ref 224)
                    (pc)))
            (set (reg:SI 5 r5 [orig:199 msec ] [199])
                (plus:SI (reg:SI 5 r5 [orig:199 msec ] [199])
                    (const_int -1 [0xffffffff])))
        ]) 0 {bcounter} (nil)
    (expr_list:REG_BR_PROB (const_int 8900 [0x22c4])
        (nil)))
panic.c:104: internal compiler error: in find_reloads, at reload.c:3672
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Reply via email to