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

📄 mn10300.md

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 MD
📖 第 1 页 / 共 5 页
字号:
				"0,0,I,I,dx,ax,dx,ax,dxim,axim,dxim,axim,0,*f,dxai,*f,Q,*f"))]  "register_operand (operands[0], DImode)   || register_operand (operands[1], DImode)"  "*{  long val[2];  REAL_VALUE_TYPE rv;  switch (which_alternative)    {      case 0:      case 1:	return \"nop\";      case 2:	return \"clr %L0\;clr %H0\";      case 3:	if (rtx_equal_p (operands[0], operands[1]))	  return \"sub %L1,%L0\;mov %L0,%H0\";	else	  return \"mov %1,%L0\;mov %L0,%H0\";      case 4:      case 5:      case 6:      case 7:      case 8:      case 9:      case 10:      case 11:	if (GET_CODE (operands[1]) == CONST_INT)	  {	    rtx low, high;	    split_double (operands[1], &low, &high);	    val[0] = INTVAL (low);	    val[1] = INTVAL (high);	  }	if (GET_CODE (operands[1]) == CONST_DOUBLE)	  {	    if (GET_MODE (operands[1]) == DFmode)	      {		REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);		REAL_VALUE_TO_TARGET_DOUBLE (rv, val);	      }	    else if (GET_MODE (operands[1]) == VOIDmode		     || GET_MODE (operands[1]) == DImode)	      {		val[0] = CONST_DOUBLE_LOW (operands[1]);		val[1] = CONST_DOUBLE_HIGH (operands[1]);	      }	  }	if (GET_CODE (operands[1]) == MEM	    && reg_overlap_mentioned_p (operands[0], XEXP (operands[1], 0)))	  {	    rtx temp = operands[0];	    while (GET_CODE (temp) == SUBREG)	      temp = SUBREG_REG (temp);	    if (GET_CODE (temp) != REG)	      abort ();	    if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)),					 XEXP (operands[1], 0)))	      return \"mov %H1,%H0\;mov %L1,%L0\";	    else	      return \"mov %L1,%L0\;mov %H1,%H0\";	      	  }	else if (GET_CODE (operands[1]) == MEM		 && CONSTANT_ADDRESS_P (XEXP (operands[1], 0))		 && REGNO_REG_CLASS (REGNO (operands[0])) == ADDRESS_REGS)	  {	    rtx xoperands[2];	    xoperands[0] = operands[0];	    xoperands[1] = XEXP (operands[1], 0);	    output_asm_insn (\"mov %1,%L0\;mov (4,%L0),%H0\;mov (%L0),%L0\",			     xoperands);	    return \"\";	  }	else	  {	    if ((GET_CODE (operands[1]) == CONST_INT		 || GET_CODE (operands[1]) == CONST_DOUBLE)		&& val[0] == 0)	      {		if (REGNO_REG_CLASS (REGNO (operands[0])) == DATA_REGS)		  output_asm_insn (\"clr %L0\", operands);		else		  output_asm_insn (\"mov %L1,%L0\", operands);	      }	    else if ((GET_CODE (operands[1]) == CONST_INT		      || GET_CODE (operands[1]) == CONST_DOUBLE)		     && (REGNO_REG_CLASS (true_regnum (operands[0]))			 == EXTENDED_REGS)		     && (((val[0] & 0x80) && ! (val[0] & 0xffffff00))			 || ((val[0] & 0x800000) && ! (val[0] & 0xff000000))))	      output_asm_insn (\"movu %L1,%L0\", operands);	    else	      output_asm_insn (\"mov %L1,%L0\", operands);	    if ((GET_CODE (operands[1]) == CONST_INT		 || GET_CODE (operands[1]) == CONST_DOUBLE)		&& val[1] == 0)	      {		if (REGNO_REG_CLASS (REGNO (operands[0])) == DATA_REGS)		  output_asm_insn (\"clr %H0\", operands);		else		  output_asm_insn (\"mov %H1,%H0\", operands);	      }	    else if ((GET_CODE (operands[1]) == CONST_INT		      || GET_CODE (operands[1]) == CONST_DOUBLE)		     && val[0] == val[1])	      output_asm_insn (\"mov %L0,%H0\", operands);	    else if ((GET_CODE (operands[1]) == CONST_INT		      || GET_CODE (operands[1]) == CONST_DOUBLE)		     && (REGNO_REG_CLASS (true_regnum (operands[0]))			 == EXTENDED_REGS)		     && (((val[1] & 0x80) && ! (val[1] & 0xffffff00))			 || ((val[1] & 0x800000) && ! (val[1] & 0xff000000))))	      output_asm_insn (\"movu %H1,%H0\", operands);	    else	      output_asm_insn (\"mov %H1,%H0\", operands);	    return \"\";	  }      case 12:        return \"nop\";      case 13:      case 14:      case 15:        return \"fmov %L1, %L0\;fmov %H1, %H0\";      case 16:	if (GET_CODE (operands[1]) == MEM	    && GET_CODE (XEXP (operands[1], 0)) == CONST_INT	    && (INTVAL (XEXP (operands[1], 0)) & 7) == 0)	  return \"fmov %D1, %D0\";	else          return \"fmov %L1, %L0\;fmov %H1, %H0\";      case 17:	if (GET_CODE (operands[0]) == MEM	    && GET_CODE (XEXP (operands[0], 0)) == CONST_INT	    && (INTVAL (XEXP (operands[0], 0)) & 7) == 0)	  return \"fmov %D1, %D0\";	else          return \"fmov %L1, %L0\;fmov %H1, %H0\";    default:      abort ();    }}"  [(set (attr "cc")	(cond	 [	 (ior (lt (symbol_ref "which_alternative") (const_int 2))	      (eq (symbol_ref "which_alternative") (const_int 12))	      ) (const_string "none")	 (eq (symbol_ref "which_alternative") (const_int 2)	     ) (const_string "clobber")	 (eq (symbol_ref "which_alternative") (const_int 3)	     ) (if_then_else		(ne (symbol_ref "rtx_equal_p (operands[0], operands[1])")		    (const_int 0)) (const_string "clobber")		    (const_string "none_0hit"))	 (ior (eq (symbol_ref "which_alternative") (const_int 8))	      (eq (symbol_ref "which_alternative") (const_int 9))	      ) (if_then_else		 (ne (symbol_ref "mn10300_wide_const_load_uses_clr				  (operands)")		     (const_int 0)) (const_string "clobber")		     (const_string "none_0hit"))	 ] (const_string "none_0hit")))])(define_expand "movdf"  [(set (match_operand:DF 0 "general_operand" "")	(match_operand:DF 1 "general_operand" ""))]  ""  "{  /* One of the ops has to be in a register */  if (!register_operand (operand1, DFmode)      && !register_operand (operand0, DFmode))    operands[1] = copy_to_mode_reg (DFmode, operand1);}")(define_insn ""  [(set (match_operand:DF 0 "nonimmediate_operand"				"=f,dx,ax,dx,f,f,dxa,f,Q,a,dxm,dxm,axm,axm,dx,dx,ax,ax")	(match_operand:DF 1 "general_operand"				"0,0,0,G,f,dxaF,f,Q,f,G,dx,ax,dx,ax,dxFm,axFm,dxFm,axFm"))]  "register_operand (operands[0], DFmode)   || register_operand (operands[1], DFmode)"  "*{  long val[2];  REAL_VALUE_TYPE rv;  switch (which_alternative)    {      case 0:      case 1:      case 2:	return \"nop\";      case 3:	return \"clr %L0\;clr %H0\";      case 4:      case 5:      case 6:        return \"fmov %L1, %L0\;fmov %H1, %H0\";      case 7:	if (GET_CODE (operands[1]) == MEM	    && GET_CODE (XEXP (operands[1], 0)) == CONST_INT	    && (INTVAL (XEXP (operands[1], 0)) & 7) == 0)	  return \"fmov %D1, %D0\";	else          return \"fmov %L1, %L0\;fmov %H1, %H0\";      case 8:	if (GET_CODE (operands[0]) == MEM	    && GET_CODE (XEXP (operands[0], 0)) == CONST_INT	    && (INTVAL (XEXP (operands[0], 0)) & 7) == 0)	  return \"fmov %D1, %D0\";	else          return \"fmov %L1, %L0\;fmov %H1, %H0\";      case 9:	 if (rtx_equal_p (operands[0], operands[1]))	   return \"sub %L1,%L0\;mov %L0,%H0\";	 else	   return \"mov %1,%L0\;mov %L0,%H0\";      case 10:      case 11:      case 12:      case 13:      case 14:      case 15:      case 16:      case 17:	if (GET_CODE (operands[1]) == CONST_INT)	  {	    rtx low, high;	    split_double (operands[1], &low, &high);	    val[0] = INTVAL (low);	    val[1] = INTVAL (high);	  }	if (GET_CODE (operands[1]) == CONST_DOUBLE)	  {	    if (GET_MODE (operands[1]) == DFmode)	      {		REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);		REAL_VALUE_TO_TARGET_DOUBLE (rv, val);	      }	    else if (GET_MODE (operands[1]) == VOIDmode		     || GET_MODE (operands[1]) == DImode)	      {		val[0] = CONST_DOUBLE_LOW (operands[1]);		val[1] = CONST_DOUBLE_HIGH (operands[1]);	      }	  }	if (GET_CODE (operands[1]) == MEM	    && reg_overlap_mentioned_p (operands[0], XEXP (operands[1], 0)))	  {	    rtx temp = operands[0];	    while (GET_CODE (temp) == SUBREG)	      temp = SUBREG_REG (temp);	    if (GET_CODE (temp) != REG)	      abort ();	    if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)),					 XEXP (operands[1], 0)))	      return \"mov %H1,%H0\;mov %L1,%L0\";	    else	      return \"mov %L1,%L0\;mov %H1,%H0\";	      	  }	else if (GET_CODE (operands[1]) == MEM		 && CONSTANT_ADDRESS_P (XEXP (operands[1], 0))		 && REGNO_REG_CLASS (REGNO (operands[0])) == ADDRESS_REGS)	  {	    rtx xoperands[2];	    xoperands[0] = operands[0];	    xoperands[1] = XEXP (operands[1], 0);	    output_asm_insn (\"mov %1,%L0\;mov (4,%L0),%H0\;mov (%L0),%L0\",			     xoperands);	    return \"\";	  }	else	  {	    if ((GET_CODE (operands[1]) == CONST_INT		 || GET_CODE (operands[1]) == CONST_DOUBLE)		&& val[0] == 0)	      {		if (REGNO_REG_CLASS (REGNO (operands[0])) == DATA_REGS)		  output_asm_insn (\"clr %L0\", operands);		else		  output_asm_insn (\"mov %L1,%L0\", operands);	      }	    else if ((GET_CODE (operands[1]) == CONST_INT		      || GET_CODE (operands[1]) == CONST_DOUBLE)		     && (REGNO_REG_CLASS (true_regnum (operands[0]))			 == EXTENDED_REGS)		     && (((val[0] & 0x80) && ! (val[0] & 0xffffff00))			 || ((val[0] & 0x800000) && ! (val[0] & 0xff000000))))	      output_asm_insn (\"movu %L1,%L0\", operands);	    else	      output_asm_insn (\"mov %L1,%L0\", operands);	    if ((GET_CODE (operands[1]) == CONST_INT		 || GET_CODE (operands[1]) == CONST_DOUBLE)		&& val[1] == 0)	      {		if (REGNO_REG_CLASS (REGNO (operands[0])) == DATA_REGS)		  output_asm_insn (\"clr %H0\", operands);		else		  output_asm_insn (\"mov %H1,%H0\", operands);	      }	    else if ((GET_CODE (operands[1]) == CONST_INT		      || GET_CODE (operands[1]) == CONST_DOUBLE)		     && val[0] == val[1])	      output_asm_insn (\"mov %L0,%H0\", operands);	    else if ((GET_CODE (operands[1]) == CONST_INT		      || GET_CODE (operands[1]) == CONST_DOUBLE)		     && (REGNO_REG_CLASS (true_regnum (operands[0]))			 == EXTENDED_REGS)		     && (((val[1] & 0x80) && ! (val[1] & 0xffffff00))			 || ((val[1] & 0x800000) && ! (val[1] & 0xff000000))))	      output_asm_insn (\"movu %H1,%H0\", operands);	    else	      output_asm_insn (\"mov %H1,%H0\", operands);	    return \"\";	  }    default:      abort ();    }}"  [(set (attr "cc")	(cond	 [	 (lt (symbol_ref "which_alternative") (const_int 3)	     ) (const_string "none")	 (eq (symbol_ref "which_alternative") (const_int 3)	     ) (const_string "clobber")	 (eq (symbol_ref "which_alternative") (const_int 9)	     ) (if_then_else		(ne (symbol_ref "rtx_equal_p (operands[0], operands[1])")		    (const_int 0)) (const_string "clobber")		    (const_string "none_0hit"))	 (ior (eq (symbol_ref "which_alternative") (const_int 14))	      (eq (symbol_ref "which_alternative") (const_int 15))	      ) (if_then_else		 (ne (symbol_ref "mn10300_wide_const_load_uses_clr				  (operands)")		     (const_int 0)) (const_string "clobber")		     (const_string "none_0hit"))	 ] (const_string "none_0hit")))]);; ----------------------------------------------------------------------;; TEST INSTRUCTIONS;; ----------------------------------------------------------------------;; Go ahead and define tstsi so we can eliminate redundant tst insns;; when we start trying to optimize this port.(define_insn "tstsi"  [(set (cc0) (match_operand:SI 0 "register_operand" "dax"))]  ""  "* return output_tst (operands[0], insn);"  [(set_attr "cc" "set_znv")])(define_insn ""  [(set (cc0) (zero_extend:SI (match_operand:QI 0 "memory_operand" "dx,!a")))]  "TARGET_AM33"  "* return output_tst (operands[0], insn);"  [(set_attr "cc" "set_znv")])(define_insn ""  [(set (cc0) (zero_extend:SI (match_operand:QI 0 "memory_operand" "dx")))]  ""  "* return output_tst (operands[0], insn);"  [(set_attr "cc" "set_znv")])(define_insn ""  [(set (cc0) (zero_extend:SI (match_operand:HI 0 "memory_operand" "dx,!a")))]  "TARGET_AM33"  "* return output_tst (operands[0], insn);"  [(set_attr "cc" "set_znv")])(define_insn ""  [(set (cc0) (zero_extend:SI (match_operand:HI 0 "memory_operand" "dx")))]  ""  "* return output_tst (operands[0], insn);"  [(set_attr "cc" "set_znv")]);; Ordinarily, the cmp instruction will set the Z bit of cc0 to 1 if;; its operands hold equal values, but the operands of a cmp;; instruction must be distinct registers.  In the case where we'd;; like to compare a register to itself, we can achieve this effect;; with a btst 0,d0 instead.  (This will not alter the contents of d0;; but will have the proper effect on cc0.  Using d0 is arbitrary; any;; data register would work.);; Even though the first alternative would be preferable if it can;; possibly match, reload must not be given the opportunity to attempt;; to use it.  It assumes that such matches can only occur when one of;; the operands is used for input and the other for output.  Since;; this is not the case, it abort()s.  Indeed, such a reload cannot be;; possibly satisfied, so just mark the alternative with a `!', so;; that it is not considered by reload.(define_insn "cmpsi"  [(set (cc0)	(compare (match_operand:SI 0 "register_operand" "!*d*a*x,dax")		 (match_operand:SI 1 "nonmemory_operand" "*0,daxi")))]  ""  "@  btst 0,d0  cmp %1,%0"  [(set_attr "cc" "compare,compare")])(define_insn "cmpsf"  [(set (cc0)	(compare (match_operand:SF 0 "register_operand" "f,f")		 (match_operand:SF 1 "nonmemory_operand" "f,F")))]  "TARGET_AM33_2"  "fcmp %1,%0"  [(set_attr "cc" "compare,compare")]);; ----------------------------------------------------------------------;; ADD INSTRUCTIONS;; ----------------------------------------------------------------------(define_expand "addsi3"  [(set (match_operand:SI 0 "register_operand" "")	(plus:SI (match_operand:SI 1 "register_operand" "")		 (match_operand:SI 2 "nonmemory_operand" "")))]  ""  "")(define_insn ""

⌨️ 快捷键说明

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