📄 m68k.md
字号:
[(set (match_operand:SI 0 "register_operand" "=d") (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "dmS")))] "" "#");; these two pattern split everything else which isn't matched by;; something else above(define_split [(set (match_operand 0 "register_operand" "") (zero_extend (match_operand 1 "nonimmediate_src_operand" "")))] "!TARGET_CFV4 && reload_completed && reg_mentioned_p (operands[0], operands[1])" [(set (strict_low_part (match_dup 2)) (match_dup 1)) (set (match_dup 0) (match_op_dup 4 [(match_dup 0) (match_dup 3)]))]{ operands[2] = gen_lowpart (GET_MODE (operands[1]), operands[0]); operands[3] = GEN_INT (GET_MODE_MASK (GET_MODE (operands[1]))); operands[4] = gen_rtx_AND (GET_MODE (operands[0]), operands[0], operands[3]);})(define_split [(set (match_operand 0 "register_operand" "") (zero_extend (match_operand 1 "nonimmediate_src_operand" "")))] "!TARGET_CFV4 && reload_completed" [(set (match_dup 0) (const_int 0)) (set (strict_low_part (match_dup 2)) (match_dup 1))]{ operands[2] = gen_lowpart (GET_MODE (operands[1]), operands[0]);});; sign extension instructions(define_insn "extendqidi2" [(set (match_operand:DI 0 "nonimmediate_operand" "=d") (sign_extend:DI (match_operand:QI 1 "general_src_operand" "rmS")))] ""{ CC_STATUS_INIT; operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (TARGET_CFV4) return "mvs%.b %1,%2\;smi %0\;extb%.l %0"; if (TARGET_68020 || TARGET_COLDFIRE) return "move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0"; else return "move%.b %1,%2\;ext%.w %0\;ext%.l %2\;move%.l %2,%0\;smi %0";})(define_insn "extendhidi2" [(set (match_operand:DI 0 "nonimmediate_operand" "=d") (sign_extend:DI (match_operand:HI 1 "general_src_operand" "rmS")))] ""{ CC_STATUS_INIT; operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (TARGET_CFV4) return "mvs%.w %1,%2\;smi %0\;extb%.l %0"; if (TARGET_68020 || TARGET_COLDFIRE) return "move%.w %1,%2\;ext%.l %2\;smi %0\;extb%.l %0"; else return "move%.w %1,%2\;ext%.l %2\;smi %0\;ext%.w %0\;ext%.l %0";})(define_insn "extendsidi2" [(set (match_operand:DI 0 "nonimmediate_operand" "=d") (sign_extend:DI (match_operand:SI 1 "general_operand" "rm")))] ""{ CC_STATUS_INIT; operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (TARGET_68020 || TARGET_COLDFIRE) return "move%.l %1,%2\;smi %0\;extb%.l %0"; else return "move%.l %1,%2\;smi %0\;ext%.w %0\;ext%.l %0";});; Special case when one can avoid register clobbering, copy and test;; Maybe there is a way to make that the general case, by forcing the;; result of the SI tree to be in the lower register of the DI target(define_insn "extendplussidi" [(set (match_operand:DI 0 "register_operand" "=d") (sign_extend:DI (plus:SI (match_operand:SI 1 "general_operand" "%rmn") (match_operand:SI 2 "general_operand" "rmn"))))] ""{ CC_STATUS_INIT; operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (GET_CODE (operands[1]) == CONST_INT && (unsigned) INTVAL (operands[1]) > 8) { rtx tmp = operands[1]; operands[1] = operands[2]; operands[2] = tmp; } if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == REGNO (operands[3])) output_asm_insn ("add%.l %2,%3", operands); else output_asm_insn ("move%.l %2,%3\;add%.l %1,%3", operands); if (TARGET_68020 || TARGET_COLDFIRE) return "smi %0\;extb%.l %0"; else return "smi %0\;ext%.w %0\;ext%.l %0";})(define_expand "extendhisi2" [(set (match_operand:SI 0 "nonimmediate_operand" "") (sign_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "")))] "" "")(define_insn "*cfv4_extendhisi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=d") (sign_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "rmS")))] "TARGET_CFV4" "mvs%.w %1,%0")(define_insn "*68k_extendhisi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,a") (sign_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "0,rmS")))] "!TARGET_CFV4"{ if (ADDRESS_REG_P (operands[0])) return "move%.w %1,%0"; return "ext%.l %0";})(define_insn "extendqihi2" [(set (match_operand:HI 0 "nonimmediate_operand" "=d") (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0")))] "" "ext%.w %0")(define_expand "extendqisi2" [(set (match_operand:SI 0 "nonimmediate_operand" "") (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))] "TARGET_68020 || TARGET_COLDFIRE" "")(define_insn "*cfv4_extendqisi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=d") (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "rms")))] "TARGET_CFV4" "mvs%.b %1,%0")(define_insn "*68k_extendqisi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=d") (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0")))] "TARGET_68020 || (TARGET_COLDFIRE && !TARGET_CFV4)" "extb%.l %0");; Conversions between float and double.(define_expand "extendsfdf2" [(set (match_operand:DF 0 "nonimmediate_operand" "") (float_extend:DF (match_operand:SF 1 "general_operand" "")))] "TARGET_68881" "")(define_insn "" [(set (match_operand:DF 0 "nonimmediate_operand" "=*fdm,f") (float_extend:DF (match_operand:SF 1 "general_operand" "f,dmF")))] "TARGET_68881"{ if (FP_REG_P (operands[0]) && FP_REG_P (operands[1])) { if (REGNO (operands[0]) == REGNO (operands[1])) { /* Extending float to double in an fp-reg is a no-op. NOTICE_UPDATE_CC has already assumed that the cc will be set. So cancel what it did. */ cc_status = cc_prev_status; return ""; } return "f%&move%.x %1,%0"; } if (FP_REG_P (operands[0])) return "f%&move%.s %f1,%0"; if (DATA_REG_P (operands[0]) && FP_REG_P (operands[1])) { output_asm_insn ("fmove%.d %f1,%-\;move%.l %+,%0", operands); operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); return "move%.l %+,%0"; } return "fmove%.d %f1,%0";});; This cannot output into an f-reg because there is no way to be;; sure of truncating in that case.(define_expand "truncdfsf2" [(set (match_operand:SF 0 "nonimmediate_operand" "") (float_truncate:SF (match_operand:DF 1 "general_operand" "")))] "TARGET_68881" "");; On the '040 we can truncate in a register accurately and easily.(define_insn "" [(set (match_operand:SF 0 "nonimmediate_operand" "=f") (float_truncate:SF (match_operand:DF 1 "general_operand" "fmG")))] "TARGET_68881 && TARGET_68040_ONLY"{ if (FP_REG_P (operands[1])) return "f%$move%.x %1,%0"; return "f%$move%.d %f1,%0";})(define_insn "" [(set (match_operand:SF 0 "nonimmediate_operand" "=dm") (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))] "TARGET_68881" "fmove%.s %f1,%0");; Conversion between fixed point and floating point.;; Note that among the fix-to-float insns;; the ones that start with SImode come first.;; That is so that an operand that is a CONST_INT;; (and therefore lacks a specific machine mode).;; will be recognized as SImode (which is always valid);; rather than as QImode or HImode.(define_expand "floatsisf2" [(set (match_operand:SF 0 "nonimmediate_operand" "") (float:SF (match_operand:SI 1 "general_operand" "")))] "TARGET_68881" "")(define_insn "" [(set (match_operand:SF 0 "nonimmediate_operand" "=f") (float:SF (match_operand:SI 1 "general_operand" "dmi")))] "TARGET_68881" "f%$move%.l %1,%0")(define_expand "floatsidf2" [(set (match_operand:DF 0 "nonimmediate_operand" "") (float:DF (match_operand:SI 1 "general_operand" "")))] "TARGET_68881" "")(define_insn "" [(set (match_operand:DF 0 "nonimmediate_operand" "=f") (float:DF (match_operand:SI 1 "general_operand" "dmi")))] "TARGET_68881" "f%&move%.l %1,%0")(define_insn "floathisf2" [(set (match_operand:SF 0 "nonimmediate_operand" "=f") (float:SF (match_operand:HI 1 "general_operand" "dmn")))] "TARGET_68881" "f%$move%.w %1,%0")(define_insn "floathidf2" [(set (match_operand:DF 0 "nonimmediate_operand" "=f") (float:DF (match_operand:HI 1 "general_operand" "dmn")))] "TARGET_68881" "fmove%.w %1,%0")(define_insn "floatqisf2" [(set (match_operand:SF 0 "nonimmediate_operand" "=f") (float:SF (match_operand:QI 1 "general_operand" "dmn")))] "TARGET_68881" "fmove%.b %1,%0")(define_insn "floatqidf2" [(set (match_operand:DF 0 "nonimmediate_operand" "=f") (float:DF (match_operand:QI 1 "general_operand" "dmn")))] "TARGET_68881" "f%&move%.b %1,%0");; New routines to convert floating-point values to integers;; to be used on the '040. These should be faster than trapping;; into the kernel to emulate fintrz. They should also be faster;; than calling the subroutines fixsfsi or fixdfsi.(define_insn "fix_truncdfsi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=dm") (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f")))) (clobber (match_scratch:SI 2 "=d")) (clobber (match_scratch:SI 3 "=d"))] "TARGET_68881 && TARGET_68040"{ CC_STATUS_INIT; return "fmovem%.l %!,%2\;moveq #16,%3\;or%.l %2,%3\;and%.w #-33,%3\;fmovem%.l %3,%!\;fmove%.l %1,%0\;fmovem%.l %2,%!";})(define_insn "fix_truncdfhi2" [(set (match_operand:HI 0 "nonimmediate_operand" "=dm") (fix:HI (fix:DF (match_operand:DF 1 "register_operand" "f")))) (clobber (match_scratch:SI 2 "=d")) (clobber (match_scratch:SI 3 "=d"))] "TARGET_68881 && TARGET_68040"{ CC_STATUS_INIT; return "fmovem%.l %!,%2\;moveq #16,%3\;or%.l %2,%3\;and%.w #-33,%3\;fmovem%.l %3,%!\;fmove%.w %1,%0\;fmovem%.l %2,%!";})(define_insn "fix_truncdfqi2" [(set (match_operand:QI 0 "nonimmediate_operand" "=dm") (fix:QI (fix:DF (match_operand:DF 1 "register_operand" "f")))) (clobber (match_scratch:SI 2 "=d")) (clobber (match_scratch:SI 3 "=d"))] "TARGET_68881 && TARGET_68040"{ CC_STATUS_INIT; return "fmovem%.l %!,%2\;moveq #16,%3\;or%.l %2,%3\;and%.w #-33,%3\;fmovem%.l %3,%!\;fmove%.b %1,%0\;fmovem%.l %2,%!";});; Convert a float to a float whose value is an integer.;; This is the first stage of converting it to an integer type.(define_insn "ftruncdf2" [(set (match_operand:DF 0 "nonimmediate_operand" "=f") (fix:DF (match_operand:DF 1 "general_operand" "fFm")))] "TARGET_68881 && !TARGET_68040"{ if (FP_REG_P (operands[1])) return "fintrz%.x %f1,%0"; return "fintrz%.d %f1,%0";})(define_insn "ftruncsf2" [(set (match_operand:SF 0 "nonimmediate_operand" "=f") (fix:SF (match_operand:SF 1 "general_operand" "dfFm")))] "TARGET_68881 && !TARGET_68040"{ if (FP_REG_P (operands[1])) return "fintrz%.x %f1,%0"; return "fintrz%.s %f1,%0";});; Convert a float whose value is an integer;; to an actual integer. Second stage of converting float to integer type.(define_insn "fixsfqi2" [(set (match_operand:QI 0 "nonimmediate_operand" "=dm") (fix:QI (match_operand:SF 1 "general_operand" "f")))] "TARGET_68881" "fmove%.b %1,%0")(define_insn "fixsfhi2" [(set (match_operand:HI 0 "nonimmediate_operand" "=dm") (fix:HI (match_operand:SF 1 "general_operand" "f")))] "TARGET_68881" "fmove%.w %1,%0")(define_insn "fixsfsi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=dm") (fix:SI (match_operand:SF 1 "general_operand" "f")))] "TARGET_68881" "fmove%.l %1,%0")(define_insn "fixdfqi2" [(set (match_operand:QI 0 "nonimmediate_operand" "=dm") (fix:QI (match_operand:DF 1 "general_operand" "f")))] "TARGET_68881" "fmove%.b %1,%0")(define_insn "fixdfhi2" [(set (match_operand:HI 0 "nonimmediate_operand" "=dm") (fix:HI (match_operand:DF 1 "general_operand" "f")))] "TARGET_68881" "fmove%.w %1,%0")(define_insn "fixdfsi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=dm") (fix:SI (match_operand:DF 1 "general_operand" "f")))] "TARGET_68881" "fmove%.l %1,%0");; add instructions(define_insn "adddi_lshrdi_63" [(set (match_operand:DI 0 "nonimmediate_operand" "=d") (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "rm") (const_int 63)) (match_dup 1))) (clobber (match_scratch:SI 2 "=d"))] ""{ operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); if (REG_P (operands[1]) && REGNO (operands[1]) == REGNO (operands[0])) return "move%.l %1,%2\;add%.l %2,%2\;subx%.l %2,%2\;sub%.l %2,%3\;subx%.l %2,%0"; if (GET_CODE (operands[1]) == REG) operands[4] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1); else if (GET_CODE (XEXP (operands[1], 0)) == POST_INC || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC) operands[4] = operands[1]; else operands[4] = adjust_address (operands[1], SImode, 4); if (GET_CODE (operands[1]) == MEM && GET_CODE (XEXP (operands[1], 0)) == PRE_DEC) output_asm_insn ("move%.l %4,%3", operands); output_asm_insn ("move%.l %1,%0\;smi %2", operands); if (TARGET_68020 || TARGET_COLDFIRE) output_asm_insn ("extb%.l %2", operands); else output_asm_insn ("ext%.w %2\;ext%.l %2", operands); if (GET_CODE (operands[1]) != MEM || GET_CODE (XEXP (operands[1], 0)) != PRE_DEC) output_asm_insn ("move%.l %4,%3", operands); return "sub%.l %2,%3\;subx%.l %2,%0";})(define_insn "adddi_sexthishl32" [(set (match_operand:DI 0 "nonimmediate_operand" "=o,a,*d,*d")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -