📄 m68k.md
字号:
[(set (match_operand:HI 0 "nonimmediate_operand" "=do<>,d") (zero_extend:HI (match_operand:QI 1 "nonimmediate_src_operand" "d,mS")))] "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" "*{ if (DATA_REG_P (operands[0])) { if (GET_CODE (operands[1]) == REG && REGNO (operands[0]) == REGNO (operands[1])) return (!TARGET_5200 ? \"and%.w %#0xFF,%0\" : \"and%.l %#0xFF,%0\"); if (reg_mentioned_p (operands[0], operands[1])) return (!TARGET_5200 ? \"move%.b %1,%0\;and%.w %#0xFF,%0\" : \"move%.b %1,%0\;and%.l %#0xFF,%0\"); return \"clr%.w %0\;move%.b %1,%0\"; } else if (GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) { if (REGNO (XEXP (XEXP (operands[0], 0), 0)) == STACK_POINTER_REGNUM) { output_asm_insn (\"clr%.w %-\", operands); operands[0] = gen_rtx_MEM (GET_MODE (operands[0]), plus_constant (stack_pointer_rtx, 1)); return \"move%.b %1,%0\"; } else return \"move%.b %1,%0\;clr%.b %0\"; } else if (GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == POST_INC) return \"clr%.b %0\;move%.b %1,%0\"; else { output_asm_insn (\"clr%.b %0\", operands); operands[0] = adjust_address (operands[0], QImode, 1); return \"move%.b %1,%0\"; }}")(define_insn "" [(set (match_operand:SI 0 "nonimmediate_operand" "=do<>,d") (zero_extend:SI (match_operand:QI 1 "nonimmediate_src_operand" "d,mS")))] "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" "*{ if (DATA_REG_P (operands[0])) { if (GET_CODE (operands[1]) == REG && REGNO (operands[0]) == REGNO (operands[1])) return \"and%.l %#0xFF,%0\"; if (reg_mentioned_p (operands[0], operands[1])) return \"move%.b %1,%0\;and%.l %#0xFF,%0\"; return \"clr%.l %0\;move%.b %1,%0\"; } else if (GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC) { operands[0] = XEXP (XEXP (operands[0], 0), 0);#ifdef MOTOROLA#ifdef SGS return \"clr%.l -(%0)\;move%.b %1,3(%0)\";#else return \"clr%.l -(%0)\;move%.b %1,(3,%0)\";#endif#else return \"clrl %0@-\;moveb %1,%0@(3)\";#endif } else if (GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == POST_INC) { operands[0] = XEXP (XEXP (operands[0], 0), 0);#ifdef MOTOROLA#ifdef SGS return \"clr%.l (%0)+\;move%.b %1,-1(%0)\";#else return \"clr%.l (%0)+\;move%.b %1,(-1,%0)\";#endif#else return \"clrl %0@+\;moveb %1,%0@(-1)\";#endif } else { output_asm_insn (\"clr%.l %0\", operands); operands[0] = adjust_address (operands[0], QImode, 3); return \"move%.b %1,%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_68020 || TARGET_5200) 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_68020 || TARGET_5200) 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_5200) 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_5200) return \"smi %0\;extb%.l %0\"; else return \"smi %0\;ext%.w %0\;ext%.l %0\";}")(define_insn "extendhisi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,a") (sign_extend:SI (match_operand:HI 1 "nonimmediate_src_operand" "0,rmS")))] "" "*{ 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_insn "extendqisi2" [(set (match_operand:SI 0 "nonimmediate_operand" "=d") (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0")))] "TARGET_68020 || TARGET_5200" "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 || TARGET_FPA" "")(define_insn "" [(set (match_operand:DF 0 "nonimmediate_operand" "=x,y") (float_extend:DF (match_operand:SF 1 "general_operand" "xH,rmF")))] "TARGET_FPA" "fpstod %w1,%0")(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.;; But on the Sun FPA, we can be sure.(define_expand "truncdfsf2" [(set (match_operand:SF 0 "nonimmediate_operand" "") (float_truncate:SF (match_operand:DF 1 "general_operand" "")))] "TARGET_68881 || TARGET_FPA" "")(define_insn "" [(set (match_operand:SF 0 "nonimmediate_operand" "=x,y") (float_truncate:SF (match_operand:DF 1 "general_operand" "xH,rmF")))] "TARGET_FPA" "fpdtos %y1,%0");; 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_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 || TARGET_FPA" "")(define_insn "" [(set (match_operand:SF 0 "nonimmediate_operand" "=y,x") (float:SF (match_operand:SI 1 "general_operand" "rmi,x")))] "TARGET_FPA" "fpltos %1,%0")(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 || TARGET_FPA" "")(define_insn "" [(set (match_operand:DF 0 "nonimmediate_operand" "=y,x") (float:DF (match_operand:SI 1 "general_operand" "rmi,x")))] "TARGET_FPA" "fpltod %1,%0")(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 a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -