summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2013-02-20 14:14:46 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2013-02-20 14:14:46 -0500
commite515fb1e0ccc6d6c195f48e7fc886d309cc2d9ea (patch)
tree559e79693912de9c88bb25d7865d8654364b5503
parentc91ca59b55cf71305be238be9d55e71d2581bd63 (diff)
Support for cbw, cwde, cdqe
-rw-r--r--simplex86.c5
-rw-r--r--simplex86.h3
-rw-r--r--testsuite.c15
3 files changed, 22 insertions, 1 deletions
diff --git a/simplex86.c b/simplex86.c
index 584064f..731966c 100644
--- a/simplex86.c
+++ b/simplex86.c
@@ -188,7 +188,10 @@ static const variant_t variants[] =
{ I_vzeroall, { 0 }, F_AVX, E_NP, 0x77, VEX(256,0x00,0x0f,WIG) },
{ I_clc, { 0 }, F_386, E_NP, 0xf8 },
{ I_cld, { 0 }, F_386, E_NP, 0xfc },
-
+ { I_cbw, { 0 }, F_386, E_NP, 0x98, PRE_66 },
+ { I_cwde, { 0 }, F_386, E_NP, 0x98 },
+ { I_cdqe, { 0 }, F_386, E_NP, 0x4898 }, /* 0x48 is REX.W */
+
{ I_clflush, { A_MEM }, F_CLFLUSH, E_M, 0x0fae, 7 },
{ I_push, { A_R }, F_386, E_O, 0x50, NO_REX_W },
diff --git a/simplex86.h b/simplex86.h
index 09aec20..f2b29d0 100644
--- a/simplex86.h
+++ b/simplex86.h
@@ -260,6 +260,9 @@ typedef enum
PROCESS_INSTRUCTION (dd, 1) \
PROCESS_INSTRUCTION (dw, 1) \
PROCESS_INSTRUCTION (db, 1) \
+ PROCESS_INSTRUCTION (cbw, 0) \
+ PROCESS_INSTRUCTION (cwde, 0) \
+ PROCESS_INSTRUCTION (cdqe, 0) \
PROCESS_INSTRUCTION (label, 1) \
PROCESS_INSTRUCTION (align, 1) \
PROCESS_INSTRUCTION (lock, 0) \
diff --git a/testsuite.c b/testsuite.c
index d6d67d6..857090c 100644
--- a/testsuite.c
+++ b/testsuite.c
@@ -90,6 +90,20 @@ test_float (assembler_t *as)
}
static uint8_t *
+test_convert (assembler_t *as)
+{
+ fragment_t *frag = fragment_new (as);
+
+ BEGIN_ASM (frag)
+ I_cbw,
+ I_cwde,
+ I_cdqe,
+ END_ASM ();
+
+ return assembler_link (as, frag, NULL);
+}
+
+static uint8_t *
test_misc (assembler_t *as)
{
fragment_t *frag = fragment_new (as);
@@ -313,6 +327,7 @@ main ()
success &= run_test (as, "avx_supported", avx_supported, 0xeeaec30c);
success &= run_test (as, "test_shifts", test_shifts, 0xe74b59f);
success &= run_test (as, "test_float", test_float, 0x125b8865 );
+ success &= run_test (as, "test_convert", test_convert, 0x811430e7);
success &= run_test (as, "test_misc", test_misc, 0xc6b9051f);
if (success)