📄 m68k.md
字号:
}")(define_insn "tstsf_fpa" [(set (cc0) (match_operand:SF 0 "general_operand" "xmdF")) (clobber (match_scratch:SI 1 "=d"))] "TARGET_FPA" "fptst%.s %x0\;fpmove fpastatus,%1\;movw %1,cc")(define_insn "" [(set (cc0) (match_operand:SF 0 "general_operand" "fdm"))] "TARGET_68881" "*{ cc_status.flags = CC_IN_68881; if (FP_REG_P (operands[0])) return \"ftst%.x %0\"; return \"ftst%.s %0\";}")(define_expand "tstdf" [(set (cc0) (match_operand:DF 0 "general_operand" ""))] "TARGET_68881 || TARGET_FPA" "{ m68k_last_compare_had_fp_operands = 1; if (TARGET_FPA) { emit_insn (gen_tstsf_fpa (operands[0])); DONE; }}")(define_insn "tstdf_fpa" [(set (cc0) (match_operand:DF 0 "general_operand" "xrmF")) (clobber (match_scratch:SI 1 "=d"))] "TARGET_FPA" "fptst%.d %x0\;fpmove fpastatus,%1\;movw %1,cc")(define_insn "" [(set (cc0) (match_operand:DF 0 "general_operand" "fm"))] "TARGET_68881" "*{ cc_status.flags = CC_IN_68881; if (FP_REG_P (operands[0])) return \"ftst%.x %0\"; return \"ftst%.d %0\";}");; compare instructions.(define_expand "cmpdi" [(parallel [(set (cc0) (compare (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "general_operand" ""))) (clobber (match_dup 2))])] "" "m68k_last_compare_had_fp_operands = 0; operands[2] = gen_reg_rtx (DImode);")(define_insn "" [(set (cc0) (compare (match_operand:DI 1 "nonimmediate_operand" "0,d") (match_operand:DI 2 "general_operand" "d,0"))) (clobber (match_operand:DI 0 "register_operand" "=d,d"))] "" "*{ if (rtx_equal_p (operands[0], operands[1])) return \"sub%.l %R2,%R0\;subx%.l %2,%0\"; else { cc_status.flags |= CC_REVERSED; return \"sub%.l %R1,%R0\;subx%.l %1,%0\"; }}");; This is the second "hook" for PIC code (in addition to movsi). See;; comment of movsi for a description of PIC handling.(define_expand "cmpsi" [(set (cc0) (compare (match_operand:SI 0 "nonimmediate_operand" "") (match_operand:SI 1 "general_operand" "")))] "" "{ m68k_last_compare_had_fp_operands = 0; 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); }}");; A composite of the cmp, cmpa, cmpi & cmpm m68000 op codes.(define_insn "" [(set (cc0) (compare (match_operand:SI 0 "nonimmediate_operand" "rKT,rKs,mSr,mSa,>") (match_operand:SI 1 "general_src_operand" "mSr,mSa,KTr,Ksr,>")))] "!TARGET_5200" "*{ if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)#ifdef SGS_CMP_ORDER return \"cmpm%.l %0,%1\";#else return \"cmpm%.l %1,%0\";#endif if (REG_P (operands[1]) || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM)) { cc_status.flags |= CC_REVERSED;#ifdef SGS_CMP_ORDER return \"cmp%.l %d1,%d0\";#else return \"cmp%.l %d0,%d1\";#endif } if (ADDRESS_REG_P (operands[0]) && GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 0x8000 && INTVAL (operands[1]) >= -0x8000) {#ifdef SGS_CMP_ORDER return \"cmp%.w %0,%1\";#else return \"cmp%.w %1,%0\";#endif }#ifdef SGS_CMP_ORDER return \"cmp%.l %d0,%d1\";#else return \"cmp%.l %d1,%d0\";#endif}")(define_insn "" [(set (cc0) (compare (match_operand:SI 0 "nonimmediate_operand" "mrKs,r") (match_operand:SI 1 "general_operand" "r,mrKs")))] "TARGET_5200" "*{ if (REG_P (operands[1]) || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM)) { cc_status.flags |= CC_REVERSED;#ifdef SGS_CMP_ORDER return \"cmp%.l %d1,%d0\";#else return \"cmp%.l %d0,%d1\";#endif }#ifdef SGS_CMP_ORDER return \"cmp%.l %d0,%d1\";#else return \"cmp%.l %d1,%d0\";#endif}")(define_expand "cmphi" [(set (cc0) (compare (match_operand:HI 0 "nonimmediate_src_operand" "") (match_operand:HI 1 "general_src_operand" "")))] "!TARGET_5200" "m68k_last_compare_had_fp_operands = 0;")(define_insn "" [(set (cc0) (compare (match_operand:HI 0 "nonimmediate_src_operand" "rnmS,d,n,mS,>") (match_operand:HI 1 "general_src_operand" "d,rnmS,mS,n,>")))] "!TARGET_5200" "*{ if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)#ifdef SGS_CMP_ORDER return \"cmpm%.w %0,%1\";#else return \"cmpm%.w %1,%0\";#endif if ((REG_P (operands[1]) && !ADDRESS_REG_P (operands[1])) || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM)) { cc_status.flags |= CC_REVERSED;#ifdef SGS_CMP_ORDER return \"cmp%.w %d1,%d0\";#else return \"cmp%.w %d0,%d1\";#endif }#ifdef SGS_CMP_ORDER return \"cmp%.w %d0,%d1\";#else return \"cmp%.w %d1,%d0\";#endif}")(define_expand "cmpqi" [(set (cc0) (compare (match_operand:QI 0 "nonimmediate_src_operand" "") (match_operand:QI 1 "general_src_operand" "")))] "!TARGET_5200" "m68k_last_compare_had_fp_operands = 0;")(define_insn "" [(set (cc0) (compare (match_operand:QI 0 "nonimmediate_src_operand" "dn,dmS,>") (match_operand:QI 1 "general_src_operand" "dmS,nd,>")))] "!TARGET_5200" "*{ if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)#ifdef SGS_CMP_ORDER return \"cmpm%.b %0,%1\";#else return \"cmpm%.b %1,%0\";#endif if (REG_P (operands[1]) || (!REG_P (operands[0]) && GET_CODE (operands[0]) != MEM)) { cc_status.flags |= CC_REVERSED;#ifdef SGS_CMP_ORDER return \"cmp%.b %d1,%d0\";#else return \"cmp%.b %d0,%d1\";#endif }#ifdef SGS_CMP_ORDER 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" "{ m68k_last_compare_had_fp_operands = 1; if (TARGET_FPA) { emit_insn (gen_cmpdf_fpa (operands[0], operands[1])); DONE; }}")(define_insn "cmpdf_fpa" [(set (cc0) (compare (match_operand:DF 0 "general_operand" "x,y") (match_operand:DF 1 "general_operand" "xH,rmF"))) (clobber (match_scratch:SI 2 "=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 SGS_CMP_ORDER 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" "{ m68k_last_compare_had_fp_operands = 1; if (TARGET_FPA) { emit_insn (gen_cmpsf_fpa (operands[0], operands[1])); DONE; }}")(define_insn "cmpsf_fpa" [(set (cc0) (compare (match_operand:SF 0 "general_operand" "x,y") (match_operand:SF 1 "general_operand" "xH,rmF"))) (clobber (match_scratch:SI 2 "=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 SGS_CMP_ORDER 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.;; 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_5200" "* { 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_5200" "* { 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_5200" "*{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -