📄 m68k.md
字号:
[(set (cc0) (compare (match_operand:DF 0 "general_operand" "f,mG") (match_operand:DF 1 "general_operand" "fmG,f")))] "TARGET_68881"{ cc_status.flags = CC_IN_68881; if (REG_P (operands[0])) { if (REG_P (operands[1])) return "fcmp%.x %1,%0"; else return "fcmp%.d %f1,%0"; } cc_status.flags |= CC_REVERSED; return "fcmp%.d %f0,%1";})(define_expand "cmpsf" [(set (cc0) (compare (match_operand:SF 0 "general_operand" "") (match_operand:SF 1 "general_operand" "")))] "TARGET_68881"{ m68k_last_compare_had_fp_operands = 1;})(define_insn "" [(set (cc0) (compare (match_operand:SF 0 "general_operand" "f,mdG") (match_operand:SF 1 "general_operand" "fmdG,f")))] "TARGET_68881"{ cc_status.flags = CC_IN_68881; if (FP_REG_P (operands[0])) { if (FP_REG_P (operands[1])) return "fcmp%.x %1,%0"; else return "fcmp%.s %f1,%0"; } cc_status.flags |= CC_REVERSED; return "fcmp%.s %f0,%1";});; Recognizers for btst instructions.;; ColdFire/5200 only allows "<Q>" type addresses when the bit position is;; specified as a constant, so we must disable all patterns that may extract;; from a MEM at a constant bit position if we can't use this as a constraint.(define_insn "" [(set (cc0) (zero_extract (match_operand:QI 0 "memory_src_operand" "oS") (const_int 1) (minus:SI (const_int 7) (match_operand:SI 1 "general_operand" "di"))))] "!TARGET_COLDFIRE"{ return output_btst (operands, operands[1], operands[0], insn, 7);});; This is the same as the above pattern except for the constraints. The 'i';; has been deleted.(define_insn "" [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "o") (const_int 1) (minus:SI (const_int 7) (match_operand:SI 1 "general_operand" "d"))))] "TARGET_COLDFIRE"{ return output_btst (operands, operands[1], operands[0], insn, 7);})(define_insn "" [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "d") (const_int 1) (minus:SI (const_int 31) (match_operand:SI 1 "general_operand" "di"))))] ""{ return output_btst (operands, operands[1], operands[0], insn, 31);});; The following two patterns are like the previous two;; except that they use the fact that bit-number operands;; are automatically masked to 3 or 5 bits.(define_insn "" [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "o") (const_int 1) (minus:SI (const_int 7) (and:SI (match_operand:SI 1 "register_operand" "d") (const_int 7)))))] ""{ return output_btst (operands, operands[1], operands[0], insn, 7);})(define_insn "" [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "d") (const_int 1) (minus:SI (const_int 31) (and:SI (match_operand:SI 1 "register_operand" "d") (const_int 31)))))] ""{ return output_btst (operands, operands[1], operands[0], insn, 31);});; Nonoffsettable mem refs are ok in this one pattern;; since we don't try to adjust them.(define_insn "" [(set (cc0) (zero_extract (match_operand:QI 0 "memory_operand" "m") (const_int 1) (match_operand:SI 1 "const_int_operand" "n")))] "(unsigned) INTVAL (operands[1]) < 8 && !TARGET_COLDFIRE"{ operands[1] = GEN_INT (7 - INTVAL (operands[1])); return output_btst (operands, operands[1], operands[0], insn, 7);})(define_insn "" [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "do") (const_int 1) (match_operand:SI 1 "const_int_operand" "n")))] "!TARGET_COLDFIRE"{ if (GET_CODE (operands[0]) == MEM) { operands[0] = adjust_address (operands[0], QImode, INTVAL (operands[1]) / 8); operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8); return output_btst (operands, operands[1], operands[0], insn, 7); } operands[1] = GEN_INT (31 - INTVAL (operands[1])); return output_btst (operands, operands[1], operands[0], insn, 31);});; This is the same as the above pattern except for the constraints.;; The 'o' has been replaced with 'Q'.(define_insn "" [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "dQ") (const_int 1) (match_operand:SI 1 "const_int_operand" "n")))] "TARGET_COLDFIRE"{ if (GET_CODE (operands[0]) == MEM) { operands[0] = adjust_address (operands[0], QImode, INTVAL (operands[1]) / 8); operands[1] = GEN_INT (7 - INTVAL (operands[1]) % 8); return output_btst (operands, operands[1], operands[0], insn, 7); } operands[1] = GEN_INT (31 - INTVAL (operands[1])); return output_btst (operands, operands[1], operands[0], insn, 31);});; move instructions;; A special case in which it is not desirable;; to reload the constant into a data register.(define_insn "pushexthisi_const" [(set (match_operand:SI 0 "push_operand" "=m") (match_operand:SI 1 "const_int_operand" "J"))] "INTVAL (operands[1]) >= -0x8000 && INTVAL (operands[1]) < 0x8000"{ if (operands[1] == const0_rtx) return "clr%.l %0"; if (valid_mov3q_const(operands[1])) return "mov3q%.l %1,%-"; return "pea %a1";});This is never used.;(define_insn "swapsi"; [(set (match_operand:SI 0 "nonimmediate_operand" "+r"); (match_operand:SI 1 "general_operand" "+r")); (set (match_dup 1) (match_dup 0))]; ""; "exg %1,%0");; Special case of fullword move when source is zero.;; The reason this is special is to avoid loading a zero;; into a data reg with moveq in order to store it elsewhere.(define_insn "movsi_const0" [(set (match_operand:SI 0 "nonimmediate_operand" "=g") (const_int 0))] ;; clr insns on 68000 read before writing. ;; This isn't so on the 68010, but we have no TARGET_68010. "((TARGET_68020 || TARGET_COLDFIRE) || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0])))"{ if (ADDRESS_REG_P (operands[0])) { /* On the '040, 'subl an,an' takes 2 clocks while lea takes only 1 */ if (!TARGET_68040 && !TARGET_68060) return "sub%.l %0,%0"; else return MOTOROLA ? "lea 0.w,%0" : "lea 0:w,%0"; } /* moveq is faster on the 68000. */ if (DATA_REG_P (operands[0]) && (!TARGET_68020 && !TARGET_COLDFIRE)) return "moveq #0,%0"; return "clr%.l %0";});; General case of fullword move.;;;; This is the main "hook" for PIC code. When generating;; PIC, movsi is responsible for determining when the source address;; needs PIC relocation and appropriately calling legitimize_pic_address;; to perform the actual relocation.;;;; In both the PIC and non-PIC cases the patterns generated will;; matched by the next define_insn.(define_expand "movsi" [(set (match_operand:SI 0 "nonimmediate_operand" "") (match_operand:SI 1 "general_operand" ""))] ""{ if (flag_pic && !TARGET_PCREL && symbolic_operand (operands[1], SImode)) { /* The source is an address which requires PIC relocation. Call legitimize_pic_address with the source, mode, and a relocation register (a new pseudo, or the final destination if reload_in_progress is set). Then fall through normally */ rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode); operands[1] = legitimize_pic_address (operands[1], SImode, temp); } else if (flag_pic && TARGET_PCREL && ! reload_in_progress) { /* Don't allow writes to memory except via a register; the m68k doesn't consider PC-relative addresses to be writable. */ if (symbolic_operand (operands[0], SImode)) operands[0] = force_reg (SImode, XEXP (operands[0], 0)); else if (GET_CODE (operands[0]) == MEM && symbolic_operand (XEXP (operands[0], 0), SImode)) operands[0] = gen_rtx_MEM (SImode, force_reg (SImode, XEXP (operands[0], 0))); }});; General case of fullword move. The register constraints;; force integer constants in range for a moveq to be reloaded;; if they are headed for memory.(define_insn "" ;; Notes: make sure no alternative allows g vs g. ;; We don't allow f-regs since fixed point cannot go in them. [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<") (match_operand:SI 1 "general_src_operand" "daymSKT,n,i"))] "!TARGET_COLDFIRE"{ return output_move_simode (operands);})(define_insn "*movsi_cf" [(set (match_operand:SI 0 "nonimmediate_operand" "=r<Q>,g,U") (match_operand:SI 1 "general_operand" "g,r<Q>,U"))] "TARGET_COLDFIRE && !TARGET_CFV4" "* return output_move_simode (operands);")(define_insn "*movsi_cfv4" [(set (match_operand:SI 0 "nonimmediate_operand" "=r<Q>,g,U") (match_operand:SI 1 "general_operand" "Rg,Rr<Q>,U"))] "TARGET_CFV4" "* return output_move_simode (operands);");; Special case of fullword move, where we need to get a non-GOT PIC;; reference into an address register.(define_insn "" [(set (match_operand:SI 0 "nonimmediate_operand" "=a<") (match_operand:SI 1 "pcrel_address" ""))] "TARGET_PCREL"{ if (push_operand (operands[0], SImode)) return "pea %a1"; return "lea %a1,%0";})(define_expand "movhi" [(set (match_operand:HI 0 "nonimmediate_operand" "") (match_operand:HI 1 "general_operand" ""))] "" "")(define_insn "" [(set (match_operand:HI 0 "nonimmediate_operand" "=g") (match_operand:HI 1 "general_src_operand" "gS"))] "!TARGET_COLDFIRE" "* return output_move_himode (operands);") (define_insn "" [(set (match_operand:HI 0 "nonimmediate_operand" "=r<Q>,g,U") (match_operand:HI 1 "general_operand" "g,r<Q>,U"))] "TARGET_COLDFIRE" "* return output_move_himode (operands);")(define_expand "movstricthi" [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "")) (match_operand:HI 1 "general_src_operand" ""))] "" "")(define_insn "" [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+dm")) (match_operand:HI 1 "general_src_operand" "rmSn"))] "!TARGET_COLDFIRE" "* return output_move_stricthi (operands);")(define_insn "" [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+d,m")) (match_operand:HI 1 "general_src_operand" "rmn,r"))] "TARGET_COLDFIRE" "* return output_move_stricthi (operands);")(define_expand "movqi" [(set (match_operand:QI 0 "nonimmediate_operand" "") (match_operand:QI 1 "general_src_operand" ""))] "" "")(define_insn "" [(set (match_operand:QI 0 "nonimmediate_operand" "=d,*a,m") (match_operand:QI 1 "general_src_operand" "dmSi*a,di*a,dmSi"))] "!TARGET_COLDFIRE" "* return output_move_qimode (operands);")(define_insn "" [(set (match_operand:QI 0 "nonimmediate_operand" "=d<Q>,dm,U,d*a") (match_operand:QI 1 "general_src_operand" "dmi,d<Q>,U,di*a"))] "TARGET_COLDFIRE" "* return output_move_qimode (operands);")(define_expand "movstrictqi" [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "")) (match_operand:QI 1 "general_src_operand" ""))] "" "")(define_insn "" [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+dm")) (match_operand:QI 1 "general_src_operand" "dmSn"))] "!TARGET_COLDFIRE" "* return output_move_strictqi (operands);")(define_insn "" [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d,m")) (match_operand:QI 1 "general_src_operand" "dmn,d"))] "TARGET_COLDFIRE" "* return output_move_strictqi (operands);")(define_expand "pushqi1" [(set (reg:SI SP_REG) (plus:SI (reg:SI SP_REG) (const_int -2))) (set (mem:QI (plus:SI (reg:SI SP_REG) (const_int 1))) (match_operand:QI 0 "general_operand" ""))] "!TARGET_COLDFIRE" "")(define_expand "movsf" [(set (match_operand:SF 0 "nonimmediate_operand" "") (match_operand:SF 1 "general_operand" ""))] "" "")(define_insn "" [(set (match_operand:SF 0 "nonimmediate_operand" "=rmf") (match_operand:SF 1 "general_operand" "rmfF"))] "!TARGET_COLDFIRE"{ if (FP_REG_P (operands[0])) { if (FP_REG_P (operands[1])) return "f%$move%.x %1,%0"; else if (ADDRESS_REG_P (operands[1])) return "move%.l %1,%-\;f%$move%.s %+,%0"; else if (GET_CODE (operands[1]) == CONST_DOUBLE) return output_move_const_single (operands); return "f%$move%.s %f1,%0"; } if (FP_REG_P (operands[1])) { if (ADDRESS_REG_P (operands[0])) return "fmove%.s %1,%-\;move%.l %+,%0"; return "fmove%.s %f1,%0"; } if (operands[1] == CONST0_RTX (SFmode) /* clr insns on 68000 read before writing. This isn't so on the 68010, but we have no TARGET_68010. */ && ((TARGET_68020 || TARGET_COLDFIRE) || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0])))) { if (ADDRESS_REG_P (operands[0])) { /* On the '040, 'subl an,an' takes 2 clocks while lea takes only 1 */ if (!TARGET_68040 && !TARGET_68060) return "sub%.l %0,%0"; else return MOTOROLA ? "lea 0.w,%0" : "lea 0:w,%0"; } /* moveq is faster on the 68000. */ if (DATA_REG_P (operands[0]) && !(TARGET_68020 || TARGET_COLDFIRE)) { return "moveq #0,%0"; } return "clr%.l %0"; } return "move%.l %1,%0";})(define_insn "" [(set (match_operand:SF 0 "nonimmediate_operand" "=r,g") (match_operand:SF 1 "general_operand" "g,r"))]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -