diff options
author | Jan Hubicka <jh@suse.cz> | 2001-01-05 12:30:12 +0000 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2001-01-05 12:30:12 +0000 |
commit | 7bc70a8e576bfebc3e3b50a5866527e246a40e4d (patch) | |
tree | a8cf90002bb5f537220a691bb18824d991557ceb /gas | |
parent | 52b15da39a3b3394be9c57d365a7c375533e5198 (diff) | |
download | gdb-7bc70a8e576bfebc3e3b50a5866527e246a40e4d.zip gdb-7bc70a8e576bfebc3e3b50a5866527e246a40e4d.tar.gz gdb-7bc70a8e576bfebc3e3b50a5866527e246a40e4d.tar.bz2 |
* tc-i386.c (md_assemble): Handle third byte of the opcode as prefix.
* i386.h (i386_optab): Make [sml]fence template to use immext field.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 4 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 24 |
2 files changed, 10 insertions, 18 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 24c1561..b97f759 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +Fri Jan 5 13:26:42 MET 2001 Jan Hubicka <jh@suse.cz> + + * tc-i386.c (md_assemble): Handle third byte of the opcode as prefix. + Thu Jan 4 22:25:26 MET 2001 Jan Hubicka <jh@suse.cz> * tc-i386.c (cpu_arch): Add Pentium4 and modify sledgehammer entry. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index f346ed2..df00e66 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2826,6 +2826,11 @@ md_assemble (line) /* Output normal instructions here. */ unsigned char *q; + /* All opcodes on i386 have eighter 1 or 2 bytes. We may use third + byte for the SSE instructions to specify prefix they require. */ + if (i.tm.base_opcode & 0xff0000) + add_prefix ((i.tm.base_opcode >> 16) & 0xff); + /* The prefix bytes. */ for (q = i.prefix; q < i.prefix + sizeof (i.prefix) / sizeof (i.prefix[0]); @@ -2845,7 +2850,7 @@ md_assemble (line) insn_size += 1; FRAG_APPEND_1_CHAR (i.tm.base_opcode); } - else if (fits_in_unsigned_word (i.tm.base_opcode)) + else { insn_size += 2; p = frag_more (2); @@ -2853,23 +2858,6 @@ md_assemble (line) *p++ = (i.tm.base_opcode >> 8) & 0xff; *p = i.tm.base_opcode & 0xff; } - else - { /* Opcode is either 3 or 4 bytes. */ - if (i.tm.base_opcode & 0xff000000) - { - insn_size += 4; - p = frag_more (4); - *p++ = (i.tm.base_opcode >> 24) & 0xff; - } - else - { - insn_size += 3; - p = frag_more (3); - } - *p++ = (i.tm.base_opcode >> 16) & 0xff; - *p++ = (i.tm.base_opcode >> 8) & 0xff; - *p = (i.tm.base_opcode) & 0xff; - } /* Now the modrm byte and sib byte (if present). */ if (i.tm.opcode_modifier & Modrm) |