📄 i960.md
字号:
emit_insn (gen_rtx (SET, VOIDmode, operands[0], gen_rtx (SUBREG, SImode, temp, 0))); DONE;}")(define_insn "fix_truncsfsi2" [(set (match_operand:SI 0 "register_operand" "=d") (fix:SI (fix:SF (match_operand:SF 1 "fp_arith_operand" "dfGH"))))] "TARGET_NUMERICS" "cvtzri %1,%0" [(set_attr "type" "fpcvt")])(define_expand "fixuns_truncsfsi2" [(set (match_operand:SI 0 "register_operand" "") (unsigned_fix:SI (fix:SF (match_operand:SF 1 "fp_arith_operand" ""))))] "TARGET_NUMERICS" "{ rtx temp = gen_reg_rtx (DImode); emit_insn (gen_rtx (SET, VOIDmode, temp, gen_rtx (UNSIGNED_FIX, DImode, gen_rtx (FIX, SFmode, operands[1])))); emit_insn (gen_rtx (SET, VOIDmode, operands[0], gen_rtx (SUBREG, SImode, temp, 0))); DONE;}");; Arithmetic instructions.(define_insn "subsi3" [(set (match_operand:SI 0 "register_operand" "=d") (minus:SI (match_operand:SI 1 "arith_operand" "dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "subo %2,%1,%0");; Try to generate an lda instruction when it would be faster than an;; add instruction.;; Some assemblers apparently won't accept two addresses added together.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d,d,d") (plus:SI (match_operand:SI 1 "arith32_operand" "%dn,i,dn") (match_operand:SI 2 "arith32_operand" "dn,dn,i")))] "(TARGET_C_SERIES) && (CONSTANT_P (operands[1]) || CONSTANT_P (operands[2]))" "*{ if (GET_CODE (operands[1]) == CONST_INT) { rtx tmp = operands[1]; operands[1] = operands[2]; operands[2] = tmp; } if (GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[1]) == REG && i960_last_insn_type != I_TYPE_REG) { if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) > -32) return \"subo %n2,%1,%0\"; else if (INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) < 32) return \"addo %1,%2,%0\"; } if (CONSTANT_P (operands[1])) return \"lda %1+%2,%0\"; return \"lda %2(%1),%0\";}")(define_insn "addsi3" [(set (match_operand:SI 0 "register_operand" "=d") (plus:SI (match_operand:SI 1 "signed_arith_operand" "%dI") (match_operand:SI 2 "signed_arith_operand" "dIK")))] "" "*{ if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0 && INTVAL (operands[2]) > -32) return \"subo %n2,%1,%0\"; if (i960_bypass (insn, operands[1], operands[2], 0)) return \"addo %2,%1,%0\"; return \"addo %1,%2,%0\";}")(define_insn "mulsi3" [(set (match_operand:SI 0 "register_operand" "=d") (mult:SI (match_operand:SI 1 "arith_operand" "%dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"mulo %2,%1,%0\"; return \"mulo %1,%2,%0\";}" [(set_attr "type" "mult")]);; This goes after the move/add/sub/mul instructions ;; because those instructions are better when they apply.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (match_operand:SI 1 "address_operand" "p"))] "" "lda %a1,%0" [(set_attr "type" "load")]);; This will never be selected because of an "optimization" that GCC does.;; It always converts divides by a power of 2 into a sequence of instructions;; that does a right shift, and then corrects the result if it was negative.;; (define_insn "";; [(set (match_operand:SI 0 "register_operand" "=d");; (div:SI (match_operand:SI 1 "arith_operand" "dI");; (match_operand:SI 2 "power2_operand" "nI")))];; "";; "*{;; operands[2] = gen_rtx(CONST_INT, VOIDmode,bitpos (INTVAL (operands[2])));;; return \"shrdi %2,%1,%0\";;; }"(define_insn "divsi3" [(set (match_operand:SI 0 "register_operand" "=d") (div:SI (match_operand:SI 1 "arith_operand" "dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "divi %2,%1,%0" [(set_attr "type" "div")])(define_insn "udivsi3" [(set (match_operand:SI 0 "register_operand" "=d") (udiv:SI (match_operand:SI 1 "arith_operand" "dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "divo %2,%1,%0" [(set_attr "type" "div")]);; We must use `remi' not `modi' here, to ensure that `%' has the effects;; specified by the ANSI C standard.(define_insn "modsi3" [(set (match_operand:SI 0 "register_operand" "=d") (mod:SI (match_operand:SI 1 "arith_operand" "dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "remi %2,%1,%0" [(set_attr "type" "div")])(define_insn "umodsi3" [(set (match_operand:SI 0 "register_operand" "=d") (umod:SI (match_operand:SI 1 "arith_operand" "dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "remo %2,%1,%0" [(set_attr "type" "div")]);; And instructions (with complement also).(define_insn "andsi3" [(set (match_operand:SI 0 "register_operand" "=d") (and:SI (match_operand:SI 1 "arith_operand" "%dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"and %2,%1,%0\"; return \"and %1,%2,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (and:SI (not:SI (match_operand:SI 1 "arith_operand" "dI")) (match_operand:SI 2 "arith_operand" "dI")))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"notand %2,%1,%0\"; return \"andnot %1,%2,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (ior:SI (not:SI (match_operand:SI 1 "arith_operand" "%dI")) (not:SI (match_operand:SI 2 "arith_operand" "dI"))))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"nand %2,%1,%0\"; return \"nand %1,%2,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (not:SI (and:SI (match_operand:SI 1 "arith_operand" "%dI") (match_operand:SI 2 "arith_operand" "dI"))))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"nand %2,%1,%0\"; return \"nand %1,%2,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (ior:SI (match_operand:SI 1 "arith_operand" "dI") (match_operand:SI 2 "power2_operand" "n")))] "" "*{ operands[2] = gen_rtx (CONST_INT, VOIDmode, bitpos (INTVAL (operands[2]))); return \"setbit %2,%1,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (ior:SI (match_operand:SI 1 "power2_operand" "n") (match_operand:SI 2 "arith_operand" "dI")))] "" "*{ operands[1] = gen_rtx (CONST_INT, VOIDmode, bitpos (INTVAL (operands[1]))); return \"setbit %1,%2,%0\";}")(define_insn "iorsi3" [(set (match_operand:SI 0 "register_operand" "=d") (ior:SI (match_operand:SI 1 "arith_operand" "%dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"or %2,%1,%0\"; return \"or %1,%2,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (ior:SI (not:SI (match_operand:SI 1 "arith_operand" "dI")) (match_operand:SI 2 "arith_operand" "dI")))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"notor %2,%1,%0\"; return \"ornot %1,%2,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (and:SI (not:SI (match_operand:SI 1 "arith_operand" "%dI")) (not:SI (match_operand:SI 2 "arith_operand" "dI"))))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"nor %2,%1,%0\"; return \"nor %1,%2,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (not:SI (ior:SI (match_operand:SI 1 "arith_operand" "%dI") (match_operand:SI 2 "arith_operand" "dI"))))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"nor %2,%1,%0\"; return \"nor %1,%2,%0\";}")(define_insn "xorsi3" [(set (match_operand:SI 0 "register_operand" "=d") (xor:SI (match_operand:SI 1 "arith_operand" "%dI") (match_operand:SI 2 "arith_operand" "dI")))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"xor %2,%1,%0\"; return \"xor %1,%2,%0\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (not:SI (xor:SI (match_operand:SI 1 "arith_operand" "%dI") (match_operand:SI 2 "arith_operand" "dI"))))] "" "*{ if (i960_bypass (insn, operands[1], operands[2], 0)) return \"xnor %2,%1,%0\"; return \"xnor %2,%1,%0\";}")(define_insn "negsi2" [(set (match_operand:SI 0 "register_operand" "=d") (neg:SI (match_operand:SI 1 "arith_operand" "dI")))] "" "subo %1,0,%0" [(set_attr "length" "1")])(define_insn "one_cmplsi2" [(set (match_operand:SI 0 "register_operand" "=d") (not:SI (match_operand:SI 1 "arith_operand" "dI")))] "" "not %1,%0" [(set_attr "length" "1")]);; Floating point arithmetic instructions.(define_insn "adddf3" [(set (match_operand:DF 0 "register_operand" "=d*f") (plus:DF (match_operand:DF 1 "fp_arith_operand" "%rGH") (match_operand:DF 2 "fp_arith_operand" "rGH")))] "TARGET_NUMERICS" "addrl %1,%2,%0" [(set_attr "type" "fpadd")])(define_insn "addsf3" [(set (match_operand:SF 0 "register_operand" "=d*f") (plus:SF (match_operand:SF 1 "fp_arith_operand" "%rGH") (match_operand:SF 2 "fp_arith_operand" "rGH")))] "TARGET_NUMERICS" "addr %1,%2,%0" [(set_attr "type" "fpadd")])(define_insn "subdf3" [(set (match_operand:DF 0 "register_operand" "=d*f") (minus:DF (match_operand:DF 1 "fp_arith_operand" "rGH") (match_operand:DF 2 "fp_arith_operand" "rGH")))] "TARGET_NUMERICS" "subrl %2,%1,%0" [(set_attr "type" "fpadd")])(define_insn "subsf3" [(set (match_operand:SF 0 "register_operand" "=d*f") (minus:SF (match_operand:SF 1 "fp_arith_operand" "rGH") (match_operand:SF 2 "fp_arith_operand" "rGH")))] "TARGET_NUMERICS" "subr %2,%1,%0" [(set_attr "type" "fpadd")])(define_insn "muldf3" [(set (match_operand:DF 0 "register_operand" "=d*f") (mult:DF (match_operand:DF 1 "fp_arith_operand" "rGH") (match_operand:DF 2 "fp_arith_operand" "rGH")))] "TARGET_NUMERICS" "mulrl %1,%2,%0" [(set_attr "type" "fpmul")])(define_insn "mulsf3" [(set (match_operand:SF 0 "register_operand" "=d*f") (mult:SF (match_operand:SF 1 "fp_arith_operand" "rGH") (match_operand:SF 2 "fp_arith_operand" "rGH")))] "TARGET_NUMERICS" "mulr %1,%2,%0" [(set_attr "type" "fpmul")])(define_insn "divdf3" [(set (match_operand:DF 0 "register_operand" "=d*f") (div:DF (match_operand:DF 1 "fp_arith_operand" "rGH") (match_operand:DF 2 "fp_arith_operand" "rGH")))] "TARGET_NUMERICS" "divrl %2,%1,%0" [(set_attr "type" "fpdiv")])(define_insn "divsf3" [(set (match_operand:SF 0 "register_operand" "=d*f") (div:SF (match_operand:SF 1 "fp_arith_operand" "rGH") (match_operand:SF 2 "fp_arith_operand" "rGH")))] "TARGET_NUMERICS" "divr %2,%1,%0" [(set_attr "type" "fpdiv")])(define_insn "negdf2" [(set (match_operand:DF 0 "register_operand" "=d,d*f") (neg:DF (match_operand:DF 1 "register_operand" "d,r")))] "" "*{ if (which_alternative == 0) { if (REGNO (operands[0]) == REGNO (operands[1])) return \"notbit 31,%D1,%D0\"; return \"mov %1,%0\;notbit 31,%D1,%D0\"; } return \"subrl %1,0f0.0,%0\";}" [(set_attr "type" "fpadd")])(define_insn "negsf2" [(set (match_operand:SF 0 "register_operand" "=d,d*f") (neg:SF (match_operand:SF 1 "register_operand" "d,r")))] "" "@ notbit 31,%1,%0 subr %1,0f0.0,%0" [(set_attr "type" "fpadd")]);;; The abs patterns also work even if the target machine doesn't have;;; floating point, because in that case dstreg and srcreg will always be;;; less than 32.(define_insn "absdf2" [(set (match_operand:DF 0 "register_operand" "=d*f") (abs:DF (match_operand:DF 1 "register_operand" "df")))] "" "*{ int dstreg = REGNO (operands[0]); int srcreg = REGNO (operands[1]); if (dstreg < 32) { if (srcreg < 32) { if (dstreg != srcreg) output_asm_insn (\"mov %1,%0\", operands); return \"clrbit 31,%D1,%D0\"; } /* Src is an fp reg. */ return \"movrl %1,%0\;clrbit 31,%D1,%D0\"; } if (srcreg >= 32) return \"cpysre %1,0f0.0,%0\"; return \"movrl %1,%0\;cpysre %0,0f0.0,%0\";}" [(set_attr "type" "multi")])(define_insn "abssf2" [(set (match_operand:SF 0 "register_operand" "=d*f") (abs:SF (match_operand:SF 1 "register_operand" "df")))] "" "*{ int dstreg = REGNO (operands[0]); int srcreg = REGNO (operands[1]); if (dstreg < 32 && srcreg < 32) return \"clrbit 31,%1,%0\"; if (dstreg >= 32 && srcreg >= 32) return \"cpysre %1,0f0.0,%0\"; if (dstreg < 32) return \"movr %1,%0\;clrbit 31,%0,%0\"; return \"movr %1,%0\;cpysre %0,0f0.0,%0\";}" [(set_attr "type" "multi")]);; Tetra (16 byte) float support.(define_insn "cmptf"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -