📄 ia64.md
字号:
(const_int 0)])) (match_operand:BI 1 "register_operand" "0")))] "" "cmp.%C3.and.orcm %I0, %0 = r0, %2" [(set_attr "itanium_class" "icmp")])(define_insn "*tbit_or_0" [(set (match_operand:BI 0 "register_operand" "=c") (ior:BI (ne:BI (and:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1)) (const_int 0)) (match_operand:BI 2 "register_operand" "0")))] "" "tbit.nz.or.andcm %0, %I0 = %1, 0" [(set_attr "itanium_class" "tbit")])(define_insn "*tbit_or_1" [(set (match_operand:BI 0 "register_operand" "=c") (ior:BI (eq:BI (and:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1)) (const_int 0)) (match_operand:BI 2 "register_operand" "0")))] "" "tbit.z.or.andcm %0, %I0 = %1, 0" [(set_attr "itanium_class" "tbit")])(define_insn "*tbit_or_2" [(set (match_operand:BI 0 "register_operand" "=c") (ior:BI (ne:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1) (match_operand:DI 2 "const_int_operand" "n")) (const_int 0)) (match_operand:BI 3 "register_operand" "0")))] "" "tbit.nz.or.andcm %0, %I0 = %1, %2" [(set_attr "itanium_class" "tbit")])(define_insn "*tbit_or_3" [(set (match_operand:BI 0 "register_operand" "=c") (ior:BI (eq:BI (zero_extract:DI (match_operand:DI 1 "gr_register_operand" "r") (const_int 1) (match_operand:DI 2 "const_int_operand" "n")) (const_int 0)) (match_operand:BI 3 "register_operand" "0")))] "" "tbit.z.or.andcm %0, %I0 = %1, %2" [(set_attr "itanium_class" "tbit")]);; Transform test of and/or of setcc into parallel comparisons.(define_split [(set (match_operand:BI 0 "register_operand" "") (ne:BI (and:DI (ne:DI (match_operand:BI 2 "register_operand" "") (const_int 0)) (match_operand:DI 3 "register_operand" "")) (const_int 0)))] "" [(set (match_dup 0) (and:BI (ne:BI (and:DI (match_dup 3) (const_int 1)) (const_int 0)) (match_dup 2)))] "")(define_split [(set (match_operand:BI 0 "register_operand" "") (eq:BI (and:DI (ne:DI (match_operand:BI 2 "register_operand" "") (const_int 0)) (match_operand:DI 3 "register_operand" "")) (const_int 0)))] "" [(set (match_dup 0) (and:BI (ne:BI (and:DI (match_dup 3) (const_int 1)) (const_int 0)) (match_dup 2))) (parallel [(set (match_dup 0) (not:BI (match_dup 0))) (clobber (scratch))])] "")(define_split [(set (match_operand:BI 0 "register_operand" "") (ne:BI (ior:DI (ne:DI (match_operand:BI 2 "register_operand" "") (const_int 0)) (match_operand:DI 3 "register_operand" "")) (const_int 0)))] "" [(set (match_dup 0) (ior:BI (ne:BI (match_dup 3) (const_int 0)) (match_dup 2)))] "")(define_split [(set (match_operand:BI 0 "register_operand" "") (eq:BI (ior:DI (ne:DI (match_operand:BI 2 "register_operand" "") (const_int 0)) (match_operand:DI 3 "register_operand" "")) (const_int 0)))] "" [(set (match_dup 0) (ior:BI (ne:BI (match_dup 3) (const_int 0)) (match_dup 2))) (parallel [(set (match_dup 0) (not:BI (match_dup 0))) (clobber (scratch))])] "");; ??? Incredibly hackish. Either need four proper patterns with all;; the alternatives, or rely on sched1 to split the insn and hope that;; nothing bad happens to the comparisons in the meantime.;;;; Alternately, adjust combine to allow 2->2 and 3->3 splits, assuming;; that we're doing height reduction.;;(define_insn_and_split ""; [(set (match_operand:BI 0 "register_operand" "=c"); (and:BI (and:BI (match_operator:BI 1 "comparison_operator"; [(match_operand 2 "" ""); (match_operand 3 "" "")]); (match_operator:BI 4 "comparison_operator"; [(match_operand 5 "" ""); (match_operand 6 "" "")])); (match_dup 0)))]; "flag_schedule_insns"; "#"; ""; [(set (match_dup 0) (and:BI (match_dup 1) (match_dup 0))); (set (match_dup 0) (and:BI (match_dup 4) (match_dup 0)))]; "");;(define_insn_and_split ""; [(set (match_operand:BI 0 "register_operand" "=c"); (ior:BI (ior:BI (match_operator:BI 1 "comparison_operator"; [(match_operand 2 "" ""); (match_operand 3 "" "")]); (match_operator:BI 4 "comparison_operator"; [(match_operand 5 "" ""); (match_operand 6 "" "")])); (match_dup 0)))]; "flag_schedule_insns"; "#"; ""; [(set (match_dup 0) (ior:BI (match_dup 1) (match_dup 0))); (set (match_dup 0) (ior:BI (match_dup 4) (match_dup 0)))]; "");;(define_split; [(set (match_operand:BI 0 "register_operand" ""); (and:BI (and:BI (match_operator:BI 1 "comparison_operator"; [(match_operand 2 "" ""); (match_operand 3 "" "")]); (match_operand:BI 7 "register_operand" "")); (and:BI (match_operator:BI 4 "comparison_operator"; [(match_operand 5 "" ""); (match_operand 6 "" "")]); (match_operand:BI 8 "register_operand" ""))))]; ""; [(set (match_dup 0) (and:BI (match_dup 7) (match_dup 8))); (set (match_dup 0) (and:BI (and:BI (match_dup 1) (match_dup 4)); (match_dup 0)))]; "");;(define_split; [(set (match_operand:BI 0 "register_operand" ""); (ior:BI (ior:BI (match_operator:BI 1 "comparison_operator"; [(match_operand 2 "" ""); (match_operand 3 "" "")]); (match_operand:BI 7 "register_operand" "")); (ior:BI (match_operator:BI 4 "comparison_operator"; [(match_operand 5 "" ""); (match_operand 6 "" "")]); (match_operand:BI 8 "register_operand" ""))))]; ""; [(set (match_dup 0) (ior:BI (match_dup 7) (match_dup 8))); (set (match_dup 0) (ior:BI (ior:BI (match_dup 1) (match_dup 4)); (match_dup 0)))]; "");; Try harder to avoid predicate copies by duplicating compares.;; Note that we'll have already split the predicate copy, which;; is kind of a pain, but oh well.(define_peephole2 [(set (match_operand:BI 0 "register_operand" "") (match_operand:BI 1 "comparison_operator" "")) (set (match_operand:CCI 2 "register_operand" "") (match_operand:CCI 3 "register_operand" "")) (set (match_operand:CCI 4 "register_operand" "") (match_operand:CCI 5 "register_operand" "")) (set (match_operand:BI 6 "register_operand" "") (unspec:BI [(match_dup 6)] UNSPEC_PRED_REL_MUTEX))] "REGNO (operands[3]) == REGNO (operands[0]) && REGNO (operands[4]) == REGNO (operands[0]) + 1 && REGNO (operands[4]) == REGNO (operands[2]) + 1 && REGNO (operands[6]) == REGNO (operands[2])" [(set (match_dup 0) (match_dup 1)) (set (match_dup 6) (match_dup 7))] "operands[7] = copy_rtx (operands[1]);");; ::::::::::::::::::::;; ::;; :: 16 bit Integer arithmetic;; ::;; ::::::::::::::::::::(define_insn "mulhi3" [(set (match_operand:HI 0 "gr_register_operand" "=r") (mult:HI (match_operand:HI 1 "gr_register_operand" "r") (match_operand:HI 2 "gr_register_operand" "r")))] "" "pmpy2.r %0 = %1, %2" [(set_attr "itanium_class" "mmmul")]);; ::::::::::::::::::::;; ::;; :: 32 bit Integer arithmetic;; ::;; ::::::::::::::::::::(define_insn "addsi3" [(set (match_operand:SI 0 "gr_register_operand" "=r,r,r") (plus:SI (match_operand:SI 1 "gr_register_operand" "%r,r,a") (match_operand:SI 2 "gr_reg_or_22bit_operand" "r,I,J")))] "" "@ add %0 = %1, %2 adds %0 = %2, %1 addl %0 = %2, %1" [(set_attr "itanium_class" "ialu")])(define_insn "*addsi3_plus1" [(set (match_operand:SI 0 "gr_register_operand" "=r") (plus:SI (plus:SI (match_operand:SI 1 "gr_register_operand" "r") (match_operand:SI 2 "gr_register_operand" "r")) (const_int 1)))] "" "add %0 = %1, %2, 1" [(set_attr "itanium_class" "ialu")])(define_insn "*addsi3_plus1_alt" [(set (match_operand:SI 0 "gr_register_operand" "=r") (plus:SI (mult:SI (match_operand:SI 1 "gr_register_operand" "r") (const_int 2)) (const_int 1)))] "" "add %0 = %1, %1, 1" [(set_attr "itanium_class" "ialu")])(define_insn "*addsi3_shladd" [(set (match_operand:SI 0 "gr_register_operand" "=r") (plus:SI (mult:SI (match_operand:SI 1 "gr_register_operand" "r") (match_operand:SI 2 "shladd_operand" "n")) (match_operand:SI 3 "gr_register_operand" "r")))] "" "shladd %0 = %1, %S2, %3" [(set_attr "itanium_class" "ialu")])(define_insn "subsi3" [(set (match_operand:SI 0 "gr_register_operand" "=r") (minus:SI (match_operand:SI 1 "gr_reg_or_8bit_operand" "rK") (match_operand:SI 2 "gr_register_operand" "r")))] "" "sub %0 = %1, %2" [(set_attr "itanium_class" "ialu")])(define_insn "*subsi3_minus1" [(set (match_operand:SI 0 "gr_register_operand" "=r") (plus:SI (not:SI (match_operand:SI 1 "gr_register_operand" "r")) (match_operand:SI 2 "gr_register_operand" "r")))] "" "sub %0 = %2, %1, 1" [(set_attr "itanium_class" "ialu")]);; ??? Could add maddsi3 patterns patterned after the madddi3 patterns.(define_insn "mulsi3" [(set (match_operand:SI 0 "fr_register_operand" "=f") (mult:SI (match_operand:SI 1 "grfr_register_operand" "f") (match_operand:SI 2 "grfr_register_operand" "f")))] "" "xmpy.l %0 = %1, %2" [(set_attr "itanium_class" "xmpy")])(define_insn "maddsi4" [(set (match_operand:SI 0 "fr_register_operand" "=f") (plus:SI (mult:SI (match_operand:SI 1 "grfr_register_operand" "f") (match_operand:SI 2 "grfr_register_operand" "f")) (match_operand:SI 3 "grfr_register_operand" "f")))] "" "xma.l %0 = %1, %2, %3" [(set_attr "itanium_class" "xmpy")])(define_insn "negsi2" [(set (match_operand:SI 0 "gr_register_operand" "=r") (neg:SI (match_operand:SI 1 "gr_register_operand" "r")))] "" "sub %0 = r0, %1" [(set_attr "itanium_class" "ialu")])(define_expand "abssi2" [(set (match_dup 2) (ge:BI (match_operand:SI 1 "gr_register_operand" "") (const_int 0))) (set (match_operand:SI 0 "gr_register_operand" "") (if_then_else:SI (eq (match_dup 2) (const_int 0)) (neg:SI (match_dup 1)) (match_dup 1)))] "" { operands[2] = gen_reg_rtx (BImode); })(define_expand "sminsi3" [(set (match_dup 3) (ge:BI (match_operand:SI 1 "gr_register_operand" "") (match_operand:SI 2 "gr_register_operand" ""))) (set (match_operand:SI 0 "gr_register_operand" "") (if_then_else:SI (ne (match_dup 3) (const_int 0)) (match_dup 2) (match_dup 1)))] "" { operands[3] = gen_reg_rtx (BImode); })(define_expand "smaxsi3" [(set (match_dup 3) (ge:BI (match_operand:SI 1 "gr_register_operand" "") (match_operand:SI 2 "gr_register_operand" ""))) (set (match_operand:SI 0 "gr_register_operand" "") (if_then_else:SI (ne (match_dup 3) (const_int 0)) (match_dup 1) (match_dup 2)))] "" { operands[3] = gen_reg_rtx (BImode); })(define_expand "uminsi3" [(set (match_dup 3) (geu:BI (match_operand:SI 1 "gr_register_operand" "") (match_operand:SI 2 "gr_register_operand" ""))) (set (match_operand:SI 0 "gr_register_operand" "") (if_then_else:SI (ne (match_dup 3) (const_int 0)) (match_dup 2) (match_dup 1)))] "" { operands[3] = gen_reg_rtx (BImode); })(define_expand "umaxsi3" [(set (match_dup 3) (geu:BI (match_operand:SI 1 "gr_register_operand" "") (match_operand:SI 2 "gr_register_operand" ""))) (set (match_operand:SI 0 "gr_register_operand" "") (if_then_else:SI (ne (match_dup 3) (const_int 0)) (match_dup 1) (match_dup 2)))] "" { operands[3] = gen_reg_rtx (BImode); })(define_expand "divsi3" [(set (match_operand:SI 0 "register_operand" "") (div:SI (match_operand:SI 1 "general_operand" "") (match_operand:SI 2 "general_operand" "")))] "TARGET_INLINE_INT_DIV"{ rtx op1_xf, op2_xf, op0_xf, op0_di, twon34, twon34_exp; op0_xf = gen_reg_rtx (XFmode); op0_di = gen_reg_rtx (DImode); if (CONSTANT_P (operands[1])) operands[1] = force_reg (SImode, operands[1]); op1_xf = gen_reg_rtx (XFmode); expand_float (op1_xf, operands[1], 0); if (CONSTANT_P (operands[2])) operands[2] = force_reg (SImode, operands[2]); op2_xf = gen_reg_rtx (XFmode); expand_float (op2_xf, operands[2], 0); /* 2^-34 */ twon34_exp = gen_reg_rtx (DImode); emit_move_insn (twon34_exp, GEN_INT (65501)); twon34 = gen_reg_rtx (XFmode); emit_insn (gen_setf_exp_xf (twon34, twon34_exp)); emit_insn (gen_divsi3_internal (op0_xf, op1_xf, op2_xf, twon34)); emit_insn (gen_fix_truncxfdi2_alts (op0_di, op0_xf, const1_rtx)); emit_move_insn (operands[0], gen_lowpart (SImode, op0_di)); DONE;})(define_expand "modsi3" [(set (match_operand:SI 0 "register_operand" "") (mod:SI (match_operand:SI 1 "general_operand" "") (match_operand:SI 2 "general_operand" "")))] "TARGET_INLINE_INT_DIV"{ rtx op2_neg, op1_di, div; div = gen_reg_rtx (SImode); emit_insn (gen_divsi3 (div, operands[1], operands[2])); op2_neg = expand_unop (SImode, neg_optab, operands[2], NULL_RTX, 0); /* This is a trick to get us to reuse the value that we're sure to have already copied to the FP regs. */ op1_di = gen_reg_rtx (DImode); convert_move (op1_di, operands[1], 0); emit_insn (gen_maddsi4 (operands[0], div, op2_neg, gen_lowpart (SImode, op1_di))); DONE;})(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -