sparc.md
来自「GCC编译器源代码」· Markdown 代码 · 共 2,069 行 · 第 1/5 页
MD
2,069 行
(match_operand:SF 2 "register_operand" "f")))] "TARGET_FPU" "*{ if (TARGET_V9) return \"fcmpes %0,%1,%2\"; return \"fcmpes %1,%2\";}" [(set_attr "type" "fpcmp")])(define_insn "*cmpdf_fpe" [(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c") (compare:CCFPE (match_operand:DF 1 "register_operand" "e") (match_operand:DF 2 "register_operand" "e")))] "TARGET_FPU" "*{ if (TARGET_V9) return \"fcmped %0,%1,%2\"; return \"fcmped %1,%2\";}" [(set_attr "type" "fpcmp")])(define_insn "*cmptf_fpe" [(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c") (compare:CCFPE (match_operand:TF 1 "register_operand" "e") (match_operand:TF 2 "register_operand" "e")))] "TARGET_FPU && TARGET_HARD_QUAD" "*{ if (TARGET_V9) return \"fcmpeq %0,%1,%2\"; return \"fcmpeq %1,%2\";}" [(set_attr "type" "fpcmp")])(define_insn "*cmpsf_fp" [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") (compare:CCFP (match_operand:SF 1 "register_operand" "f") (match_operand:SF 2 "register_operand" "f")))] "TARGET_FPU" "*{ if (TARGET_V9) return \"fcmps %0,%1,%2\"; return \"fcmps %1,%2\";}" [(set_attr "type" "fpcmp")])(define_insn "*cmpdf_fp" [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") (compare:CCFP (match_operand:DF 1 "register_operand" "e") (match_operand:DF 2 "register_operand" "e")))] "TARGET_FPU" "*{ if (TARGET_V9) return \"fcmpd %0,%1,%2\"; return \"fcmpd %1,%2\";}" [(set_attr "type" "fpcmp")])(define_insn "*cmptf_fp" [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") (compare:CCFP (match_operand:TF 1 "register_operand" "e") (match_operand:TF 2 "register_operand" "e")))] "TARGET_FPU && TARGET_HARD_QUAD" "*{ if (TARGET_V9) return \"fcmpq %0,%1,%2\"; return \"fcmpq %1,%2\";}" [(set_attr "type" "fpcmp")]);; Next come the scc insns. For seq, sne, sgeu, and sltu, we can do this;; without jumps using the addx/subx instructions. For seq/sne on v9 we use;; the same code as v8 (the addx/subx method has more applications). The;; exception to this is "reg != 0" which can be done in one instruction on v9;; (so we do it). For the rest, on v9 we use conditional moves; on v8, we do;; branches.;; Seq_special[_xxx] and sne_special[_xxx] clobber the CC reg, because they;; generate addcc/subcc instructions.(define_expand "seqsi_special" [(set (match_dup 3) (xor:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "register_operand" ""))) (parallel [(set (match_operand:SI 0 "register_operand" "") (eq:SI (match_dup 3) (const_int 0))) (clobber (reg:CC 100))])] "! TARGET_LIVE_G0" "{ operands[3] = gen_reg_rtx (SImode); }")(define_expand "seqdi_special" [(set (match_dup 3) (xor:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "register_operand" ""))) (set (match_operand:DI 0 "register_operand" "") (eq:DI (match_dup 3) (const_int 0)))] "TARGET_ARCH64" "{ operands[3] = gen_reg_rtx (DImode); }")(define_expand "snesi_special" [(set (match_dup 3) (xor:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "register_operand" ""))) (parallel [(set (match_operand:SI 0 "register_operand" "") (ne:SI (match_dup 3) (const_int 0))) (clobber (reg:CC 100))])] "! TARGET_LIVE_G0" "{ operands[3] = gen_reg_rtx (SImode); }")(define_expand "snedi_special" [(set (match_dup 3) (xor:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "register_operand" ""))) (set (match_operand:DI 0 "register_operand" "") (ne:DI (match_dup 3) (const_int 0)))] "TARGET_ARCH64" "{ operands[3] = gen_reg_rtx (DImode); }")(define_expand "seqdi_special_trunc" [(set (match_dup 3) (xor:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "register_operand" ""))) (set (match_operand:SI 0 "register_operand" "") (eq:DI (match_dup 3) (const_int 0)))] "TARGET_ARCH64" "{ operands[3] = gen_reg_rtx (DImode); }")(define_expand "snedi_special_trunc" [(set (match_dup 3) (xor:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "register_operand" ""))) (set (match_operand:SI 0 "register_operand" "") (ne:DI (match_dup 3) (const_int 0)))] "TARGET_ARCH64" "{ operands[3] = gen_reg_rtx (DImode); }")(define_expand "seqsi_special_extend" [(set (match_dup 3) (xor:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "register_operand" ""))) (parallel [(set (match_operand:DI 0 "register_operand" "") (eq:SI (match_dup 3) (const_int 0))) (clobber (reg:CC 100))])] "TARGET_ARCH64" "{ operands[3] = gen_reg_rtx (SImode); }")(define_expand "snesi_special_extend" [(set (match_dup 3) (xor:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "register_operand" ""))) (parallel [(set (match_operand:DI 0 "register_operand" "") (ne:SI (match_dup 3) (const_int 0))) (clobber (reg:CC 100))])] "TARGET_ARCH64" "{ operands[3] = gen_reg_rtx (SImode); }");; ??? v9: Operand 0 needs a mode, so SImode was chosen.;; However, the code handles both SImode and DImode.(define_expand "seq" [(set (match_operand:SI 0 "intreg_operand" "") (eq:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (GET_MODE (sparc_compare_op0) == SImode) { rtx pat; if (GET_MODE (operands[0]) == SImode) pat = gen_seqsi_special (operands[0], sparc_compare_op0, sparc_compare_op1); else if (! TARGET_ARCH64) FAIL; else pat = gen_seqsi_special_extend (operands[0], sparc_compare_op0, sparc_compare_op1); emit_insn (pat); DONE; } else if (GET_MODE (sparc_compare_op0) == DImode) { rtx pat; if (! TARGET_ARCH64) FAIL; else if (GET_MODE (operands[0]) == SImode) pat = gen_seqdi_special_trunc (operands[0], sparc_compare_op0, sparc_compare_op1); else pat = gen_seqdi_special (operands[0], sparc_compare_op0, sparc_compare_op1); emit_insn (pat); DONE; } else if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, EQ); emit_insn (gen_sne (operands[0])); DONE; } else if (TARGET_V9) { if (gen_v9_scc (EQ, operands)) DONE; /* fall through */ } operands[1] = gen_compare_reg (EQ, sparc_compare_op0, sparc_compare_op1);}");; ??? v9: Operand 0 needs a mode, so SImode was chosen.;; However, the code handles both SImode and DImode.(define_expand "sne" [(set (match_operand:SI 0 "intreg_operand" "") (ne:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (GET_MODE (sparc_compare_op0) == SImode) { rtx pat; if (GET_MODE (operands[0]) == SImode) pat = gen_snesi_special (operands[0], sparc_compare_op0, sparc_compare_op1); else if (! TARGET_ARCH64) FAIL; else pat = gen_snesi_special_extend (operands[0], sparc_compare_op0, sparc_compare_op1); emit_insn (pat); DONE; } else if (GET_MODE (sparc_compare_op0) == DImode) { rtx pat; if (! TARGET_ARCH64) FAIL; else if (GET_MODE (operands[0]) == SImode) pat = gen_snedi_special_trunc (operands[0], sparc_compare_op0, sparc_compare_op1); else pat = gen_snedi_special (operands[0], sparc_compare_op0, sparc_compare_op1); emit_insn (pat); DONE; } else if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, NE); emit_insn (gen_sne (operands[0])); DONE; } else if (TARGET_V9) { if (gen_v9_scc (NE, operands)) DONE; /* fall through */ } operands[1] = gen_compare_reg (NE, sparc_compare_op0, sparc_compare_op1);}")(define_expand "sgt" [(set (match_operand:SI 0 "intreg_operand" "") (gt:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, GT); emit_insn (gen_sne (operands[0])); DONE; } else if (TARGET_V9) { if (gen_v9_scc (GT, operands)) DONE; /* fall through */ } operands[1] = gen_compare_reg (GT, sparc_compare_op0, sparc_compare_op1);}")(define_expand "slt" [(set (match_operand:SI 0 "intreg_operand" "") (lt:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, LT); emit_insn (gen_sne (operands[0])); DONE; } else if (TARGET_V9) { if (gen_v9_scc (LT, operands)) DONE; /* fall through */ } operands[1] = gen_compare_reg (LT, sparc_compare_op0, sparc_compare_op1);}")(define_expand "sge" [(set (match_operand:SI 0 "intreg_operand" "") (ge:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, GE); emit_insn (gen_sne (operands[0])); DONE; } else if (TARGET_V9) { if (gen_v9_scc (GE, operands)) DONE; /* fall through */ } operands[1] = gen_compare_reg (GE, sparc_compare_op0, sparc_compare_op1);}")(define_expand "sle" [(set (match_operand:SI 0 "intreg_operand" "") (le:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, LE); emit_insn (gen_sne (operands[0])); DONE; } else if (TARGET_V9) { if (gen_v9_scc (LE, operands)) DONE; /* fall through */ } operands[1] = gen_compare_reg (LE, sparc_compare_op0, sparc_compare_op1);}")(define_expand "sgtu" [(set (match_operand:SI 0 "intreg_operand" "") (gtu:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (! TARGET_V9) { rtx tem; /* We can do ltu easily, so if both operands are registers, swap them and do a LTU. */ if ((GET_CODE (sparc_compare_op0) == REG || GET_CODE (sparc_compare_op0) == SUBREG) && (GET_CODE (sparc_compare_op1) == REG || GET_CODE (sparc_compare_op1) == SUBREG)) { tem = sparc_compare_op0; sparc_compare_op0 = sparc_compare_op1; sparc_compare_op1 = tem; emit_insn (gen_sltu (operands[0])); DONE; } } else { if (gen_v9_scc (GTU, operands)) DONE; } operands[1] = gen_compare_reg (GTU, sparc_compare_op0, sparc_compare_op1);}")(define_expand "sltu" [(set (match_operand:SI 0 "intreg_operand" "") (ltu:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (TARGET_V9) { if (gen_v9_scc (LTU, operands)) DONE; } operands[1] = gen_compare_reg (LTU, sparc_compare_op0, sparc_compare_op1);}")(define_expand "sgeu" [(set (match_operand:SI 0 "intreg_operand" "") (geu:SI (match_dup 1) (const_int 0)))] "! TARGET_LIVE_G0" "{ if (TARGET_V9) { if (gen_v9_scc (GEU, operands)) DONE; } operands[1] = gen_compare_reg (GEU, sparc_compare_op0, sparc_compare_op1);}")(define_expand "sleu" [(set (match_operand:SI 0 "intreg_operand" "") (leu:SI (match_dup 1) (const_int 0)))]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?