📄 m68k.md
字号:
}#ifdef HPUX_ASM return \"cmp%.b %d0,%d1\";#else return \"cmp%.b %d1,%d0\";#endif}")(define_expand "cmpdf" [(set (cc0) (compare (match_operand:DF 0 "general_operand" "") (match_operand:DF 1 "general_operand" "")))] "TARGET_68881 || TARGET_FPA" "{ if (TARGET_FPA) { rtx set = gen_rtx (SET, VOIDmode, cc0_rtx, gen_rtx (COMPARE, VOIDmode, operands[0], operands[1])); emit_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2, set, gen_rtx (CLOBBER, VOIDmode, gen_reg_rtx (SImode))))); DONE; }}")(define_insn "" [(set (cc0) (compare (match_operand:DF 0 "general_operand" "x,y") (match_operand:DF 1 "general_operand" "xH,rmF"))) (clobber (match_operand:SI 2 "general_operand" "d,d"))] "TARGET_FPA" "fpcmp%.d %y1,%0\;fpmove fpastatus,%2\;movw %2,cc")(define_insn "" [(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;#ifdef HPUX_ASM if (REG_P (operands[0])) { if (REG_P (operands[1])) return \"fcmp%.x %0,%1\"; else return \"fcmp%.d %0,%f1\"; } cc_status.flags |= CC_REVERSED; return \"fcmp%.d %1,%f0\";#else 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\";#endif}")(define_expand "cmpsf" [(set (cc0) (compare (match_operand:SF 0 "general_operand" "") (match_operand:SF 1 "general_operand" "")))] "TARGET_68881 || TARGET_FPA" "{ if (TARGET_FPA) { rtx set = gen_rtx (SET, VOIDmode, cc0_rtx, gen_rtx (COMPARE, VOIDmode, operands[0], operands[1])); emit_insn (gen_rtx (PARALLEL, VOIDmode, gen_rtvec (2, set, gen_rtx (CLOBBER, VOIDmode, gen_reg_rtx(SImode))))); DONE; }}")(define_insn "" [(set (cc0) (compare (match_operand:SF 0 "general_operand" "x,y") (match_operand:SF 1 "general_operand" "xH,rmF"))) (clobber (match_operand:SI 2 "general_operand" "d,d"))] "TARGET_FPA" "fpcmp%.s %w1,%x0\;fpmove fpastatus,%2\;movw %2,cc")(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;#ifdef HPUX_ASM if (FP_REG_P (operands[0])) { if (FP_REG_P (operands[1])) return \"fcmp%.x %0,%1\"; else return \"fcmp%.s %0,%f1\"; } cc_status.flags |= CC_REVERSED; return \"fcmp%.s %1,%f0\";#else 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\";#endif}");; Recognizers for btst instructions.(define_insn "" [(set (cc0) (zero_extract (match_operand:QI 0 "nonimmediate_operand" "do") (const_int 1) (minus:SI (const_int 7) (match_operand:SI 1 "general_operand" "di"))))] "" "* { return output_btst (operands, operands[1], operands[0], insn, 7); }")(define_insn "" [(set (cc0) (zero_extract (match_operand:SI 0 "nonimmediate_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 "nonimmediate_operand" "do") (const_int 1) (minus:SI (const_int 7) (and:SI (match_operand:SI 1 "general_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 "nonimmediate_operand" "d") (const_int 1) (minus:SI (const_int 31) (and:SI (match_operand:SI 1 "general_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 "nonimmediate_operand" "md") (const_int 1) (match_operand:SI 1 "general_operand" "i")))] "GET_CODE (operands[1]) == CONST_INT && (unsigned) INTVAL (operands[1]) < 8" "*{ operands[1] = gen_rtx (CONST_INT, VOIDmode, 7 - INTVAL (operands[1])); return output_btst (operands, operands[1], operands[0], insn, 7);}")(define_insn "" ;; The constraint "o,d" here means that a nonoffsettable memref ;; will match the first alternative, and its address will be reloaded. ;; Copying the memory contents into a reg would be incorrect if the ;; bit position is over 7. [(set (cc0) (zero_extract (match_operand:HI 0 "nonimmediate_operand" "o,d") (const_int 1) (match_operand:SI 1 "general_operand" "i,i")))] "GET_CODE (operands[1]) == CONST_INT" "*{ if (GET_CODE (operands[0]) == MEM) { operands[0] = adj_offsettable_operand (operands[0], INTVAL (operands[1]) / 8); operands[1] = gen_rtx (CONST_INT, VOIDmode, 7 - INTVAL (operands[1]) % 8); return output_btst (operands, operands[1], operands[0], insn, 7); } operands[1] = gen_rtx (CONST_INT, VOIDmode, 15 - INTVAL (operands[1])); return output_btst (operands, operands[1], operands[0], insn, 15);}")(define_insn "" [(set (cc0) (zero_extract (match_operand:SI 0 "nonimmediate_operand" "do") (const_int 1) (match_operand:SI 1 "general_operand" "i")))] "GET_CODE (operands[1]) == CONST_INT" "*{ if (GET_CODE (operands[0]) == MEM) { operands[0] = adj_offsettable_operand (operands[0], INTVAL (operands[1]) / 8); operands[1] = gen_rtx (CONST_INT, VOIDmode, 7 - INTVAL (operands[1]) % 8); return output_btst (operands, operands[1], operands[0], insn, 7); } operands[1] = gen_rtx (CONST_INT, VOIDmode, 31 - INTVAL (operands[1])); return output_btst (operands, operands[1], operands[0], insn, 31);}")(define_insn "" [(set (cc0) (subreg:SI (lshiftrt:QI (match_operand:QI 0 "nonimmediate_operand" "dm") (const_int 7)) 0))] "" "*{ cc_status.flags = CC_Z_IN_NOT_N | CC_NOT_NEGATIVE; return \"tst%.b %0\";}")(define_insn "" [(set (cc0) (and:SI (sign_extend:SI (sign_extend:HI (match_operand:QI 0 "nonimmediate_operand" "dm"))) (match_operand:SI 1 "general_operand" "i")))] "(GET_CODE (operands[1]) == CONST_INT && (unsigned) INTVAL (operands[1]) < 0x100 && exact_log2 (INTVAL (operands[1])) >= 0)" "*{ register int log = exact_log2 (INTVAL (operands[1])); operands[1] = gen_rtx (CONST_INT, VOIDmode, log); return output_btst (operands, operands[1], operands[0], insn, 7);}");; move instructions;; A special case in which it is not desirable;; to reload the constant into a data register.(define_insn "" [(set (match_operand:SI 0 "push_operand" "=m") (match_operand:SI 1 "general_operand" "J"))] "GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) >= -0x8000 && INTVAL (operands[1]) < 0x8000" "*{ if (operands[1] == const0_rtx) return \"clr%.l %0\"; return \"pea %a1\";}");This is never used.;(define_insn "swapsi"; [(set (match_operand:SI 0 "general_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 "" [(set (match_operand:SI 0 "general_operand" "=g") (const_int 0))] ;; clr insns on 68000 read before writing. ;; This isn't so on the 68010, but we have no alternative for it. "(TARGET_68020 || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0])))" "*{ if (ADDRESS_REG_P (operands[0])) return \"sub%.l %0,%0\"; /* moveq is faster on the 68000. */ if (DATA_REG_P (operands[0]) && !TARGET_68020)#ifdef MOTOROLA return \"moveq%.l %#0,%0\";#else return \"moveq %#0,%0\";#endif return \"clr%.l %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 "movsi" ;; Notes: make sure no alternative allows g vs g. ;; We don't allow f-regs since fixed point cannot go in them. ;; We do allow y and x regs since fixed point is allowed in them. [(set (match_operand:SI 0 "general_operand" "=g,da,y,!*x*r*m") (match_operand:SI 1 "general_operand" "daymKs,i,g,*x*r*m"))] "" "*{ if (which_alternative == 3) return \"fpmove%.l %x1,fpa0\;fpmove%.l fpa0,%x0\"; if (FPA_REG_P (operands[1]) || FPA_REG_P (operands[0])) return \"fpmove%.l %x1,%x0\"; if (GET_CODE (operands[1]) == CONST_INT) { if (operands[1] == const0_rtx && (DATA_REG_P (operands[0]) || GET_CODE (operands[0]) == MEM) /* clr insns on 68000 read before writing. This isn't so on the 68010, but we have no alternative for it. */ && (TARGET_68020 || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0])))) return \"clr%.l %0\"; else if (DATA_REG_P (operands[0]) && INTVAL (operands[1]) < 128 && INTVAL (operands[1]) >= -128) {#ifdef MOTOROLA return \"moveq%.l %1,%0\";#else return \"moveq %1,%0\";#endif } else if (ADDRESS_REG_P (operands[0]) && INTVAL (operands[1]) < 0x8000 && INTVAL (operands[1]) >= -0x8000) return \"move%.w %1,%0\"; else if (push_operand (operands[0], SImode) && INTVAL (operands[1]) < 0x8000 && INTVAL (operands[1]) >= -0x8000) return \"pea %a1\"; } else if ((GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST) && push_operand (operands[0], SImode)) return \"pea %a1\"; else if ((GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST) && ADDRESS_REG_P (operands[0])) return \"lea %a1,%0\"; return \"move%.l %1,%0\";}")(define_insn "movhi" [(set (match_operand:HI 0 "general_operand" "=g") (match_operand:HI 1 "general_operand" "g"))] "" "*{ if (GET_CODE (operands[1]) == CONST_INT) { if (operands[1] == const0_rtx && (DATA_REG_P (operands[0]) || GET_CODE (operands[0]) == MEM) /* clr insns on 68000 read before writing. This isn't so on the 68010, but we have no alternative for it. */ && (TARGET_68020 || !(GET_CODE (operands[0]) == MEM && MEM_VOLATILE_P (operands[0])))) return \"clr%.w %0\"; else if (DATA_REG_P (operands[0]) && INTVAL (operands[1]) < 128 && INTVAL (operands[1]) >= -128) {#ifdef MOTOROLA return \"moveq%.l %1,%0\";#else return \"moveq %1,%0\";#endif } else if (INTVAL (operands[1]) < 0x8000 && INTVAL (operands[1]) >= -0x8000) return \"move%.w %1,%0\"; } else if (CONSTANT_P (operands[1])) return \"move%.l %1,%0\";#ifndef SONY_ASM /* Recognize the insn before a tablejump, one that refers to a table of offsets. Such an insn will need to refer to a label on the insn. So output one. Use the label-number of the table of offsets to generate this label. */ if (GET_CODE (operands[1]) == MEM && GET_CODE (XEXP (operands[1], 0)) == PLUS && (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF || GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == LABEL_REF) && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) != PLUS && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) != PLUS) { rtx labelref; if (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF) labelref = XEXP (XEXP (operands[1], 0), 0); else labelref = XEXP (XEXP (operands[1], 0), 1);#if defined (MOTOROLA) && ! defined (SGS_3B1)#ifdef SGS fprintf (asm_out_file, \"\\tset %s%d,.+2\\n\", \"LI\", CODE_LABEL_NUMBER (XEXP (labelref, 0)));#else /* not SGS */ fprintf (asm_out_file, \"\\t.set %s%d,.+2\\n\", \"LI\", CODE_LABEL_NUMBER (XEXP (labelref, 0)));#endif /* not SGS */#else /* SGS_3B1 or not MOTOROLA */ ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"LI\", CODE_LABEL_NUMBER (XEXP (labelref, 0))); /* For sake of 3b1, set flag saying we need to define the symbol LD%n (with value L%n-LI%n) at the end of the switch table. */ RTX_INTEGRATED_P (next_real_insn (XEXP (labelref, 0))) = 1;#endif /* SGS_3B1 or not MOTOROLA */ }#endif /* SONY_ASM */ return \"move%.w %1,%0\";}")(define_insn "movstricthi" [(set (strict_low_part (match_operand:HI 0 "general_operand" "+dm")) (match_operand:HI 1 "general_operand" "rmn"))] "" "*{ if (GET_CODE (operands[1]) == CONST_INT) { if (operands[1] == const0_rtx && (DATA_REG_P (operands[0]) || GET_CODE (operands[0]) == MEM) /* clr insns on 68000 read before writing. This isn't so on the 68010, but we have no alternative for it. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -