Dear all,

I am currently working on handling bit-fields on my port and am having
difficulties understanding why GCC is having problems with what I
wrote in.

Following what mips did:

(define_expand "extzv"
  [(set (match_operand 0 "register_operand")
    (zero_extract (match_operand 1 "nonimmediate_operand")
              (match_operand 2 "immediate_operand")
              (match_operand 3 "immediate_operand")))]
  "!TARGET_MIPS16"
{
  ...
})

(define_insn "extzv<mode>"
  [(set (match_operand:GPR 0 "register_operand" "=d")
    (zero_extract:GPR (match_operand:GPR 1 "register_operand" "d")
              (match_operand:SI 2 "immediate_operand" "I")
              (match_operand:SI 3 "immediate_operand" "I")))]
  "mips_use_ins_ext_p (operands[1], INTVAL (operands[2]),INTVAL (operands[3]))"
  "<d>ext\t%0,%1,%3,%2"
  [(set_attr "type" "arith")
   (set_attr "mode" "<MODE>")])

I did:

(define_insn "extzv"
   [(set (match_operand 0 "register_operand" "")
         (zero_extract (match_operand 1 "register_operand" "")
                       (match_operand 2 "const_int_operand" "")
                       (match_operand 3 "const_int_operand" "")))]
 ""
 "")

(define_insn "extzvdi2"
   [(set (match_operand:DI 0 "register_operand" "=r")
         (zero_extract:DI (match_operand:DI 1 "register_operand" "r")
                       (match_operand:DI 2 "const_int_operand" "L")
                       (match_operand:DI 3 "const_int_operand" "L")))]
 "check_extract (DImode, DImode, operands[2], operands[2])"
 "extr\\t%0,%1,%3,%2";
 [(set_attr "type"     "arith")
  (set_attr "mode"     "DI")
  (set_attr "length"   "1")])

For the moment, I haven't put anything in my expand because I don't
know if anything is necessary yet. I was first looking at if GCC was
generating the right code on simple examples.

But I get this message:
struct4.c: In function 'goo':
struct4.c:32: internal compiler error: in simplify_subreg, at
simplify-rtx.c:4923

Does anybody know how can I solve this issue ?
Thanks again for all your help,
Jean Christophe Beyler

Reply via email to