📄 pa.md
字号:
(define_insn "xorsi3" [(set (match_operand:SI 0 "register_operand" "=r") (xor:SI (match_operand:SI 1 "register_operand" "%r") (match_operand:SI 2 "register_operand" "r")))] "" "xor %1,%2,%0")(define_insn "negdi2" [(set (match_operand:DI 0 "register_operand" "=r") (neg:DI (match_operand:DI 1 "register_operand" "r")))] "" "sub 0,%R1,%R0\;subb 0,%1,%0" [(set_attr "type" "unary") (set_attr "length" "2")])(define_insn "negsi2" [(set (match_operand:SI 0 "register_operand" "=r") (neg:SI (match_operand:SI 1 "register_operand" "r")))] "" "sub 0,%1,%0" [(set_attr "type" "unary")])(define_expand "one_cmpldi2" [(set (match_operand:DI 0 "register_operand" "") (not:DI (match_operand:DI 1 "arith_double_operand" "")))] "" "{ if (! register_operand (operands[1], DImode)) FAIL;}")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (not:DI (match_operand:DI 1 "register_operand" "r")))] "" "uaddcm 0,%1,%0\;uaddcm 0,%R1,%R0" [(set_attr "type" "unary") (set_attr "length" "2")])(define_insn "one_cmplsi2" [(set (match_operand:SI 0 "register_operand" "=r") (not:SI (match_operand:SI 1 "register_operand" "r")))] "" "uaddcm 0,%1,%0" [(set_attr "type" "unary")]);; Floating point arithmetic instructions.(define_insn "adddf3" [(set (match_operand:DF 0 "register_operand" "=fx") (plus:DF (match_operand:DF 1 "register_operand" "fx") (match_operand:DF 2 "register_operand" "fx")))] "" "fadd,dbl %1,%2,%0" [(set_attr "type" "fpalu")])(define_insn "addsf3" [(set (match_operand:SF 0 "register_operand" "=fx") (plus:SF (match_operand:SF 1 "register_operand" "fx") (match_operand:SF 2 "register_operand" "fx")))] "" "fadd,sgl %1,%2,%0" [(set_attr "type" "fpalu")])(define_insn "subdf3" [(set (match_operand:DF 0 "register_operand" "=fx") (minus:DF (match_operand:DF 1 "register_operand" "fx") (match_operand:DF 2 "register_operand" "fx")))] "" "fsub,dbl %1,%2,%0" [(set_attr "type" "fpalu")])(define_insn "subsf3" [(set (match_operand:SF 0 "register_operand" "=fx") (minus:SF (match_operand:SF 1 "register_operand" "fx") (match_operand:SF 2 "register_operand" "fx")))] "" "fsub,sgl %1,%2,%0" [(set_attr "type" "fpalu")])(define_insn "muldf3" [(set (match_operand:DF 0 "register_operand" "=fx") (mult:DF (match_operand:DF 1 "register_operand" "fx") (match_operand:DF 2 "register_operand" "fx")))] "" "fmpy,dbl %1,%2,%0" [(set_attr "type" "fpmul")])(define_insn "mulsf3" [(set (match_operand:SF 0 "register_operand" "=fx") (mult:SF (match_operand:SF 1 "register_operand" "fx") (match_operand:SF 2 "register_operand" "fx")))] "" "fmpy,sgl %1,%2,%0" [(set_attr "type" "fpmul")])(define_insn "divdf3" [(set (match_operand:DF 0 "register_operand" "=fx") (div:DF (match_operand:DF 1 "register_operand" "fx") (match_operand:DF 2 "register_operand" "fx")))] "" "fdiv,dbl %1,%2,%0" [(set_attr "type" "fpdivdbl")])(define_insn "divsf3" [(set (match_operand:SF 0 "register_operand" "=fx") (div:SF (match_operand:SF 1 "register_operand" "fx") (match_operand:SF 2 "register_operand" "fx")))] "" "fdiv,sgl %1,%2,%0" [(set_attr "type" "fpdivsgl")])(define_insn "negdf2" [(set (match_operand:DF 0 "register_operand" "=fx") (neg:DF (match_operand:DF 1 "register_operand" "fx")))] "" "fsub,dbl 0,%1,%0" [(set_attr "type" "fpalu")])(define_insn "negsf2" [(set (match_operand:SF 0 "register_operand" "=fx") (neg:SF (match_operand:SF 1 "register_operand" "fx")))] "" "fsub,sgl 0, %1,%0" [(set_attr "type" "fpalu")])(define_insn "absdf2" [(set (match_operand:DF 0 "register_operand" "=fx") (abs:DF (match_operand:DF 1 "register_operand" "fx")))] "" "fabs,dbl %1,%0" [(set_attr "type" "fpalu")])(define_insn "abssf2" [(set (match_operand:SF 0 "register_operand" "=fx") (abs:SF (match_operand:SF 1 "register_operand" "fx")))] "" "fabs,sgl %1,%0" [(set_attr "type" "fpalu")])(define_insn "sqrtdf2" [(set (match_operand:DF 0 "register_operand" "=fx") (sqrt:DF (match_operand:DF 1 "register_operand" "fx")))] "" "fsqrt,dbl %1,%0" [(set_attr "type" "fpsqrtdbl")])(define_insn "sqrtsf2" [(set (match_operand:SF 0 "register_operand" "=fx") (sqrt:SF (match_operand:SF 1 "register_operand" "fx")))] "" "fsqrt,sgl %1,%0" [(set_attr "type" "fpsqrtsgl")]);;- Shift instructions;; Optimized special case of shifting.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m") (const_int 24)))] "" "ldb%M1 %1,%0" [(set_attr "type" "load") (set_attr "length" "1")])(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m") (const_int 16)))] "" "ldh%M1 %1,%0" [(set_attr "type" "load") (set_attr "length" "1")]);; Using shadd_operand works around a bug in reload. For 2.4 fix;; reload and use register_operand instead.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 2)) (match_operand:SI 1 "shadd_operand" "r")))] "" "sh1add %2,%1,%0")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 4)) (match_operand:SI 1 "shadd_operand" "r")))] "" "sh2add %2,%1,%0")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 8)) (match_operand:SI 1 "shadd_operand" "r")))] "" "sh3add %2,%1,%0")(define_insn "sar_sub" [(set (match_operand:SI 0 "register_operand" "=r") (if_then_else (gtu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 1 "int11_operand" "I")) (const_int 0) (minus:SI (match_dup 1) (match_dup 2))))] "" "subi,>>= %1,%2,%0\;copy 0,%0" [(set_attr "length" "2" )])(define_expand "ashlsi3" [(set (match_operand:SI 0 "register_operand" "") (ashift:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "arith32_operand" "")))] "" "{ if (GET_CODE (operands[2]) != CONST_INT) { rtx temp = gen_reg_rtx (SImode); emit_insn (gen_sar_sub (temp, gen_rtx (CONST_INT, VOIDmode, 31), operands[2])); emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 112), temp)); emit_insn (gen_rtx (SET, VOIDmode, operands[0], gen_rtx (ASHIFT, SImode, operands[1], gen_rtx (MINUS, SImode, gen_rtx (CONST_INT, VOIDmode, 31), gen_rtx (REG, SImode, 112))))); DONE; }}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (ashift:SI (match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "const_int_operand" "n")))] "" "*{ rtx xoperands[4]; xoperands[0] = operands[0]; xoperands[1] = operands[1]; xoperands[2] = gen_rtx (CONST_INT, VOIDmode, 31 - (INTVAL (operands[2]) & 31)); xoperands[3] = gen_rtx (CONST_INT, VOIDmode, 32 - (INTVAL (operands[2]) & 31)); output_asm_insn (\"zdep %1,%2,%3,%0\", xoperands); return \"\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (ashift:SI (match_operand:SI 1 "register_operand" "r") (minus:SI (const_int 31) (reg:SI 112))))] "" "zvdep %1,32,%0")(define_expand "ashrsi3" [(set (match_operand:SI 0 "register_operand" "") (ashiftrt:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "arith32_operand" "")))] "" "{ if (GET_CODE (operands[2]) != CONST_INT) { rtx temp = gen_reg_rtx (SImode); emit_insn (gen_sar_sub (temp, gen_rtx (CONST_INT, VOIDmode, 31), operands[2])); emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 112), temp)); emit_insn (gen_rtx (SET, VOIDmode, operands[0], gen_rtx (ASHIFTRT, SImode, operands[1], gen_rtx (MINUS, SImode, gen_rtx (CONST_INT, VOIDmode, 31), gen_rtx (REG, SImode, 112))))); DONE; }}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (ashiftrt:SI (match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "const_int_operand" "n")))] "" "*{ rtx xoperands[4]; xoperands[0] = operands[0]; xoperands[1] = operands[1]; xoperands[2] = gen_rtx (CONST_INT, VOIDmode, 31 - (INTVAL (operands[2]) & 31)); xoperands[3] = gen_rtx (CONST_INT, VOIDmode, 32 - (INTVAL (operands[2]) & 31)); output_asm_insn (\"extrs %1,%2,%3,%0\", xoperands); return \"\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (ashiftrt:SI (match_operand:SI 1 "register_operand" "r") (minus:SI (const_int 31) (reg:SI 112))))] "" "vextrs %1,32,%0")(define_expand "lshrsi3" [(set (match_operand:SI 0 "register_operand" "") (lshiftrt:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "arith32_operand" "")))] "" "{ if (GET_CODE (operands[2]) != CONST_INT) { rtx temp = gen_reg_rtx (SImode); emit_insn (gen_sar_sub (temp, gen_rtx (CONST_INT, VOIDmode, 31), operands[2])); emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, 112), temp)); emit_insn (gen_rtx (SET, VOIDmode, operands[0], gen_rtx (LSHIFTRT, SImode, operands[1], gen_rtx (MINUS, SImode, gen_rtx (CONST_INT, VOIDmode, 31), gen_rtx (REG, SImode, 112))))); DONE; }}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (lshiftrt:SI (match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "const_int_operand" "n")))] "" "*{ rtx xoperands[4]; xoperands[0] = operands[0]; xoperands[1] = operands[1]; xoperands[2] = gen_rtx (CONST_INT, VOIDmode, 31 - (INTVAL (operands[2]) & 31)); xoperands[3] = gen_rtx (CONST_INT, VOIDmode, 32 - (INTVAL (operands[2]) & 31)); output_asm_insn (\"extru %1,%2,%3,%0\", xoperands); return \"\";}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (lshiftrt:SI (match_operand:SI 1 "register_operand" "r") (minus:SI (const_int 31) (reg:SI 112))))] "" "vextru %1,32,%0");; Unconditional and other jump instructions.(define_insn "jump" [(set (pc) (label_ref (match_operand 0 "" "")))] "" "bl%* %l0,0" [(set_attr "type" "branch")]);; Subroutines of "casesi".;; operand 0 is index;; operand 1 is the minimum bound;; operand 2 is the maximum bound - minimum bound + 1;; operand 3 is CODE_LABEL for the table;;; operand 4 is the CODE_LABEL to go to if index out of range.(define_expand "casesi" [(match_operand:SI 0 "general_operand" "") (match_operand:SI 1 "const_int_operand" "") (match_operand:SI 2 "const_int_operand" "") (match_operand 3 "" "") (match_operand 4 "" "")] "" "{ if (GET_CODE (operands[0]) != REG) operands[0] = force_reg (SImode, operands[0]); if (operands[1] != const0_rtx) { rtx reg = gen_reg_rtx (SImode); operands[1] = gen_rtx (CONST_INT, VOIDmode, -INTVAL (operands[1])); if (!INT_14_BITS (operands[1])) operands[1] = force_reg (SImode, operands[1]); emit_insn (gen_addsi3 (reg, operands[0], operands[1])); operands[0] = reg; } if (!INT_11_BITS (operands[2])) operands[2] = force_reg (SImode, operands[2]); emit_jump_insn (gen_casesi0 (operands[0], operands[2], operands[3], operands[4])); DONE;}")(define_insn "casesi0" [(set (pc) (if_then_else (leu (match_operand:SI 0 "register_operand" "r") (match_operand:SI 1 "arith11_operand" "rI")) (plus:SI (mem:SI (plus:SI (pc) (match_dup 0))) (label_ref (match_operand 2 "" ""))) (pc))) (use (label_ref (match_operand 3 "" "")))] "" "*{ if (GET_CODE (operands[1]) == CONST_INT) { operands[1] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[1])); return \"addi,uv %1,%0,0\;blr,n %0,0\;b,n %l3\"; } else { return \"sub,>> %0,%1,0\;blr,n %0,0\;b,n %l3\"; }}" [(set_attr "length" "3")]);; Need nops for the calls because execution is supposed to continue;; past; we don't want to nullify an instruction that we need.;;- jump to subroutine(define_expand "call" [(parallel [(call (match_operand:SI 0 "" "") (match_operand 1 "" "")) (clobber (reg:SI 31)) (clobber (reg:SI 2))])] "" "{ if (TARGET_LONG_CALLS) operands[0] = gen_rtx (MEM, SImode, force_reg (SImode, XEXP (operands[0], 0))); else operands[0] = gen_rtx (MEM, SImode, XEXP (operands[0], 0));}")(define_insn "" [(call (mem:SI (match_operand:SI 0 "call_operand_address" "r,S")) (match_operand 1 "" "i,i")) (clobber (reg:SI 31)) (clobber (reg:SI 2))] "" "*{ if (which_alternative == 0) return \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -