📄 sparc.md
字号:
(pc)))] ""{ operands[1] = gen_compare_reg (LTU, sparc_compare_op0, sparc_compare_op1);})(define_expand "bge" [(set (pc) (if_then_else (ge (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (TARGET_ARCH64 && sparc_compare_op1 == const0_rtx && GET_CODE (sparc_compare_op0) == REG && GET_MODE (sparc_compare_op0) == DImode) { emit_v9_brxx_insn (GE, sparc_compare_op0, operands[0]); DONE; } else if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, GE); emit_jump_insn (gen_bne (operands[0])); DONE; } operands[1] = gen_compare_reg (GE, sparc_compare_op0, sparc_compare_op1);})(define_expand "bgeu" [(set (pc) (if_then_else (geu (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ operands[1] = gen_compare_reg (GEU, sparc_compare_op0, sparc_compare_op1);})(define_expand "ble" [(set (pc) (if_then_else (le (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (TARGET_ARCH64 && sparc_compare_op1 == const0_rtx && GET_CODE (sparc_compare_op0) == REG && GET_MODE (sparc_compare_op0) == DImode) { emit_v9_brxx_insn (LE, sparc_compare_op0, operands[0]); DONE; } else if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, LE); emit_jump_insn (gen_bne (operands[0])); DONE; } operands[1] = gen_compare_reg (LE, sparc_compare_op0, sparc_compare_op1);})(define_expand "bleu" [(set (pc) (if_then_else (leu (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ operands[1] = gen_compare_reg (LEU, sparc_compare_op0, sparc_compare_op1);})(define_expand "bunordered" [(set (pc) (if_then_else (unordered (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, UNORDERED); emit_jump_insn (gen_beq (operands[0])); DONE; } operands[1] = gen_compare_reg (UNORDERED, sparc_compare_op0, sparc_compare_op1);})(define_expand "bordered" [(set (pc) (if_then_else (ordered (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, ORDERED); emit_jump_insn (gen_bne (operands[0])); DONE; } operands[1] = gen_compare_reg (ORDERED, sparc_compare_op0, sparc_compare_op1);})(define_expand "bungt" [(set (pc) (if_then_else (ungt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, UNGT); emit_jump_insn (gen_bgt (operands[0])); DONE; } operands[1] = gen_compare_reg (UNGT, sparc_compare_op0, sparc_compare_op1);})(define_expand "bunlt" [(set (pc) (if_then_else (unlt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, UNLT); emit_jump_insn (gen_bne (operands[0])); DONE; } operands[1] = gen_compare_reg (UNLT, sparc_compare_op0, sparc_compare_op1);})(define_expand "buneq" [(set (pc) (if_then_else (uneq (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, UNEQ); emit_jump_insn (gen_beq (operands[0])); DONE; } operands[1] = gen_compare_reg (UNEQ, sparc_compare_op0, sparc_compare_op1);})(define_expand "bunge" [(set (pc) (if_then_else (unge (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, UNGE); emit_jump_insn (gen_bne (operands[0])); DONE; } operands[1] = gen_compare_reg (UNGE, sparc_compare_op0, sparc_compare_op1);})(define_expand "bunle" [(set (pc) (if_then_else (unle (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, UNLE); emit_jump_insn (gen_bne (operands[0])); DONE; } operands[1] = gen_compare_reg (UNLE, sparc_compare_op0, sparc_compare_op1);})(define_expand "bltgt" [(set (pc) (if_then_else (ltgt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] ""{ if (GET_MODE (sparc_compare_op0) == TFmode && ! TARGET_HARD_QUAD) { sparc_emit_float_lib_cmp (sparc_compare_op0, sparc_compare_op1, LTGT); emit_jump_insn (gen_bne (operands[0])); DONE; } operands[1] = gen_compare_reg (LTGT, sparc_compare_op0, sparc_compare_op1);});; Now match both normal and inverted jump.;; XXX fpcmp nop braindamage(define_insn "*normal_branch" [(set (pc) (if_then_else (match_operator 0 "noov_compare_op" [(reg 100) (const_int 0)]) (label_ref (match_operand 1 "" "")) (pc)))] ""{ return output_cbranch (operands[0], operands[1], 1, 0, final_sequence && INSN_ANNULLED_BRANCH_P (insn), ! final_sequence, insn);} [(set_attr "type" "branch") (set_attr "branch_type" "icc")]);; XXX fpcmp nop braindamage(define_insn "*inverted_branch" [(set (pc) (if_then_else (match_operator 0 "noov_compare_op" [(reg 100) (const_int 0)]) (pc) (label_ref (match_operand 1 "" ""))))] ""{ return output_cbranch (operands[0], operands[1], 1, 1, final_sequence && INSN_ANNULLED_BRANCH_P (insn), ! final_sequence, insn);} [(set_attr "type" "branch") (set_attr "branch_type" "icc")]);; XXX fpcmp nop braindamage(define_insn "*normal_fp_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" [(match_operand:CCFP 0 "fcc_reg_operand" "c") (const_int 0)]) (label_ref (match_operand 2 "" "")) (pc)))] ""{ return output_cbranch (operands[1], operands[2], 2, 0, final_sequence && INSN_ANNULLED_BRANCH_P (insn), ! final_sequence, insn);} [(set_attr "type" "branch") (set_attr "branch_type" "fcc")]);; XXX fpcmp nop braindamage(define_insn "*inverted_fp_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" [(match_operand:CCFP 0 "fcc_reg_operand" "c") (const_int 0)]) (pc) (label_ref (match_operand 2 "" ""))))] ""{ return output_cbranch (operands[1], operands[2], 2, 1, final_sequence && INSN_ANNULLED_BRANCH_P (insn), ! final_sequence, insn);} [(set_attr "type" "branch") (set_attr "branch_type" "fcc")]);; XXX fpcmp nop braindamage(define_insn "*normal_fpe_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" [(match_operand:CCFPE 0 "fcc_reg_operand" "c") (const_int 0)]) (label_ref (match_operand 2 "" "")) (pc)))] ""{ return output_cbranch (operands[1], operands[2], 2, 0, final_sequence && INSN_ANNULLED_BRANCH_P (insn), ! final_sequence, insn);} [(set_attr "type" "branch") (set_attr "branch_type" "fcc")]);; XXX fpcmp nop braindamage(define_insn "*inverted_fpe_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" [(match_operand:CCFPE 0 "fcc_reg_operand" "c") (const_int 0)]) (pc) (label_ref (match_operand 2 "" ""))))] ""{ return output_cbranch (operands[1], operands[2], 2, 1, final_sequence && INSN_ANNULLED_BRANCH_P (insn), ! final_sequence, insn);} [(set_attr "type" "branch") (set_attr "branch_type" "fcc")]);; SPARC V9-specific jump insns. None of these are guaranteed to be;; in the architecture.;; There are no 32 bit brreg insns.;; XXX(define_insn "*normal_int_branch_sp64" [(set (pc) (if_then_else (match_operator 0 "v9_regcmp_op" [(match_operand:DI 1 "register_operand" "r") (const_int 0)]) (label_ref (match_operand 2 "" "")) (pc)))] "TARGET_ARCH64"{ return output_v9branch (operands[0], operands[2], 1, 2, 0, final_sequence && INSN_ANNULLED_BRANCH_P (insn), ! final_sequence, insn);} [(set_attr "type" "branch") (set_attr "branch_type" "reg")]);; XXX(define_insn "*inverted_int_branch_sp64" [(set (pc) (if_then_else (match_operator 0 "v9_regcmp_op" [(match_operand:DI 1 "register_operand" "r") (const_int 0)]) (pc) (label_ref (match_operand 2 "" ""))))] "TARGET_ARCH64"{ return output_v9branch (operands[0], operands[2], 1, 2, 1, final_sequence && INSN_ANNULLED_BRANCH_P (insn), ! final_sequence, insn);} [(set_attr "type" "branch") (set_attr "branch_type" "reg")]);; Load program counter insns.(define_insn "get_pc" [(clobber (reg:SI 15)) (set (match_operand 0 "register_operand" "=r") (unspec [(match_operand 1 "" "") (match_operand 2 "" "")] UNSPEC_GET_PC))] "flag_pic && REGNO (operands[0]) == 23" "sethi\t%%hi(%a1-4), %0\n\tcall\t%a2\n\tadd\t%0, %%lo(%a1+4), %0" [(set_attr "type" "multi") (set_attr "length" "3")]);; Move instructions(define_expand "movqi" [(set (match_operand:QI 0 "general_operand" "") (match_operand:QI 1 "general_operand" ""))] ""{ /* Working with CONST_INTs is easier, so convert a double if needed. */ if (GET_CODE (operands[1]) == CONST_DOUBLE) { operands[1] = GEN_INT (trunc_int_for_mode (CONST_DOUBLE_LOW (operands[1]), QImode)); } /* Handle sets of MEM first. */ if (GET_CODE (operands[0]) == MEM) { if (reg_or_0_operand (operands[1], QImode)) goto movqi_is_ok; if (! reload_in_progress) { operands[0] = validize_mem (operands[0]); operands[1] = force_reg (QImode, operands[1]); } } /* Fixup TLS cases. */ if (tls_symbolic_operand (operands [1])) operands[1] = legitimize_tls_address (operands[1]); /* Fixup PIC cases. */ if (flag_pic) { if (CONSTANT_P (operands[1]) && pic_address_needs_scratch (operands[1])) operands[1] = legitimize_pic_address (operands[1], QImode, 0); if (symbolic_operand (operands[1], QImode)) { operands[1] = legitimize_pic_address (operands[1], QImode, (reload_in_progress ? operands[0] : NULL_RTX)); goto movqi_is_ok; } } /* All QI constants require only one insn, so proceed. */ movqi_is_ok: ;})(define_insn "*movqi_insn" [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,m") (match_operand:QI 1 "input_operand" "rI,m,rJ"))] "(register_operand (operands[0], QImode) || reg_or_0_operand (operands[1], QImode))" "@ mov\t%1, %0 ldub\t%1, %0 stb\t%r1, %0" [(set_attr "type" "*,load,store") (set_attr "us3load_type" "*,3cycle,*")])(define_expand "movhi" [(set (match_operand:HI 0 "general_operand" "") (match_operand:HI 1 "general_operand" ""))] ""{ /* Working with CONST_INTs is easier, so convert a double if needed. */ if (GET_CODE (operands[1]) == CONST_DOUBLE) operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); /* Handle sets of MEM first. */ if (GET_CODE (operands[0]) == MEM) { if (reg_or_0_operand (operands[1], HImode)) goto movhi_is_ok; if (! reload_in_progress)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -