aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-06-09 16:21:35 +0000
committerIan Lance Taylor <ian@airs.com>1998-06-09 16:21:35 +0000
commit284f02bba855e37809d001b2ce4c98fce0a8eec0 (patch)
tree9237941ccd1b4ef11bb74a1ce5c2e1f1ef4c2f57 /gas/config
parentb8e4d255f32facce1fad058ed42ff04993706a32 (diff)
downloadgdb-284f02bba855e37809d001b2ce4c98fce0a8eec0.zip
gdb-284f02bba855e37809d001b2ce4c98fce0a8eec0.tar.gz
gdb-284f02bba855e37809d001b2ce4c98fce0a8eec0.tar.bz2
Tue Jun 9 12:20:05 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
* config/tc-i386.h: Change Data16 to Size16, Data32 to Size32, IgnoreDataSize to IgnoreSize as they are used for address size as well as data size. * config/tc-i386.c: Likewise. Add code to reject addr32/data32 in 32-bit mode, similarly addr16/data16 and variants.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c18
-rw-r--r--gas/config/tc-i386.h6
2 files changed, 17 insertions, 7 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index ea2a984..8a41231 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -934,8 +934,18 @@ md_assemble (line)
if (*l != END_OF_INSN
&& current_templates
- && (current_templates->start->opcode_modifier & IsPrefix) != 0)
+ && (current_templates->start->opcode_modifier & IsPrefix))
{
+ /* If we are in 16-bit mode, do not allow addr16 or data16.
+ Similarly, in 32-bit mode, do not allow addr32 or data32. */
+ if ((current_templates->start->opcode_modifier & (Size16 | Size32))
+ && (((current_templates->start->opcode_modifier & Size32) != 0)
+ ^ flag_16bit_code))
+ {
+ as_bad (_("redundant %s prefix"),
+ current_templates->start->name);
+ return;
+ }
/* Add prefix, checking for repeated prefixes. */
switch (add_prefix (current_templates->start->base_opcode))
{
@@ -1246,9 +1256,9 @@ md_assemble (line)
/* If matched instruction specifies an explicit opcode suffix, use
it. */
- if (i.tm.opcode_modifier & (Data16|Data32))
+ if (i.tm.opcode_modifier & (Size16 | Size32))
{
- if (i.tm.opcode_modifier & Data16)
+ if (i.tm.opcode_modifier & Size16)
i.suffix = WORD_OPCODE_SUFFIX;
else
i.suffix = DWORD_OPCODE_SUFFIX;
@@ -1453,7 +1463,7 @@ md_assemble (line)
prefix anyway. */
if ((i.suffix == DWORD_OPCODE_SUFFIX
|| i.suffix == LONG_OPCODE_SUFFIX) == flag_16bit_code
- && !(i.tm.opcode_modifier & IgnoreDataSize))
+ && !(i.tm.opcode_modifier & IgnoreSize))
{
unsigned int prefix = DATA_PREFIX_OPCODE;
if (i.tm.opcode_modifier & JumpByte) /* jcxz, loop */
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index 11a4d32..39f8d14 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -312,9 +312,9 @@ typedef struct
#define FloatD 0x400 /* direction for float insns: MUST BE 0x400 */
#define Seg2ShortForm 0x800 /* encoding of load segment reg insns */
#define Seg3ShortForm 0x1000 /* fs/gs segment register insns. */
-#define Data16 0x2000 /* needs data prefix if in 32-bit mode */
-#define Data32 0x4000 /* needs data prefix if in 16-bit mode */
-#define IgnoreDataSize 0x8000 /* instruction ignores operand size prefix */
+#define Size16 0x2000 /* needs size prefix if in 32-bit mode */
+#define Size32 0x4000 /* needs size prefix if in 16-bit mode */
+#define IgnoreSize 0x8000 /* instruction ignores operand size prefix */
#define No_bSuf 0x10000 /* b suffix on instruction illegal */
#define No_wSuf 0x20000 /* w suffix on instruction illegal */
#define No_lSuf 0x40000 /* l suffix on instruction illegal */