Mon Jun 8 12:20:30 1998 Alan Modra <alan@spri.levels.unisa.edu.au>

* config/tc-i386.c: REPNE renamed to REPNE_PREFIX_OPCODE, and
	likewise for REPE.

	* config/tc-i386.c (reloc): Add braces.

	* config/tc-i386.c (struct _i386_insn): Rename bi to sib to be
	consistent with Intel naming.
	* config/tc-i386.h (base_index_byte): Rename to sib_byte.  Don't
	use bitfields in sib_byte.
	(modrm_byte): Don't use bitfields here either.

	* config/tc-i386.c (current_templates): Add const.
	(parse_register): Add const to return, param, and char *s.
	(i386_operand): Add const to reg_entry *r.
	* config/tc-i386.h (templates): Add const to start, end.

	Inspired by code for 16 bit gas support from Martynas Kunigelis
	<martynas@nm3.ktu.lt>:
	* config/tc-i386.c (md_assemble): Add full support for 16 bit
	modrm, and Jump, JumpByte, JumpDword, JumpInterSegment insns.
	(uses_mem_addrmode): Remove.
	(md_estimate_size_before_relax): Add support here too.
	(md_relax_table): Rewrite interface to md_relax for 16 bit
	support.
	(BYTE, WORD, DWORD, UNKNOWN_SIZE): Remove.
	(opcode_suffix_to_type): Remove.
	(CODE16, SMALL, SMALL16, BIG, BIG16): Define.
	(SIZE_FROM_RELAX_STATE): Modify to suit above.
	(md_convert_frag): Likewise.
	(i386_operand): Add support for 16 bit base/index regs,
	immediates, and displacements.  Remove some unnecessary casts, and
	localise end_of_operand_string, displacement_string_start,
	displacement_string_end variables.  Add GCC_ASM_O_HACK.
	* config/tc-i386.h (NO_BASE_REGISTER_16): Define.

	* config/tc-i386.c (prefix_hash): Remove.
	(md_begin): Rewrite without obstacks.  Remove prefix hash table
	handling.  Rewrite lexical table handling.
	(i386_print_statistics): Don't print prefix statistics.
	(md_assemble): Rewrite instruction parser so that line is not
	converted to lower case.  Don't do a hash_find for prefixes,
	instead recognise them via opcode modifier.
	(expecting_operand, paren_not_balanced): Localise variables.
	* config/tc-i386.h (IsPrefix): Define.
	(prefix_entry): Remove.

	* config/tc-i386.h (PREFIX_SEPERATOR): Don't define.
	* config/tc-i386.c (PREFIX_SEPARATOR): Define here instead, using
	'\\' in case where comment_chars contains '/'.

	* config/tc-i386.c (MATCH): Ensure given operand and template
	match for JumpAbsolute.  Makes e.g. `ljmp table(%ebx)' invalid;
	you must write `ljmp *table(%ebx)'.

	From H.J. Lu <hjl@gnu.org>:
	* config/tc-i386.c (BFD_RELOC_16, BFD_RELOC_16_PCREL): Define
	as 0 ifndef BFD_ASSEMBLER.
	(md_assemble): Allow immediate operands without suffix or
	other reg operand to default in size to the current code size.
This commit is contained in:
Ian Lance Taylor 1998-06-08 17:06:00 +00:00
parent 038915c98c
commit 0351b70c21
3 changed files with 601 additions and 413 deletions

View file

@ -1,3 +1,65 @@
Mon Jun 8 12:20:30 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
* config/tc-i386.c: REPNE renamed to REPNE_PREFIX_OPCODE, and
likewise for REPE.
* config/tc-i386.c (reloc): Add braces.
* config/tc-i386.c (struct _i386_insn): Rename bi to sib to be
consistent with Intel naming.
* config/tc-i386.h (base_index_byte): Rename to sib_byte. Don't
use bitfields in sib_byte.
(modrm_byte): Don't use bitfields here either.
* config/tc-i386.c (current_templates): Add const.
(parse_register): Add const to return, param, and char *s.
(i386_operand): Add const to reg_entry *r.
* config/tc-i386.h (templates): Add const to start, end.
Inspired by code for 16 bit gas support from Martynas Kunigelis
<martynas@nm3.ktu.lt>:
* config/tc-i386.c (md_assemble): Add full support for 16 bit
modrm, and Jump, JumpByte, JumpDword, JumpInterSegment insns.
(uses_mem_addrmode): Remove.
(md_estimate_size_before_relax): Add support here too.
(md_relax_table): Rewrite interface to md_relax for 16 bit
support.
(BYTE, WORD, DWORD, UNKNOWN_SIZE): Remove.
(opcode_suffix_to_type): Remove.
(CODE16, SMALL, SMALL16, BIG, BIG16): Define.
(SIZE_FROM_RELAX_STATE): Modify to suit above.
(md_convert_frag): Likewise.
(i386_operand): Add support for 16 bit base/index regs,
immediates, and displacements. Remove some unnecessary casts, and
localise end_of_operand_string, displacement_string_start,
displacement_string_end variables. Add GCC_ASM_O_HACK.
* config/tc-i386.h (NO_BASE_REGISTER_16): Define.
* config/tc-i386.c (prefix_hash): Remove.
(md_begin): Rewrite without obstacks. Remove prefix hash table
handling. Rewrite lexical table handling.
(i386_print_statistics): Don't print prefix statistics.
(md_assemble): Rewrite instruction parser so that line is not
converted to lower case. Don't do a hash_find for prefixes,
instead recognise them via opcode modifier.
(expecting_operand, paren_not_balanced): Localise variables.
* config/tc-i386.h (IsPrefix): Define.
(prefix_entry): Remove.
* config/tc-i386.h (PREFIX_SEPERATOR): Don't define.
* config/tc-i386.c (PREFIX_SEPARATOR): Define here instead, using
'\\' in case where comment_chars contains '/'.
* config/tc-i386.c (MATCH): Ensure given operand and template
match for JumpAbsolute. Makes e.g. `ljmp table(%ebx)' invalid;
you must write `ljmp *table(%ebx)'.
From H.J. Lu <hjl@gnu.org>:
* config/tc-i386.c (BFD_RELOC_16, BFD_RELOC_16_PCREL): Define
as 0 ifndef BFD_ASSEMBLER.
(md_assemble): Allow immediate operands without suffix or
other reg operand to default in size to the current code size.
start-sanitize-v850e
Mon Jun 8 09:45:00 1998 Catherine Moore <clm@cygnus.com>

File diff suppressed because it is too large Load diff

View file

@ -179,7 +179,6 @@ extern int tc_coff_sizemachdep PARAMS ((fragS *frag));
#define REGISTER_PREFIX '%'
#define IMMEDIATE_PREFIX '$'
#define ABSOLUTE_PREFIX '*'
#define PREFIX_SEPERATOR '/'
#define TWO_BYTE_OPCODE_ESCAPE 0x0f
#define NOP_OPCODE (char) 0x90
@ -194,6 +193,7 @@ extern int tc_coff_sizemachdep PARAMS ((fragS *frag));
#define NO_INDEX_REGISTER ESP_REG_NUM
/* index_base_byte.base for no base register addressing */
#define NO_BASE_REGISTER EBP_REG_NUM
#define NO_BASE_REGISTER_16 6
/* these are the opcode suffixes, making movl --> mov, for example */
#define DWORD_OPCODE_SUFFIX 'l'
@ -322,6 +322,7 @@ typedef struct
#define FWait 0x100000 /* instruction needs FWAIT */
#define IsString 0x200000 /* quick test for string instructions */
#define regKludge 0x400000 /* fake an extra reg operand for clr, imul */
#define IsPrefix 0x800000 /* opcode is a prefix */
#define Ugh 0x80000000 /* deprecated fp insn, gets a warning */
/* operand_types[i] describes the type of operand i. This is made
@ -341,8 +342,8 @@ template;
*/
typedef struct
{
template *start;
template *end;
const template *start;
const template *end;
} templates;
/* these are for register name --> number & type hash lookup */
@ -352,7 +353,6 @@ typedef struct
unsigned int reg_type;
unsigned int reg_num;
}
reg_entry;
typedef struct
@ -360,37 +360,25 @@ typedef struct
char *seg_name;
unsigned int seg_prefix;
}
seg_entry;
/* these are for prefix name --> prefix code hash lookup */
typedef struct
{
char *prefix_name;
unsigned char prefix_code;
}
prefix_entry;
/* 386 operand encoding bytes: see 386 book for details of this. */
typedef struct
{
unsigned regmem:3; /* codes register or memory operand */
unsigned reg:3; /* codes register operand (or extended opcode) */
unsigned mode:2; /* how to interpret regmem & reg */
unsigned int regmem; /* codes register or memory operand */
unsigned int reg; /* codes register operand (or extended opcode) */
unsigned int mode; /* how to interpret regmem & reg */
}
modrm_byte;
/* 386 opcode byte to code indirect addressing. */
typedef struct
{
unsigned base:3;
unsigned index:3;
unsigned scale:2;
unsigned base;
unsigned index;
unsigned scale;
}
base_index_byte;
sib_byte;
/* The name of the global offset table generated by the compiler. Allow
this to be overridden if need be. */