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

📄 mn10300.md

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 MD
📖 第 1 页 / 共 5 页
字号:
;; GCC machine description for Matsushita MN10300;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004;; Free Software Foundation, Inc.;; Contributed by Jeff Law (law@cygnus.com).;; This file is part of GCC.;; GCC is free software; you can redistribute it and/or modify;; it under the terms of the GNU General Public License as published by;; the Free Software Foundation; either version 2, or (at your option);; any later version.;; GCC is distributed in the hope that it will be useful,;; but WITHOUT ANY WARRANTY; without even the implied warranty of;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the;; GNU General Public License for more details.;; You should have received a copy of the GNU General Public License;; along with GCC; see the file COPYING.  If not, write to;; the Free Software Foundation, 59 Temple Place - Suite 330,;; Boston, MA 02111-1307, USA.;; The original PO technology requires these to be ordered by speed,;; so that assigner will pick the fastest.;; See file "rtl.def" for documentation on define_insn, match_*, et. al.;; Condition code settings.;; none - insn does not affect cc;; none_0hit - insn does not affect cc but it does modify operand 0;;	This attribute is used to keep track of when operand 0 changes.;; 	See the description of NOTICE_UPDATE_CC for more info.;; set_znv - insn sets z,n,v to usable values; c is unusable.;; set_zn  - insn sets z,n to usable values; v,c are unusable.;; compare - compare instruction;; clobber - value of cc is unknown(define_attr "cc" "none,none_0hit,set_znv,set_zn,compare,clobber"  (const_string "clobber"))(define_constants [  (PIC_REG	6)  (SP_REG	9)  (UNSPEC_INT_LABEL	0)  (UNSPEC_PIC		1)  (UNSPEC_GOT		2)  (UNSPEC_GOTOFF	3)  (UNSPEC_PLT		4)]);; ----------------------------------------------------------------------;; MOVE INSTRUCTIONS;; ----------------------------------------------------------------------;; movqi(define_expand "movqi"  [(set (match_operand:QI 0 "general_operand" "")	(match_operand:QI 1 "general_operand" ""))]  ""  "{  /* One of the ops has to be in a register */  if (!register_operand (operand0, QImode)      && !register_operand (operand1, QImode))    operands[1] = copy_to_mode_reg (QImode, operand1);}")(define_insn ""  [(set (match_operand:QI 0 "nonimmediate_operand" "=d*x*a*f,d*x,d*x*a,d*x*a,m,*f,d*x*a")	(match_operand:QI 1 "general_operand" "0,I,d*xai,m,d*xa,d*xa*f,*f"))]  "TARGET_AM33   && (register_operand (operands[0], QImode)       || register_operand (operands[1], QImode))"  "*{  switch (which_alternative)    {    case 0:      return \"nop\";    case 1:      return \"clr %0\";    case 2:      if (GET_CODE (operands[1]) == CONST_DOUBLE)	{	  rtx xoperands[2];	  xoperands[0] = operands[0];	  xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));	  output_asm_insn (\"mov %1,%0\", xoperands);	  return \"\";	}      if (REGNO_REG_CLASS (true_regnum (operands[0])) == EXTENDED_REGS	  && GET_CODE (operands[1]) == CONST_INT)	{	  HOST_WIDE_INT val = INTVAL (operands[1]);	  if (((val & 0x80) && ! (val & 0xffffff00))	      || ((val & 0x800000) && ! (val & 0xff000000)))	    return \"movu %1,%0\";	}      return \"mov %1,%0\";    case 3:    case 4:      return \"movbu %1,%0\";    case 5:    case 6:      return \"fmov %1,%0\";    default:      abort ();    }}"  [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])(define_insn ""  [(set (match_operand:QI 0 "nonimmediate_operand" "=d*a,d,d*a,d,m")	(match_operand:QI 1 "general_operand" "0,I,dai,m,d"))]  "register_operand (operands[0], QImode)   || register_operand (operands[1], QImode)"  "*{  switch (which_alternative)    {    case 0:      return \"nop\";    case 1:      return \"clr %0\";    case 2:      if (GET_CODE (operands[1]) == CONST_DOUBLE)	{	  rtx xoperands[2];	  xoperands[0] = operands[0];	  xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));	  output_asm_insn (\"mov %1,%0\", xoperands);	  return \"\";	}      return \"mov %1,%0\";    case 3:    case 4:      return \"movbu %1,%0\";    default:      abort ();    }}"  [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")]);; movhi(define_expand "movhi"  [(set (match_operand:HI 0 "general_operand" "")	(match_operand:HI 1 "general_operand" ""))]  ""  "{  /* One of the ops has to be in a register */  if (!register_operand (operand1, HImode)      && !register_operand (operand0, HImode))    operands[1] = copy_to_mode_reg (HImode, operand1);}")(define_insn ""  [(set (match_operand:HI 0 "nonimmediate_operand" "=d*x*a*f,d*x,d*x*a,d*x*a,m,*f,d*x*a")	(match_operand:HI 1 "general_operand" "0,I,d*x*ai,m,d*x*a,d*x*a*f,*f"))]  "TARGET_AM33   && (register_operand (operands[0], HImode)       || register_operand (operands[1], HImode))"  "*{  switch (which_alternative)    {    case 0:      return \"nop\";    case 1:      return \"clr %0\";    case 2:      if (GET_CODE (operands[1]) == CONST_DOUBLE)	{	  rtx xoperands[2];	  xoperands[0] = operands[0];	  xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));	  output_asm_insn (\"mov %1,%0\", xoperands);	  return \"\";	}      if (REGNO_REG_CLASS (true_regnum (operands[0])) == EXTENDED_REGS	  && GET_CODE (operands[1]) == CONST_INT)	{	  HOST_WIDE_INT val = INTVAL (operands[1]);	  if (((val & 0x80) && ! (val & 0xffffff00))	      || ((val & 0x800000) && ! (val & 0xff000000)))	    return \"movu %1,%0\";	}      return \"mov %1,%0\";    case 3:    case 4:      return \"movhu %1,%0\";    case 5:    case 6:      return \"fmov %1,%0\";    default:      abort ();    }}"  [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])(define_insn ""  [(set (match_operand:HI 0 "nonimmediate_operand" "=d*a,d,d*a,d,m")	(match_operand:HI 1 "general_operand" "0,I,dai,m,d"))]  "register_operand (operands[0], HImode)   || register_operand (operands[1], HImode)"  "*{  switch (which_alternative)    {    case 0:      return \"nop\";    case 1:      return \"clr %0\";    case 2:      if (GET_CODE (operands[1]) == CONST_DOUBLE)	{	  rtx xoperands[2];	  xoperands[0] = operands[0];	  xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));	  output_asm_insn (\"mov %1,%0\", xoperands);	  return \"\";	}      return \"mov %1,%0\";    case 3:    case 4:      return \"movhu %1,%0\";    default:      abort ();    }}"  [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")]);; movsi and helpers;; We use this to handle addition of two values when one operand is the;; stack pointer and the other is a memory reference of some kind.  Reload;; does not handle them correctly without this expander.(define_expand "reload_insi"  [(set (match_operand:SI 0 "register_operand" "=a")	(match_operand:SI 1 "impossible_plus_operand" ""))   (clobber (match_operand:SI 2 "register_operand" "=&r"))]  ""  "{  if (XEXP (operands[1], 0) == stack_pointer_rtx)    {      if (GET_CODE (XEXP (operands[1], 1)) == SUBREG	  && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 1)))	      > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 1))))))	emit_move_insn (operands[2],			gen_rtx_ZERO_EXTEND			(GET_MODE (XEXP (operands[1], 1)),			 SUBREG_REG (XEXP (operands[1], 1))));      else	emit_move_insn (operands[2], XEXP (operands[1], 1));      emit_move_insn (operands[0], XEXP (operands[1], 0));    }  else    {      if (GET_CODE (XEXP (operands[1], 0)) == SUBREG	  && (GET_MODE_SIZE (GET_MODE (XEXP (operands[1], 0)))	      > GET_MODE_SIZE (GET_MODE (SUBREG_REG (XEXP (operands[1], 0))))))	emit_move_insn (operands[2],			gen_rtx_ZERO_EXTEND			(GET_MODE (XEXP (operands[1], 0)),			 SUBREG_REG (XEXP (operands[1], 0))));      else	emit_move_insn (operands[2], XEXP (operands[1], 0));      emit_move_insn (operands[0], XEXP (operands[1], 1));    }  emit_insn (gen_addsi3 (operands[0], operands[0], operands[2]));  DONE;}")(define_insn "pop_pic_reg"  [(set (reg:SI PIC_REG)	(mem:SI (post_inc:SI (reg:SI SP_REG))))]  "reload_completed"  "movm (sp),[a2]")(define_expand "movsi"  [(set (match_operand:SI 0 "general_operand" "")	(match_operand:SI 1 "general_operand" ""))]  ""  "{  /* One of the ops has to be in a register */  if (!register_operand (operand1, SImode)      && !register_operand (operand0, SImode))    operands[1] = copy_to_mode_reg (SImode, operand1);  if (flag_pic)    {      rtx temp;      if (SYMBOLIC_CONST_P (operands[1]))	{	  if (GET_CODE (operands[0]) == MEM)	    operands[1] = force_reg (Pmode, operands[1]);	  else	    {	      temp = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode);	      operands[1] = legitimize_pic_address (operands[1], temp);	    }	}      else if (GET_CODE (operands[1]) == CONST	       && GET_CODE (XEXP (operands[1], 0)) == PLUS	       && SYMBOLIC_CONST_P (XEXP (XEXP (operands[1], 0), 0)))	{	  temp = no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode);	  temp = legitimize_pic_address (XEXP (XEXP (operands[1], 0), 0),					 temp);	  operands[1] = expand_binop (SImode, add_optab, temp,				      XEXP (XEXP (operands[1], 0), 1),				      no_new_pseudos ? temp				      : gen_reg_rtx (Pmode),				      0, OPTAB_LIB_WIDEN);	}    }}")(define_insn ""  [(set (match_operand:SI 0 "nonimmediate_operand"				"=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax,axR,!*y,*f,*f,dxaQ")	(match_operand:SI 1 "general_operand"				"0,0,I,I,dx,ax,dx,ax,dixm,aixm,dixm,aixm,!*y,axR,0,dxaQi*f,*f"))]  "register_operand (operands[0], SImode)   || register_operand (operands[1], SImode)"  "*{  switch (which_alternative)    {    case 0:    case 1:      return \"nop\";    case 2:      return \"clr %0\";    case 3:    case 4:    case 5:    case 6:    case 7:    case 8:    case 9:    case 10:    case 11:    case 12:    case 13:      if (GET_CODE (operands[1]) == CONST_DOUBLE)	{	  rtx xoperands[2];	  xoperands[0] = operands[0];	  xoperands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));	  output_asm_insn (\"mov %1,%0\", xoperands);	  return \"\";	}      if (REGNO_REG_CLASS (true_regnum (operands[0])) == EXTENDED_REGS	  && GET_CODE (operands[1]) == CONST_INT)	{	  HOST_WIDE_INT val = INTVAL (operands[1]);	  if (((val & 0x80) && ! (val & 0xffffff00))	      || ((val & 0x800000) && ! (val & 0xff000000)))	    return \"movu %1,%0\";	}      return \"mov %1,%0\";    case 14:      return \"nop\";    case 15:    case 16:      return \"fmov %1,%0\";    default:      abort ();    }}"  [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none,none_0hit,none_0hit")])(define_expand "movsf"  [(set (match_operand:SF 0 "general_operand" "")	(match_operand:SF 1 "general_operand" ""))]  ""  "{  /* One of the ops has to be in a register */  if (!register_operand (operand1, SFmode)      && !register_operand (operand0, SFmode))    operands[1] = copy_to_mode_reg (SFmode, operand1);}")(define_insn ""  [(set (match_operand:SF 0 "nonimmediate_operand" "=f,dx,ax,dx,a,f,dxaQ,daxm,dax")	(match_operand:SF 1 "general_operand" "0,0,0,G,G,fdxaQF,f,dax,daxFm"))]  "register_operand (operands[0], SFmode)   || register_operand (operands[1], SFmode)"  "*{  switch (which_alternative)    {    case 0:    case 1:    case 2:      return \"nop\";    case 3:      return \"clr %0\";    /* case 4: below */    case 5:    case 6:      return \"fmov %1, %0\";    case 4:    case 7:    case 8:      if (REGNO_REG_CLASS (true_regnum (operands[0])) == EXTENDED_REGS	  && GET_CODE (operands[1]) == CONST_INT)	{	  HOST_WIDE_INT val = INTVAL (operands[1]);	  if (((val & 0x80) && ! (val & 0xffffff00))	      || ((val & 0x800000) && ! (val & 0xff000000)))	    return \"movu %1,%0\";	}      return \"mov %1,%0\";    default:      abort ();    }}"  [(set_attr "cc" "none,none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])(define_expand "movdi"  [(set (match_operand:DI 0 "general_operand" "")	(match_operand:DI 1 "general_operand" ""))]  ""  "{  /* One of the ops has to be in a register */  if (!register_operand (operand1, DImode)      && !register_operand (operand0, DImode))    operands[1] = copy_to_mode_reg (DImode, operand1);}")(define_insn ""  [(set (match_operand:DI 0 "nonimmediate_operand"				"=dx,ax,dx,a,dxm,dxm,axm,axm,dx,dx,ax,ax,*f,*f,*f,dxa,*f,Q")	(match_operand:DI 1 "general_operand"

⌨️ 快捷键说明

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