📄 pa.md
字号:
hppa_compare_op1 = operands[1]; hppa_branch_type = CMP_SF; DONE;}")(define_expand "cmpdf" [(set (reg:CCFP 0) (compare:CCFP (match_operand:DF 0 "reg_or_0_operand" "") (match_operand:DF 1 "reg_or_0_operand" "")))] "! TARGET_SOFT_FLOAT" "{ hppa_compare_op0 = operands[0]; hppa_compare_op1 = operands[1]; hppa_branch_type = CMP_DF; DONE;}")(define_insn "" [(set (reg:CCFP 0) (match_operator:CCFP 2 "comparison_operator" [(match_operand:SF 0 "reg_or_0_operand" "fG") (match_operand:SF 1 "reg_or_0_operand" "fG")]))] "! TARGET_SOFT_FLOAT" "fcmp,sgl,%Y2 %f0,%f1" [(set_attr "length" "4") (set_attr "type" "fpcc")])(define_insn "" [(set (reg:CCFP 0) (match_operator:CCFP 2 "comparison_operator" [(match_operand:DF 0 "reg_or_0_operand" "fG") (match_operand:DF 1 "reg_or_0_operand" "fG")]))] "! TARGET_SOFT_FLOAT" "fcmp,dbl,%Y2 %f0,%f1" [(set_attr "length" "4") (set_attr "type" "fpcc")]);; scc insns.(define_expand "seq" [(set (match_operand:SI 0 "register_operand" "") (eq:SI (match_dup 1) (match_dup 2)))] "" "{ /* fp scc patterns rarely match, and are not a win on the PA. */ if (hppa_branch_type != CMP_SI) FAIL; /* set up operands from compare. */ operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1; /* fall through and generate default code */}")(define_expand "sne" [(set (match_operand:SI 0 "register_operand" "") (ne:SI (match_dup 1) (match_dup 2)))] "" "{ /* fp scc patterns rarely match, and are not a win on the PA. */ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}")(define_expand "slt" [(set (match_operand:SI 0 "register_operand" "") (lt:SI (match_dup 1) (match_dup 2)))] "" "{ /* fp scc patterns rarely match, and are not a win on the PA. */ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}")(define_expand "sgt" [(set (match_operand:SI 0 "register_operand" "") (gt:SI (match_dup 1) (match_dup 2)))] "" "{ /* fp scc patterns rarely match, and are not a win on the PA. */ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}")(define_expand "sle" [(set (match_operand:SI 0 "register_operand" "") (le:SI (match_dup 1) (match_dup 2)))] "" "{ /* fp scc patterns rarely match, and are not a win on the PA. */ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}")(define_expand "sge" [(set (match_operand:SI 0 "register_operand" "") (ge:SI (match_dup 1) (match_dup 2)))] "" "{ /* fp scc patterns rarely match, and are not a win on the PA. */ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}")(define_expand "sltu" [(set (match_operand:SI 0 "register_operand" "") (ltu:SI (match_dup 1) (match_dup 2)))] "" "{ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}")(define_expand "sgtu" [(set (match_operand:SI 0 "register_operand" "") (gtu:SI (match_dup 1) (match_dup 2)))] "" "{ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}")(define_expand "sleu" [(set (match_operand:SI 0 "register_operand" "") (leu:SI (match_dup 1) (match_dup 2)))] "" "{ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}")(define_expand "sgeu" [(set (match_operand:SI 0 "register_operand" "") (geu:SI (match_dup 1) (match_dup 2)))] "" "{ if (hppa_branch_type != CMP_SI) FAIL; operands[1] = hppa_compare_op0; operands[2] = hppa_compare_op1;}");; Instruction canonicalization puts immediate operands second, which;; is the reverse of what we want.(define_insn "scc" [(set (match_operand:SI 0 "register_operand" "=r") (match_operator:SI 3 "comparison_operator" [(match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "arith11_operand" "rI")]))] "" "com%I2clr,%B3 %2,%1,%0\;ldi 1,%0" [(set_attr "type" "binary") (set_attr "length" "8")])(define_insn "iorscc" [(set (match_operand:SI 0 "register_operand" "=r") (ior:SI (match_operator:SI 3 "comparison_operator" [(match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "arith11_operand" "rI")]) (match_operator:SI 6 "comparison_operator" [(match_operand:SI 4 "register_operand" "r") (match_operand:SI 5 "arith11_operand" "rI")])))] "" "com%I2clr,%S3 %2,%1,%%r0\;com%I5clr,%B6 %5,%4,%0\;ldi 1,%0" [(set_attr "type" "binary") (set_attr "length" "12")]);; Combiner patterns for common operations performed with the output;; from an scc insn (negscc and incscc).(define_insn "negscc" [(set (match_operand:SI 0 "register_operand" "=r") (neg:SI (match_operator:SI 3 "comparison_operator" [(match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "arith11_operand" "rI")])))] "" "com%I2clr,%B3 %2,%1,%0\;ldi -1,%0" [(set_attr "type" "binary") (set_attr "length" "8")]);; Patterns for adding/subtracting the result of a boolean expression from;; a register. First we have special patterns that make use of the carry;; bit, and output only two instructions. For the cases we can't in;; general do in two instructions, the incscc pattern at the end outputs;; two or three instructions.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (leu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "arith11_operand" "rI")) (match_operand:SI 1 "register_operand" "r")))] "" "sub%I3 %3,%2,%%r0\;addc %%r0,%1,%0" [(set_attr "type" "binary") (set_attr "length" "8")]); This need only accept registers for op3, since canonicalization; replaces geu with gtu when op3 is an integer.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (geu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "register_operand" "r")) (match_operand:SI 1 "register_operand" "r")))] "" "sub %2,%3,%%r0\;addc %%r0,%1,%0" [(set_attr "type" "binary") (set_attr "length" "8")]); Match only integers for op3 here. This is used as canonical form of the; geu pattern when op3 is an integer. Don't match registers since we can't; make better code than the general incscc pattern.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (gtu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "int11_operand" "I")) (match_operand:SI 1 "register_operand" "r")))] "" "addi %k3,%2,%%r0\;addc %%r0,%1,%0" [(set_attr "type" "binary") (set_attr "length" "8")])(define_insn "incscc" [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (match_operator:SI 4 "comparison_operator" [(match_operand:SI 2 "register_operand" "r,r") (match_operand:SI 3 "arith11_operand" "rI,rI")]) (match_operand:SI 1 "register_operand" "0,?r")))] "" "@ com%I3clr,%B4 %3,%2,%%r0\;addi 1,%0,%0 com%I3clr,%B4 %3,%2,%%r0\;addi,tr 1,%1,%0\;copy %1,%0" [(set_attr "type" "binary,binary") (set_attr "length" "8,12")])(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (match_operand:SI 1 "register_operand" "r") (gtu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "arith11_operand" "rI"))))] "" "sub%I3 %3,%2,%%r0\;subb %1,0,%0" [(set_attr "type" "binary") (set_attr "length" "8")])(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r") (gtu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "arith11_operand" "rI"))) (match_operand:SI 4 "register_operand" "r")))] "" "sub%I3 %3,%2,%%r0\;subb %1,%4,%0" [(set_attr "type" "binary") (set_attr "length" "8")]); This need only accept registers for op3, since canonicalization; replaces ltu with leu when op3 is an integer.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (match_operand:SI 1 "register_operand" "r") (ltu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "register_operand" "r"))))] "" "sub %2,%3,%%r0\;subb %1,0,%0" [(set_attr "type" "binary") (set_attr "length" "8")])(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r") (ltu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "register_operand" "r"))) (match_operand:SI 4 "register_operand" "r")))] "" "sub %2,%3,%%r0\;subb %1,%4,%0" [(set_attr "type" "binary") (set_attr "length" "8")]); Match only integers for op3 here. This is used as canonical form of the; ltu pattern when op3 is an integer. Don't match registers since we can't; make better code than the general incscc pattern.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (match_operand:SI 1 "register_operand" "r") (leu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "int11_operand" "I"))))] "" "addi %k3,%2,%%r0\;subb %1,0,%0" [(set_attr "type" "binary") (set_attr "length" "8")])(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r") (leu:SI (match_operand:SI 2 "register_operand" "r") (match_operand:SI 3 "int11_operand" "I"))) (match_operand:SI 4 "register_operand" "r")))] "" "addi %k3,%2,%%r0\;subb %1,%4,%0" [(set_attr "type" "binary") (set_attr "length" "8")])(define_insn "decscc" [(set (match_operand:SI 0 "register_operand" "=r,r") (minus:SI (match_operand:SI 1 "register_operand" "0,?r") (match_operator:SI 4 "comparison_operator" [(match_operand:SI 2 "register_operand" "r,r") (match_operand:SI 3 "arith11_operand" "rI,rI")])))] "" "@ com%I3clr,%B4 %3,%2,%%r0\;addi -1,%0,%0 com%I3clr,%B4 %3,%2,%%r0\;addi,tr -1,%1,%0\;copy %1,%0" [(set_attr "type" "binary,binary") (set_attr "length" "8,12")]); Patterns for max and min. (There is no need for an earlyclobber in the; last alternative since the middle alternative will match if op0 == op1.)(define_insn "sminsi3" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (smin:SI (match_operand:SI 1 "register_operand" "%0,0,r") (match_operand:SI 2 "arith11_operand" "r,I,M")))] "" "@ comclr,> %2,%0,%%r0\;copy %2,%0 comiclr,> %2,%0,%%r0\;ldi %2,%0 comclr,> %1,%r2,%0\;copy %1,%0"[(set_attr "type" "multi,multi,multi") (set_attr "length" "8,8,8")])(define_insn "uminsi3" [(set (match_operand:SI 0 "register_operand" "=r,r") (umin:SI (match_operand:SI 1 "register_operand" "%0,0") (match_operand:SI 2 "arith11_operand" "r,I")))] "" "@ comclr,>> %2,%0,%%r0\;copy %2,%0 comiclr,>> %2,%0,%%r0\;ldi %2,%0"[(set_attr "type" "multi,multi") (set_attr "length" "8,8")])(define_insn "smaxsi3" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (smax:SI (match_operand:SI 1 "register_operand" "%0,0,r") (match_operand:SI 2 "arith11_operand" "r,I,M")))] "" "@ comclr,< %2,%0,%%r0\;copy %2,%0 comiclr,< %2,%0,%%r0\;ldi %2,%0 comclr,< %1,%r2,%0\;copy %1,%0"[(set_attr "type" "multi,multi,multi") (set_attr "length" "8,8,8")])(define_insn "umaxsi3" [(set (match_operand:SI 0 "register_operand" "=r,r") (umax:SI (match_operand:SI 1 "register_operand" "%0,0") (match_operand:SI 2 "arith11_operand" "r,I")))] "" "@ comclr,<< %2,%0,%%r0\;copy %2,%0 comiclr,<< %2,%0,%%r0\;ldi %2,%0"[(set_attr "type" "multi,multi") (set_attr "length" "8,8")])(define_insn "abssi2" [(set (match_operand:SI 0 "register_operand" "=r") (abs:SI (match_operand:SI 1 "register_operand" "r")))] "" "or,>= %%r0,%1,%0\;subi 0,%0,%0" [(set_attr "type" "multi") (set_attr "length" "8")]);;; Experimental conditional move patterns(define_expand "movsicc" [(set (match_operand:SI 0 "register_operand" "") (if_then_else:SI (match_operator 1 "comparison_operator" [(match_dup 4) (match_dup 5)]) (match_operand:SI 2 "reg_or_cint_move_operand" "") (match_operand:SI 3 "reg_or_cint_move_operand" "")))] "" "{ enum rtx_code code = GET_CODE (operands[1]); if (hppa_branch_type != CMP_SI) FAIL; /* operands[1] is currently the result of compare_from_rtx. We want to emit a compare of the original operands. */ operands[1] = gen_rtx_fmt_ee (code, SImode, hppa_compare_op0, hppa_compare_op1); operands[4] = hppa_compare_op0; operands[5] = hppa_compare_op1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -