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

📄 m68k.md

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 MD
📖 第 1 页 / 共 5 页
字号:
    (plus:DI (ashift:DI (sign_extend:DI          (match_operand:HI 1 "general_operand" "rm,rm,rm,rm"))            (const_int 32))        (match_operand:DI 2 "general_operand" "0,0,0,0")))   (clobber (match_scratch:SI 3 "=&d,X,a,?d"))]  "!TARGET_COLDFIRE"{  CC_STATUS_INIT;  if (ADDRESS_REG_P (operands[0]))    return "add%.w %1,%0";  else if (ADDRESS_REG_P (operands[3]))    return "move%.w %1,%3\;add%.l %3,%0";  else    return "move%.w %1,%3\;ext%.l %3\;add%.l %3,%0";})(define_insn "adddi_dilshr32"  [(set (match_operand:DI 0 "nonimmediate_operand" "=d,o");;    (plus:DI (match_operand:DI 2 "general_operand" "%0");;	(lshiftrt:DI (match_operand:DI 1 "general_operand" "ro");;            (const_int 32))))]    (plus:DI (lshiftrt:DI (match_operand:DI 1 "general_operand" "ro,d")            (const_int 32))        (match_operand:DI 2 "general_operand" "0,0")))]  ""{  CC_STATUS_INIT;  if (GET_CODE (operands[0]) == REG)    operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);  else    operands[2] = adjust_address (operands[0], SImode, 4);  return "add%.l %1,%2\;negx%.l %0\;neg%.l %0";})(define_insn "adddi_dishl32"  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o");;    (plus:DI (match_operand:DI 2 "general_operand" "%0");;	(ashift:DI (match_operand:DI 1 "general_operand" "ro");;            (const_int 32))))]    (plus:DI (ashift:DI (match_operand:DI 1 "general_operand" "ro,d")            (const_int 32))        (match_operand:DI 2 "general_operand" "0,0")))]  ""{  CC_STATUS_INIT;  if (GET_CODE (operands[1]) == REG)    operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);  else    operands[1] = adjust_address (operands[1], SImode, 4);  return "add%.l %1,%0";})(define_insn "adddi3"  [(set (match_operand:DI 0 "nonimmediate_operand" "=<,o<>,d,d,d")	(plus:DI (match_operand:DI 1 "general_operand" "%0,0,0,0,0")		 (match_operand:DI 2 "general_operand" "<,d,no>,d,a")))   (clobber (match_scratch:SI 3 "=X,&d,&d,X,&d"))]  ""{  if (DATA_REG_P (operands[0]))    {      if (DATA_REG_P (operands[2]))	return "add%.l %R2,%R0\;addx%.l %2,%0";      else if (GET_CODE (operands[2]) == MEM	  && GET_CODE (XEXP (operands[2], 0)) == POST_INC)	return "move%.l %2,%3\;add%.l %2,%R0\;addx%.l %3,%0";      else	{	  rtx high, low;	  rtx xoperands[2];	  if (GET_CODE (operands[2]) == REG)	    {	      low = gen_rtx_REG (SImode, REGNO (operands[2]) + 1);	      high = operands[2];	    }	  else if (CONSTANT_P (operands[2]))	    split_double (operands[2], &high, &low);	  else	    {	      low = adjust_address (operands[2], SImode, 4);	      high = operands[2];	    }	  operands[1] = low, operands[2] = high;	  xoperands[0] = operands[3];	  if (GET_CODE (operands[1]) == CONST_INT	      && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)	    xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);	  else	    xoperands[1] = operands[2];	  output_asm_insn (output_move_simode (xoperands), xoperands);	  if (GET_CODE (operands[1]) == CONST_INT)	    {	      if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) <= 8)		return "addq%.l %1,%R0\;addx%.l %3,%0";	      else if (INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)		{		  operands[1] = GEN_INT (-INTVAL (operands[1]));		  return "subq%.l %1,%R0\;subx%.l %3,%0";		}	    }	  return "add%.l %1,%R0\;addx%.l %3,%0";	}    }  else if (GET_CODE (operands[0]) == MEM)    {      if (GET_CODE (operands[2]) == MEM	  && GET_CODE (XEXP (operands[2], 0)) == PRE_DEC)	return "add%.l %2,%0\;addx%.l %2,%0";      CC_STATUS_INIT;      if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)	{	  operands[1] = gen_rtx_MEM (SImode,				     plus_constant (XEXP(operands[0], 0), -8));	  return "move%.l %0,%3\;add%.l %R2,%0\;addx%.l %2,%3\;move%.l %3,%1";	}      else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)	{	  operands[1] = XEXP(operands[0], 0);	  return "add%.l %R2,%0\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%1";	}      else	{	  operands[1] = adjust_address (operands[0], SImode, 4);	  return "add%.l %R2,%1\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%0";	}    }  else    abort ();})(define_insn "addsi_lshrsi_31"  [(set (match_operand:SI 0 "nonimmediate_operand" "=dm")    (plus:SI (lshiftrt:SI (match_operand:SI 1 "general_operand" "rm")            (const_int 31))        (match_dup 1)))]  ""{  operands[2] = operands[0];  operands[3] = gen_label_rtx();  if (GET_CODE (operands[0]) == MEM)    {      if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)        operands[0] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));      else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)        operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));    }  output_asm_insn ("move%.l %1,%0", operands);  output_asm_insn (MOTOROLA ? "jbpl %l3" : "jpl %l3", operands);  output_asm_insn ("addq%.l #1,%2", operands);  (*targetm.asm_out.internal_label) (asm_out_file, "L",				CODE_LABEL_NUMBER (operands[3]));  return "";})(define_expand "addsi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "")	(plus:SI (match_operand:SI 1 "general_operand" "")		 (match_operand:SI 2 "general_src_operand" "")))]  ""  "");; 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_internal"  [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,d,a")        (plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0,0")                 (match_operand:SI 2 "general_src_operand" "dIKLT,rJK,a,mSrIKLT,mSrIKLs")))]  "! TARGET_COLDFIRE"  "* return output_addsi3 (operands);")(define_insn "*addsi3_5200"  [(set (match_operand:SI 0 "nonimmediate_operand" "=m,?a,?a,r")	(plus:SI (match_operand:SI 1 "general_operand" "%0,a,rJK,0")		 (match_operand:SI 2 "general_src_operand" "d,rJK,a,mrIKLs")))]  "TARGET_COLDFIRE"  "* return output_addsi3 (operands);")(define_insn ""  [(set (match_operand:SI 0 "nonimmediate_operand" "=a")	(plus:SI (match_operand:SI 1 "general_operand" "0")		 (sign_extend:SI		  (match_operand:HI 2 "nonimmediate_src_operand" "rmS"))))]  "!TARGET_COLDFIRE"  "add%.w %2,%0")(define_insn "addhi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=m,r")	(plus:HI (match_operand:HI 1 "general_operand" "%0,0")		 (match_operand:HI 2 "general_src_operand" "dn,rmSn")))]  "!TARGET_COLDFIRE"{  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_INT (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_INT (- INTVAL (operands[2]));	  return "subq%.w %2,%0";	}      /* On the CPU32 it is faster to use two addqw instructions to	 add a small integer (8 < N <= 16) to a register.  	 Likewise for subqw.  */      if (TARGET_CPU32 && REG_P (operands[0]))	{	  if (INTVAL (operands[2]) > 8	      && INTVAL (operands[2]) <= 16)	    {	      operands[2] = GEN_INT (INTVAL (operands[2]) - 8);	      return "addq%.w #8,%0\;addq%.w %2,%0";	    }	  if (INTVAL (operands[2]) < -8	      && INTVAL (operands[2]) >= -16)	    {	      operands[2] = GEN_INT (- INTVAL (operands[2]) - 8);	      return "subq%.w #8,%0\;subq%.w %2,%0";	    }	}      if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)	return MOTOROLA ? "lea (%c2,%0),%0" : "lea %0@(%c2),%0";    }  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 "nonimmediate_operand" "+m,d"))	(plus:HI (match_dup 0)		 (match_operand:HI 1 "general_src_operand" "dn,rmSn")))]  "!TARGET_COLDFIRE"{  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_INT (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_INT (- INTVAL (operands[1]));	  return "subq%.w %1,%0";	}      /* On the CPU32 it is faster to use two addqw instructions to	 add a small integer (8 < N <= 16) to a register. 	 Likewise for subqw.  */      if (TARGET_CPU32 && REG_P (operands[0]))	{	  if (INTVAL (operands[1]) > 8	      && INTVAL (operands[1]) <= 16)	    {	      operands[1] = GEN_INT (INTVAL (operands[1]) - 8);	      return "addq%.w #8,%0\;addq%.w %1,%0";	    }	  if (INTVAL (operands[1]) < -8	      && INTVAL (operands[1]) >= -16)	    {	      operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);	      return "subq%.w #8,%0\;subq%.w %1,%0";	    }	}      if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)	return MOTOROLA ? "lea (%c1,%0),%0" : "lea %0@(%c1),%0";    }  return "add%.w %1,%0";})(define_insn ""  [(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+m,d"))	(plus:HI (match_operand:HI 1 "general_src_operand" "dn,rmSn")		 (match_dup 0)))]  "!TARGET_COLDFIRE"{  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_INT (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_INT (- INTVAL (operands[1]));	  return "subq%.w %1,%0";	}      /* On the CPU32 it is faster to use two addqw instructions to	 add a small integer (8 < N <= 16) to a register.	 Likewise for subqw.  */      if (TARGET_CPU32 && REG_P (operands[0])) 	{	  if (INTVAL (operands[1]) > 8	      && INTVAL (operands[1]) <= 16)	    {	      operands[1] = GEN_INT (INTVAL (operands[1]) - 8);	      return "addq%.w #8,%0\;addq%.w %1,%0";	    }	  if (INTVAL (operands[1]) < -8	      && INTVAL (operands[1]) >= -16)	    {	      operands[1] = GEN_INT (- INTVAL (operands[1]) - 8);	      return "subq%.w #8,%0\;subq%.w %1,%0";	    }	}      if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)	return MOTOROLA ? "lea (%c1,%0),%0" : "lea %0@(%c1),%0";    }  return "add%.w %1,%0";})(define_insn "addqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=m,d")	(plus:QI (match_operand:QI 1 "general_operand" "%0,0")		 (match_operand:QI 2 "general_src_operand" "dn,dmSn")))]  "!TARGET_COLDFIRE"{  if (GET_CODE (operands[2]) == CONST_INT)    {      if (INTVAL (operands[2]) >= 128)	operands[2] = GEN_INT (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_INT (- INTVAL (operands[2]));	 return "subq%.b %2,%0";       }    }  return "add%.b %2,%0";})(define_insn ""  [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))	(plus:QI (match_dup 0)		 (match_operand:QI 1 "general_src_operand" "dn,dmSn")))]  "!TARGET_COLDFIRE"{  if (GET_CODE (operands[1]) == CONST_INT)    {      if (INTVAL (operands[1]) >= 128)	operands[1] = GEN_INT (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_INT (- INTVAL (operands[1]));	 return "subq%.b %1,%0";       }    }  return "add%.b %1,%0";})(define_insn ""  [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+m,d"))	(plus:QI (match_operand:QI 1 "general_src_operand" "dn,dmSn")		 (match_dup 0)))]  "!TARGET_COLDFIRE"{  if (GET_CODE (operands[1]) == CONST_INT)    {      if (INTVAL (operands[1]) >= 128)	operands[1] = GEN_INT (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_INT (- INTVAL (operands[1]));	 return "subq%.b %1,%0";       }    }  return "add%.b %1,%0";})(define_expand "adddf3"  [(set (match_operand:DF 0 "nonimmediate_operand" "")	(plus:DF (match_operand:DF 1 "general_operand" "")		 (match_ope

⌨️ 快捷键说明

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