~ubuntu-branches/ubuntu/hoary/binutils/hoary

« back to all changes in this revision

Viewing changes to gas/config/tc-i386.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-03-18 13:07:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050318130752-j4i37zgqclj53b94
Tags: 2.15-5ubuntu2
debian/rules: Call pkgstriptranslations if present (the package does not
use debhelper, thus it does not happen automatically).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* i386.c -- Assemble code for the Intel 80386
2
2
   Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3
 
   2000, 2001, 2002, 2003
 
3
   2000, 2001, 2002, 2003, 2004
4
4
   Free Software Foundation, Inc.
5
5
 
6
6
   This file is part of GAS, the GNU Assembler.
23
23
/* Intel 80386 machine specific gas.
24
24
   Written by Eliot Dresselhaus (eliot@mgm.mit.edu).
25
25
   x86_64 support by Jan Hubicka (jh@suse.cz)
 
26
   VIA PadLock support by Michal Ludvig (mludvig@suse.cz)
26
27
   Bugs & suggestions are completely welcome.  This is free software.
27
28
   Please help us make it better.  */
28
29
 
239
240
#define is_identifier_char(x) (identifier_chars[(unsigned char) x])
240
241
#define is_digit_char(x) (digit_chars[(unsigned char) x])
241
242
 
242
 
/* All non-digit non-letter charcters that may occur in an operand.  */
 
243
/* All non-digit non-letter characters that may occur in an operand.  */
243
244
static char operand_special_chars[] = "%$-+(,)*._~/<>|&^!:[@]";
244
245
 
245
246
/* md_assemble() always leaves the strings it's passed unaltered.  To
1225
1226
      && fixP->fx_pcrel)
1226
1227
    return 0;
1227
1228
 
 
1229
  /* The x86_64 GOTPCREL are represented as 32bit PCrel relocations
 
1230
     and changed later by validate_fix.  */
 
1231
  if (GOT_symbol && fixP->fx_subsy == GOT_symbol
 
1232
      && fixP->fx_r_type == BFD_RELOC_32_PCREL)
 
1233
    return 0;
 
1234
 
1228
1235
  /* adjust_reloc_syms doesn't know about the GOT.  */
1229
1236
  if (fixP->fx_r_type == BFD_RELOC_386_GOTOFF
1230
1237
      || fixP->fx_r_type == BFD_RELOC_386_PLT32
1373
1380
 
1374
1381
      if ((i.tm.cpu_flags & CpuPNI) && i.operands > 0)
1375
1382
        {
1376
 
          /* These Intel Precott New Instructions have the fixed
 
1383
          /* These Intel Prescott New Instructions have the fixed
1377
1384
             operands with an opcode suffix which is coded in the same
1378
1385
             place as an 8-bit immediate field would be. Here we check
1379
1386
             those operands and remove them afterwards.  */
3117
3124
  md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2);
3118
3125
}
3119
3126
 
3120
 
 
3121
3127
static void
3122
3128
output_insn ()
3123
3129
{
3145
3151
      char *p;
3146
3152
      unsigned char *q;
3147
3153
 
3148
 
      /* All opcodes on i386 have either 1 or 2 bytes.  We may use third
3149
 
         byte for the SSE instructions to specify a prefix they require.  */
3150
 
      if (i.tm.base_opcode & 0xff0000)
3151
 
        add_prefix ((i.tm.base_opcode >> 16) & 0xff);
 
3154
      /* All opcodes on i386 have either 1 or 2 bytes, PadLock instructions
 
3155
         have 3 bytes.  We may use one more higher byte to specify a prefix
 
3156
         the instruction requires.  */
 
3157
      if ((i.tm.cpu_flags & CpuPadLock) != 0
 
3158
          && (i.tm.base_opcode & 0xff000000) != 0)
 
3159
        {
 
3160
          unsigned int prefix;
 
3161
          prefix = (i.tm.base_opcode >> 24) & 0xff;
 
3162
 
 
3163
          if (prefix != REPE_PREFIX_OPCODE
 
3164
              || i.prefix[LOCKREP_PREFIX] != REPE_PREFIX_OPCODE)
 
3165
            add_prefix (prefix);
 
3166
        }
 
3167
      else
 
3168
        if ((i.tm.cpu_flags & CpuPadLock) == 0
 
3169
            && (i.tm.base_opcode & 0xff0000) != 0)
 
3170
          add_prefix ((i.tm.base_opcode >> 16) & 0xff);
3152
3171
 
3153
3172
      /* The prefix bytes.  */
3154
3173
      for (q = i.prefix;
3169
3188
        }
3170
3189
      else
3171
3190
        {
3172
 
          p = frag_more (2);
 
3191
          if ((i.tm.cpu_flags & CpuPadLock) != 0)
 
3192
            {
 
3193
              p = frag_more (3);
 
3194
              *p++ = (i.tm.base_opcode >> 16) & 0xff;
 
3195
            }
 
3196
          else
 
3197
            p = frag_more (2);
 
3198
 
3173
3199
          /* Put out high byte first: can't use md_number_to_chars!  */
3174
3200
          *p++ = (i.tm.base_opcode >> 8) & 0xff;
3175
3201
          *p = i.tm.base_opcode & 0xff;
4626
4652
    }
4627
4653
 
4628
4654
  /* Fix a few things - the dynamic linker expects certain values here,
4629
 
     and we must not dissappoint it.  */
 
4655
     and we must not disappoint it.  */
4630
4656
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
4631
4657
  if (OUTPUT_FLAVOR == bfd_target_elf_flavour
4632
4658
      && fixP->fx_addsy)