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

📄 h8300.c

📁 GUN开源阻止下的编译器GCC
💻 C
📖 第 1 页 / 共 4 页
字号:
  if (GET_CODE (op) == REG)    return 1;  if (GET_CODE (op) == SUBREG)    return 1;  if (!rtx_equal_function_value_matters)    {      /* We're building rtl */      return GET_CODE (op) == MEM;    }  else    {      return (GET_CODE (op) == MEM	      && EXTRA_CONSTRAINT (op, 'U'));    }}/* Recognize valid operators for bit test.  */inteq_operator (x, mode)     rtx x;     enum machine_mode mode;{  return (GET_CODE (x) == EQ || GET_CODE (x) == NE);}/* Handle machine specific pragmas for compatibility with existing   compilers for the H8/300.   pragma saveall generates prolog/epilog code which saves and   restores all the registers on function entry.   pragma interrupt saves and restores all registers, and exits with   an rte instruction rather than an rts.  A pointer to a function   with this attribute may be safely used in an interrupt vector.  */inthandle_pragma (file)     FILE *file;{  int c;  char pbuf[20];  int psize = 0;  c = getc (file);  while (c == ' ' || c == '\t')    c = getc (file);  if (c == '\n' || c == EOF)    return c;  /* The only pragmas we understand are interrupt and saveall.  */  while (psize < sizeof (pbuf) - 1	 && isalpha (c))    {      pbuf[psize++] = c;      c = getc (file);    }  pbuf[psize] = 0;  if (strcmp (pbuf, "interrupt") == 0)    pragma_interrupt = 1;  if (strcmp (pbuf, "saveall") == 0)    pragma_saveall = 1;  /* ??? This is deprecated.  Delete for gcc 2.8.  */  if (strcmp (pbuf, "section") == 0)    {      static int printed_p = 0;      if (!printed_p)	{	  warning ("#pragma section is deprecated, use section attributes");	  printed_p = 1;	}      while (c && !isalpha (c))	c = getc (file);      psize = 0;      while (psize < sizeof (pbuf) - 1	     && isalpha (c) || isdigit (c) || c == '_')	{	  pbuf[psize++] = c;	  c = getc (file);	}      pbuf[psize] = 0;      named_section (NULL_TREE, pbuf);    }  ungetc (c, file);  return c;}/* If the next arg with MODE and TYPE is to be passed in a register, return   the rtx to represent where it is passed.  CUM represents the state after   the last argument.  NAMED is not used.  */static char *hand_list[] ={  "__main",  "__cmpsi2",  "__divhi3",  "__modhi3",  "__udivhi3",  "__umodhi3",  "__divsi3",  "__modsi3",  "__udivsi3",  "__umodsi3",  "__mulhi3",  "__mulsi3",  "__reg_memcpy",  "__reg_memset",  "__ucmpsi2",  0,};/* Return an RTX to represent where a value with mode MODE will be returned   from a function.  If the result is 0, the argument is pushed.  */rtxfunction_arg (cum, mode, type, named)     CUMULATIVE_ARGS *cum;     enum machine_mode mode;     tree type;     int named;{  rtx result = 0;  char *fname;  int regpass = 0;  /* Pass 3 regs worth of data in regs when user asked on the command line.  */  if (TARGET_QUICKCALL)    regpass = 3;  /* If calling hand written assembler, use 4 regs of args.  */  if (cum->libcall)    {      char **p;      fname = XSTR (cum->libcall, 0);      /* See if this libcall is one of the hand coded ones.  */      for (p = hand_list; *p && strcmp (*p, fname) != 0; p++)	;      if (*p)	regpass = 4;    }  if (regpass)    {      int size;      if (mode == BLKmode)	size = int_size_in_bytes (type);      else	size = GET_MODE_SIZE (mode);      if (size + cum->nbytes > regpass * UNITS_PER_WORD)	{	  result = 0;	}      else	{	  switch (cum->nbytes / UNITS_PER_WORD)	    {	    case 0:	      result = gen_rtx (REG, mode, 0);	      break;	    case 1:	      result = gen_rtx (REG, mode, 1);	      break;	    case 2:	      result = gen_rtx (REG, mode, 2);	      break;	    case 3:	      result = gen_rtx (REG, mode, 3);	      break;	    default:	      result = 0;	    }	}    }  return result;}/* Return the cost of the rtx R with code CODE.  */intconst_costs (r, c)     rtx r;     enum rtx_code c;{  switch (c)    {    case CONST_INT:      switch (INTVAL (r))	{	case 0:	case 1:	case 2:	case -1:	case -2:	  return 0;	default:	  return 1;	}    case CONST:    case LABEL_REF:    case SYMBOL_REF:      return 3;    case CONST_DOUBLE:      return 20;    default:      return 4;    }}/* Documentation for the machine specific operand escapes:   'A' print rn in h8/300 mode, erN in H8/300H mode   'C' print (operand - 2).   'E' like s but negative.   'F' like t but negative.   'G' constant just the negative   'L' fake label, changed after used twice.   'M' turn a 'M' constant into its negative mod 2.   'P' if operand is incing/decing sp, print .w, otherwise .b.   'S' print operand as a long word   'T' print operand as a word   'U' if operand is incing/decing sp, print l, otherwise nothing.   'V' find the set bit, and print its number.   'W' find the clear bit, and print its number.   'X' print operand as a byte   'Y' print either l or h depending on whether last 'Z' operand < 8 or >= 8.   'Z' print int & 7.   'b' print the bit opcode   'c' print the ibit opcode   'd' bcc if EQ, bcs if NE   'e' first word of 32 bit value - if reg, then least reg. if mem       then least. if const then most sig word   'f' second word of 32 bit value - if reg, then biggest reg. if mem       then +2. if const then least sig word   'g' bcs if EQ, bcc if NE   'j' print operand as condition code.   'k' print operand as reverse condition code.   's' print as low byte of 16 bit value   't' print as high byte of 16 bit value   'w' print as low byte of 32 bit value   'x' print as 2nd byte of 32 bit value   'y' print as 3rd byte of 32 bit value   'z' print as msb of 32 bit value*//* Return assembly language string which identifies a comparison type.  */static char *cond_string (code)     enum rtx_code code;{  switch (code)    {    case NE:      if (cc_prev_status.flags & CC_DONE_CBIT)	return "cs";      return "ne";    case EQ:      if (cc_prev_status.flags & CC_DONE_CBIT)	return "cc";      return "eq";    case GE:      return "ge";    case GT:      return "gt";    case LE:      return "le";    case LT:      return "lt";    case GEU:      return "hs";    case GTU:      return "hi";    case LEU:      return "ls";    case LTU:      return "lo";    default:      abort ();    }}/* Print operand X using operand code CODE to assembly language output file   FILE.  */voidprint_operand (file, x, code)     FILE *file;     rtx x;     int code;{  /* This is used to general unique labels for the 'L' code.  */  static int lab = 1000;  /* This is used for communication between the 'P' and 'U' codes.  */  static char *last_p;  /* This is used for communication between the 'Z' and 'Y' codes.  */  /* ??? 'V' and 'W' use it too.  */  static int bitint;  switch (code)    {    case 'A':      if (GET_CODE (x) == REG)	fprintf (file, "%s", h8_reg_names[REGNO (x)]);      else	goto def;      break;    case 'C':      fprintf (file, "#%d", INTVAL (x) - 2);      break;    case 'E':      switch (GET_CODE (x))	{	case REG:	  fprintf (file, "%sl", names_big[REGNO (x)]);	  break;	case CONST_INT:	  fprintf (file, "#%d", (-INTVAL (x)) & 0xff);	  break;	default:	  abort ();	}      break;    case 'F':      switch (GET_CODE (x))	{	case REG:	  fprintf (file, "%sh", names_big[REGNO (x)]);	  break;	case CONST_INT:	  fprintf (file, "#%d", ((-INTVAL (x)) & 0xff00) >> 8);	  break;	default:	  abort ();	}      break;    case 'G':      if (GET_CODE (x) != CONST_INT)	abort ();      fprintf (file, "#%d", 0xff & (-INTVAL (x)));      break;    case 'L':      /* 'L' must always be used twice in a single pattern.  It generates	 the same label twice, and then will generate a unique label the	 next time it is used.  */      asm_fprintf (file, "tl%d", (lab++) / 2);      break;    case 'M':      /* For 3/-3 and 4/-4, the other 2 is handled separately.  */      switch (INTVAL (x))	{	case 2:	case 4:	case -2:	case -4:	  fprintf (file, "#2");	  break;	case 1:	case 3:	case -1:	case -3:	  fprintf (file, "#1");	  break;	default:	  abort ();	}      break;    case 'P':      if (REGNO (XEXP (XEXP (x, 0), 0)) == STACK_POINTER_REGNUM)	{	  last_p = "";	  fprintf (file, ".w");	}      else	{	  last_p = "l";	  fprintf (file, ".b");	}      break;    case 'S':      if (GET_CODE (x) == REG)	fprintf (file, "%s", names_extended[REGNO (x)]);      else	goto def;      break;    case 'T':      if (GET_CODE (x) == REG)	fprintf (file, "%s", names_big[REGNO (x)]);      else	goto def;      break;    case 'U':      fprintf (file, "%s%s", names_big[REGNO (x)], last_p);      break;    case 'V':      bitint = exact_log2 (INTVAL (x));      if (bitint == -1)	abort ();      fprintf (file, "#%d", bitint & 7);      break;    case 'W':      bitint = exact_log2 ((~INTVAL (x)) & 0xff);      if (bitint == -1)	abort ();      fprintf (file, "#%d", bitint & 7);      break;    case 'X':      if (GET_CODE (x) == REG)	fprintf (file, "%s", byte_reg (x, 0));      else	goto def;      break;    case 'Y':      if (bitint == -1)	abort ();      if (GET_CODE (x) == REG)	fprintf (file, "%s%c", names_big[REGNO (x)], bitint > 7 ? 'h' : 'l');      else	print_operand (file, x, 0);      bitint = -1;      break;    case 'Z':      bitint = INTVAL (x);      fprintf (file, "#%d", bitint & 7);      break;    case 'b':      switch (GET_CODE (x))	{	case IOR:	  fprintf (file, "bor");	  break;	case XOR:	  fprintf (file, "bxor");	  break;	case AND:	  fprintf (file, "band");	  break;	}      break;    case 'c':      switch (GET_CODE (x))	{	case IOR:	  fprintf (file, "bior");	  break;	case XOR:	  fprintf (file, "bixor");	  break;	case AND:	  fprintf (file, "biand");	  break;	}      break;    case 'd':      switch (GET_CODE (x))	{	case EQ:	  fprintf (file, "bcc");	  break;	case NE:	  fprintf (file, "bcs");	  break;	default:	  abort ();	}      break;    case 'e':      switch (GET_CODE (x))	{	case REG:	  if (TARGET_H8300)	    fprintf (file, "%s", names_big[REGNO (x)]);	  else	    fprintf (file, "%s", names_upper_extended[REGNO (x)]);	  break;	case MEM:	  x = adj_offsettable_operand (x, 0);	  print_operand (file, x, 0);	  break;	case CONST_INT:	  fprintf (file, "#%d", ((INTVAL (x) >> 16) & 0xffff));	  break;	default:	  abort ();	  break;	}      break;    case 'f':      switch (GET_CODE (x))	{	case REG:	  if (TARGET_H8300)	    fprintf (file, "%s", names_big[REGNO (x) + 1]);	  else	    fprintf (file, "%s", names_big[REGNO (x)]);	  break;	case MEM:

⌨️ 快捷键说明

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