summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-12 21:58:51 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-12 21:58:51 -0700
commitcb9b690ae6d4bc7124faa9600cb10320d288143b (patch)
tree262b89b46318a1ab85d850c4cf9880ab51feb219 /assemble.c
parentdaffd793726d852001ba1fef3b7b0d87d5396bf1 (diff)
downloadnasm-cb9b690ae6d4bc7124faa9600cb10320d288143b.tar.gz
Add (untested!) SSSE3, SSE4.1, SSE4.2 instructions
Add the SSSE3, SSE4.1 and SSE4.2 instruction sets. Change \332 to be a literal 0xF2 prefix, by analog with \333 for 0xF3 prefix (the previous \332 flag changed to \335). This is necessary to get the REX prefix in the right place for instructions that use it. We are going to have to go in and change existing instruction patterns which use these, as well.
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/assemble.c b/assemble.c
index 9288aab9..54522712 100644
--- a/assemble.c
+++ b/assemble.c
@@ -64,10 +64,10 @@
* to the condition code value of the instruction.
* \331 - instruction not valid with REP prefix. Hint for
* disassembler only; for SSE instructions.
- * \332 - disassemble a rep (0xF3 byte) prefix as repe not rep.
- * \333 - REP prefix (0xF3 byte); for SSE instructions. Not encoded
- * as a literal byte in order to aid the disassembler.
+ * \332 - REP prefix (0xF2 byte) used as opcode extension.
+ * \333 - REP prefix (0xF3 byte) used as opcode extension.
* \334 - LOCK prefix used instead of REX.R
+ * \335 - disassemble a rep (0xF3 byte) prefix as repe not rep.
* \340 - reserve <operand 0> bytes of uninitialized storage.
* Operand 0 had better be a segmentless constant.
* \364 - operand-size prefix (0x66) not permitted
@@ -862,8 +862,8 @@ static int32_t calcsize(int32_t segment, int32_t offset, int bits,
codes++, length++;
break;
case 0331:
- case 0332:
break;
+ case 0332:
case 0333:
length++;
break;
@@ -871,6 +871,8 @@ static int32_t calcsize(int32_t segment, int32_t offset, int bits,
assert_no_prefix(ins, P_LOCK);
ins->rex |= REX_L;
break;
+ case 0335:
+ break;
case 0340:
case 0341:
case 0342:
@@ -1360,11 +1362,11 @@ static void gencode(int32_t segment, int32_t offset, int bits,
break;
case 0331:
- case 0332:
break;
+ case 0332:
case 0333:
- *bytes = 0xF3;
+ *bytes = c - 0332 + 0xF2;
out(offset, segment, bytes, OUT_RAWDATA + 1, NO_SEG, NO_SEG);
offset += 1;
break;
@@ -1378,6 +1380,9 @@ static void gencode(int32_t segment, int32_t offset, int bits,
ins->rex &= ~(REX_L|REX_R);
break;
+ case 0335:
+ break;
+
case 0340:
case 0341:
case 0342: