FreeBSD/contrib/binutils/gas/config/tc-i386.c
/* Returns 0 if attempting to add a prefix where one from the same
   class already exists, 1 if non rep/repne added, 2 if rep/repne
   added.  */
Returns 0 if attempting to add a prefix where one from the same
class already exists, 1 if non rep/repne added, 2 if rep/repne
added.
Returns 0 if attempting to add a prefix where one from the same class already exists 1 if non rep / repne added 2 if rep / repne added .
static int
add_prefix (unsigned int prefix)
{
  int ret = 1;
  unsigned int q;
  if (prefix >= REX_OPCODE && prefix < REX_OPCODE + 16
      && flag_code == CODE_64BIT)
    {
      if ((i.prefix[REX_PREFIX] & prefix & REX_W)
	  || ((i.prefix[REX_PREFIX] & (REX_R | REX_X | REX_B))
	      && (prefix & (REX_R | REX_X | REX_B))))
	ret = 0;
      q = REX_PREFIX;
    }
  else
    {
      switch (prefix)
	{
	default:
	  abort ();
	case CS_PREFIX_OPCODE:
	case DS_PREFIX_OPCODE:
	case ES_PREFIX_OPCODE:
	case FS_PREFIX_OPCODE:
	case GS_PREFIX_OPCODE:
	case SS_PREFIX_OPCODE:
	  q = SEG_PREFIX;
	  break;
	case REPNE_PREFIX_OPCODE:
	case REPE_PREFIX_OPCODE:
	  ret = 2;
	case LOCK_PREFIX_OPCODE:
	  q = LOCKREP_PREFIX;
	  break;
	case FWAIT_OPCODE:
	  q = WAIT_PREFIX;
	  break;
	case ADDR_PREFIX_OPCODE:
	  q = ADDR_PREFIX;
	  break;
	case DATA_PREFIX_OPCODE:
	  q = DATA_PREFIX;
	  break;
	}
      if (i.prefix[q] != 0)
	ret = 0;
    }
  if (ret)
    {
      if (!i.prefix[q])
	++i.prefixes;
      i.prefix[q] |= prefix;
    }
  else
    as_bad (_("same type of prefix used twice"));
  return ret;
}
static int add_prefix ( unsigned int prefix ) { int ret = 1 ; unsigned int q ; if ( prefix >= REX_OPCODE && prefix < REX_OPCODE + 16 && flag_code == CODE_64BIT ) { if ( ( i . prefix [ REX_PREFIX ] & prefix & REX_W ) || ( ( i . prefix [ REX_PREFIX ] & ( REX_R | REX_X | REX_B ) ) && ( prefix & ( REX_R | REX_X | REX_B ) ) ) ) ret = 0 ; q = REX_PREFIX ; } else { switch ( prefix ) { default : abort ( ) ; case CS_PREFIX_OPCODE : case DS_PREFIX_OPCODE : case ES_PREFIX_OPCODE : case FS_PREFIX_OPCODE : case GS_PREFIX_OPCODE : case SS_PREFIX_OPCODE : q = SEG_PREFIX ; break ; case REPNE_PREFIX_OPCODE : case REPE_PREFIX_OPCODE : ret = 2 ; case LOCK_PREFIX_OPCODE : q = LOCKREP_PREFIX ; break ; case FWAIT_OPCODE : q = WAIT_PREFIX ; break ; case ADDR_PREFIX_OPCODE : q = ADDR_PREFIX ; break ; case DATA_PREFIX_OPCODE : q = DATA_PREFIX ; break ; } if ( i . prefix [ q ] != 0 ) ret = 0 ; } if ( ret ) { if ( ! i . prefix [ q ] ) ++ i . prefixes ; i . prefix [ q ] |= prefix ; } else as_bad ( _ ( " " ) ) ; return ret ; }
Returns 0 if attempting to add a prefix where one from the same
class already exists, 1 if non rep/repne added, 2 if rep/repne
added.
Returns 0 if attempting to add a prefix where one from the same class already exists 1 if non rep / repne added 2 if rep / repne added .
/* fall thru */