⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m68k.md

📁 早期freebsd实现
💻 MD
📖 第 1 页 / 共 5 页
字号:
  "fmove%.w %1,%0")(define_insn "fixsfsi2"  [(set (match_operand:SI 0 "general_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 "general_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 "general_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 "general_operand" "=dm")	(fix:SI (match_operand:DF 1 "general_operand" "f")))]  "TARGET_68881"  "fmove%.l %1,%0");; Convert a float to an integer.;; On the Sun FPA, this is done in one step.(define_insn ""  [(set (match_operand:SI 0 "general_operand" "=x,y")	(fix:SI (fix:SF (match_operand:SF 1 "general_operand" "xH,rmF"))))]  "TARGET_FPA"  "fpstol %w1,%0")(define_insn ""  [(set (match_operand:SI 0 "general_operand" "=x,y")	(fix:SI (fix:DF (match_operand:DF 1 "general_operand" "xH,rmF"))))]  "TARGET_FPA"  "fpdtol %y1,%0");; add instructions;; Note that the middle two alternatives are near-duplicates;; in order to handle insns generated by reload.;; This is needed since they are not themselves reloaded,;; so commutativity won't apply to them.(define_insn "addsi3"  [(set (match_operand:SI 0 "general_operand" "=m,?a,?a,r")	(plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0")		 (match_operand:SI 2 "general_operand" "dIKLs,rJK,a,mrIKLs")))]  ""  "*{  if (! operands_match_p (operands[0], operands[1]))    {      if (!ADDRESS_REG_P (operands[1]))	{	  rtx tmp = operands[1];	  operands[1] = operands[2];	  operands[2] = tmp;	}      /* These insns can result from reloads to access	 stack slots over 64k from the frame pointer.  */      if (GET_CODE (operands[2]) == CONST_INT	  && INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000)        return \"move%.l %2,%0\;add%.l %1,%0\";#ifdef SGS      if (GET_CODE (operands[2]) == REG)	return \"lea 0(%1,%2.l),%0\";      else	return \"lea %c2(%1),%0\";#else /* not SGS */#ifdef MOTOROLA      if (GET_CODE (operands[2]) == REG)	return \"lea (%1,%2.l),%0\";      else	return \"lea (%c2,%1),%0\";#else /* not MOTOROLA (MIT syntax) */      if (GET_CODE (operands[2]) == REG)	return \"lea %1@(0,%2:l),%0\";      else	return \"lea %1@(%c2),%0\";#endif /* not MOTOROLA */#endif /* not SGS */    }  if (GET_CODE (operands[2]) == CONST_INT)    {#ifndef NO_ADDSUB_Q      if (INTVAL (operands[2]) > 0	  && INTVAL (operands[2]) <= 8)	return (ADDRESS_REG_P (operands[0])		? \"addq%.w %2,%0\"		: \"addq%.l %2,%0\");      if (INTVAL (operands[2]) < 0	  && INTVAL (operands[2]) >= -8)        {	  operands[2] = gen_rtx (CONST_INT, VOIDmode,			         - INTVAL (operands[2]));	  return (ADDRESS_REG_P (operands[0])		  ? \"subq%.w %2,%0\"		  : \"subq%.l %2,%0\");	}      /* On everything except the 68000 it is faster to use two	 addqw instructions to add a small integer (8 < N <= 16)	 to an address register.  Likewise for subqw.*/      if (INTVAL (operands[2]) > 8	  && INTVAL (operands[2]) <= 16	  && ADDRESS_REG_P (operands[0])	  && TARGET_68020) 	{	  operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 8);	  return \"addq%.w %#8,%0\;addq%.w %2,%0\";	}      if (INTVAL (operands[2]) < -8	  && INTVAL (operands[2]) >= -16	  && ADDRESS_REG_P (operands[0])	  && TARGET_68020) 	{	  operands[2] = gen_rtx (CONST_INT, VOIDmode, 				  - INTVAL (operands[2]) - 8);	  return \"subq%.w %#8,%0\;subq%.w %2,%0\";	}#endif      if (ADDRESS_REG_P (operands[0])	  && INTVAL (operands[2]) >= -0x8000	  && INTVAL (operands[2]) < 0x8000)	return \"add%.w %2,%0\";    }  return \"add%.l %2,%0\";}")(define_insn ""  [(set (match_operand:SI 0 "general_operand" "=a")	(plus:SI (match_operand:SI 1 "general_operand" "0")		 (sign_extend:SI		  (match_operand:HI 2 "nonimmediate_operand" "rm"))))]  ""  "add%.w %2,%0")(define_insn "addhi3"  [(set (match_operand:HI 0 "general_operand" "=m,r")	(plus:HI (match_operand:HI 1 "general_operand" "%0,0")		 (match_operand:HI 2 "general_operand" "dn,rmn")))]  ""  "*{#ifndef NO_ADDSUB_Q  if (GET_CODE (operands[2]) == CONST_INT)    {      /* If the constant would be a negative number when interpreted as	 HImode, make it negative.  This is usually, but not always, done	 elsewhere in the compiler.  First check for constants out of range,	 which could confuse us.  */      if (INTVAL (operands[2]) >= 32768)	operands[2] = gen_rtx (CONST_INT, VOIDmode,			       INTVAL (operands[2]) - 65536);      if (INTVAL (operands[2]) > 0	  && INTVAL (operands[2]) <= 8)	return \"addq%.w %2,%0\";      if (INTVAL (operands[2]) < 0	  && INTVAL (operands[2]) >= -8)	{	  operands[2] = gen_rtx (CONST_INT, VOIDmode,			         - INTVAL (operands[2]));	  return \"subq%.w %2,%0\";	}      /* On everything except the 68000 it is faster to use two	 addqw instructions to add a small integer (8 < N <= 16)	 to an address register.  Likewise for subqw. */      if (INTVAL (operands[2]) > 8	  && INTVAL (operands[2]) <= 16	  && ADDRESS_REG_P (operands[0])	  && TARGET_68020) 	{	  operands[2] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) - 8);	  return \"addq%.w %#8,%0\;addq%.w %2,%0\";	}      if (INTVAL (operands[2]) < -8	  && INTVAL (operands[2]) >= -16	  && ADDRESS_REG_P (operands[0])	  && TARGET_68020) 	{	  operands[2] = gen_rtx (CONST_INT, VOIDmode, 				 - INTVAL (operands[2]) - 8);	  return \"subq%.w %#8,%0\;subq%.w %2,%0\";	}    }#endif  return \"add%.w %2,%0\";}");; These insns must use MATCH_DUP instead of the more expected;; use of a matching constraint because the "output" here is also;; an input, so you can't use the matching constraint.  That also means;; that you can't use the "%", so you need patterns with the matched;; operand in both positions.(define_insn ""  [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))	(plus:HI (match_dup 0)		 (match_operand:HI 1 "general_operand" "dn,rmn")))]  ""  "*{#ifndef NO_ADDSUB_Q  if (GET_CODE (operands[1]) == CONST_INT)    {      /* If the constant would be a negative number when interpreted as	 HImode, make it negative.  This is usually, but not always, done	 elsewhere in the compiler.  First check for constants out of range,	 which could confuse us.  */      if (INTVAL (operands[1]) >= 32768)	operands[1] = gen_rtx (CONST_INT, VOIDmode,			       INTVAL (operands[1]) - 65536);      if (INTVAL (operands[1]) > 0	  && INTVAL (operands[1]) <= 8)	return \"addq%.w %1,%0\";      if (INTVAL (operands[1]) < 0	  && INTVAL (operands[1]) >= -8)	{	  operands[1] = gen_rtx (CONST_INT, VOIDmode,			         - INTVAL (operands[1]));	  return \"subq%.w %1,%0\";	}      /* On everything except the 68000 it is faster to use two	 addqw instructions to add a small integer (8 < N <= 16)	 to an address register.  Likewise for subqw. */      if (INTVAL (operands[1]) > 8	  && INTVAL (operands[1]) <= 16	  && ADDRESS_REG_P (operands[0])	  && TARGET_68020) 	{	  operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) - 8);	  return \"addq%.w %#8,%0\;addq%.w %1,%0\";	}      if (INTVAL (operands[1]) < -8	  && INTVAL (operands[1]) >= -16	  && ADDRESS_REG_P (operands[0])	  && TARGET_68020) 	{	  operands[1] = gen_rtx (CONST_INT, VOIDmode, 				 - INTVAL (operands[1]) - 8);	  return \"subq%.w %#8,%0\;subq%.w %1,%0\";	}    }#endif  return \"add%.w %1,%0\";}")(define_insn ""  [(set (strict_low_part (match_operand:HI 0 "general_operand" "+m,d"))	(plus:HI (match_operand:HI 1 "general_operand" "dn,rmn")		 (match_dup 0)))]  ""  "*{#ifndef NO_ADDSUB_Q  if (GET_CODE (operands[1]) == CONST_INT)    {      /* If the constant would be a negative number when interpreted as	 HImode, make it negative.  This is usually, but not always, done	 elsewhere in the compiler.  First check for constants out of range,	 which could confuse us.  */      if (INTVAL (operands[1]) >= 32768)	operands[1] = gen_rtx (CONST_INT, VOIDmode,			       INTVAL (operands[1]) - 65536);      if (INTVAL (operands[1]) > 0	  && INTVAL (operands[1]) <= 8)	return \"addq%.w %1,%0\";      if (INTVAL (operands[1]) < 0	  && INTVAL (operands[1]) >= -8)	{	  operands[1] = gen_rtx (CONST_INT, VOIDmode,			         - INTVAL (operands[1]));	  return \"subq%.w %1,%0\";	}      /* On everything except the 68000 it is faster to use two	 addqw instructions to add a small integer (8 < N <= 16)	 to an address register.  Likewise for subqw. */      if (INTVAL (operands[1]) > 8	  && INTVAL (operands[1]) <= 16	  && ADDRESS_REG_P (operands[0])	  && TARGET_68020) 	{	  operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) - 8);	  return \"addq%.w %#8,%0\;addq%.w %1,%0\";	}      if (INTVAL (operands[1]) < -8	  && INTVAL (operands[1]) >= -16	  && ADDRESS_REG_P (operands[0])	  && TARGET_68020) 	{	  operands[1] = gen_rtx (CONST_INT, VOIDmode, 				 - INTVAL (operands[1]) - 8);	  return \"subq%.w %#8,%0\;subq%.w %1,%0\";	}    }#endif  return \"add%.w %1,%0\";}")(define_insn "addqi3"  [(set (match_operand:QI 0 "general_operand" "=m,d")	(plus:QI (match_operand:QI 1 "general_operand" "%0,0")		 (match_operand:QI 2 "general_operand" "dn,dmn")))]  ""  "*{#ifndef NO_ADDSUB_Q  if (GET_CODE (operands[2]) == CONST_INT)    {      if (INTVAL (operands[2]) >= 128)	operands[2] = gen_rtx (CONST_INT, VOIDmode,			       INTVAL (operands[2]) - 256);      if (INTVAL (operands[2]) > 0	  && INTVAL (operands[2]) <= 8)	return \"addq%.b %2,%0\";      if (INTVAL (operands[2]) < 0 && INTVAL (operands[2]) >= -8)       {	 operands[2] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[2]));	 return \"subq%.b %2,%0\";       }    }#endif  return \"add%.b %2,%0\";}")(define_insn ""  [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))	(plus:QI (match_dup 0)		 (match_operand:QI 1 "general_operand" "dn,dmn")))]  ""  "*{#ifndef NO_ADDSUB_Q  if (GET_CODE (operands[1]) == CONST_INT)    {      if (INTVAL (operands[1]) >= 128)	operands[1] = gen_rtx (CONST_INT, VOIDmode,			       INTVAL (operands[1]) - 256);      if (INTVAL (operands[1]) > 0	  && INTVAL (operands[1]) <= 8)	return \"addq%.b %1,%0\";      if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)       {	 operands[1] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[1]));	 return \"subq%.b %1,%0\";       }    }#endif  return \"add%.b %1,%0\";}")(define_insn ""  [(set (strict_low_part (match_operand:QI 0 "general_operand" "+m,d"))	(plus:QI (match_operand:QI 1 "general_operand" "dn,dmn")		 (match_dup 0)))]  ""  "*{#ifndef NO_ADDSUB_Q  if (GET_CODE (operands[1]) == CONST_INT)    {      if (INTVAL (operands[1]) >= 128)	operands[1] = gen_rtx (CONST_INT, VOIDmode,			       INTVAL (operands[1]) - 256);      if (INTVAL (operands[1]) > 0	  && INTVAL (operands[1]) <= 8)	return \"addq%.b %1,%0\";      if (INTVAL (operands[1]) < 0 && INTVAL (operands[1]) >= -8)       {	 operands[1] = gen_rtx (CONST_INT, VOIDmode, - INTVAL (operands[1]));	 return \"subq%.b %1,%0\";       }    }#endif  return \"add%.b %1,%0\";}")(define_expand "adddf3"  [(set (match_operand:DF 0 "general_operand" "")	(plus:DF (match_operand:DF 1 "general_operand" "")		 (match_operand:DF 2 "general_operand" "")))]  "TARGET_68881 || TARGET_FPA"  "")(define_insn ""  [(set (match_operand:DF 0 "general_operand" "=x,y")	(plus:DF (match_operand:DF 1 "general_operand" "%xH,y")		 (match_operand:DF 2 "general_operand" "xH,dmF")))]  "TARGET_FPA"  "*{  if (rtx_equal_p (operands[0], operands[1]))    return \"fpadd%.d %y2,%0\";  if (rtx_equal_p (operands[0], operands[2]))    return \"fpadd%.d %y1,%0\";  if (which_alternative == 0)    return \"fpadd3%.d %w2,%w1,%0\";  return \"fpadd3%.d %x2,%x1,%0\"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -