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.
This commit is contained in:
Ian Lance Taylor 1998-06-09 16:21:35 +00:00
parent b8e4d255f3
commit 284f02bba8
3 changed files with 25 additions and 7 deletions

View file

@ -1,3 +1,11 @@
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.
Mon Jun 8 18:32:01 1998 Nick Clifton <nickc@cygnus.com>
* config/tc-d30v.c (md_assemble): Fix handling of reverse

View file

@ -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 */

View file

@ -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 */