]> granicus.if.org Git - yasm/commitdiff
Add movbe instruction and CPU feature.
authorPeter Johnson <peter@tortall.net>
Thu, 16 Oct 2008 02:44:49 +0000 (02:44 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 16 Oct 2008 02:44:49 +0000 (02:44 -0000)
Noticed by: Mark Charney

svn path=/trunk/yasm/; revision=2156

modules/arch/x86/gen_x86_insn.py
modules/arch/x86/tests/Makefile.inc
modules/arch/x86/tests/movbe.asm [new file with mode: 0644]
modules/arch/x86/tests/movbe.hex [new file with mode: 0644]
modules/arch/x86/x86arch.h
modules/arch/x86/x86cpu.gperf

index 6397d9c97079dc403c2c04a1c430201955cf5e5b..95202d01859c4a86a326cda80ca4ef40a9805138 100755 (executable)
@@ -7039,6 +7039,24 @@ add_insn("xsave", "twobytemem", modifiers=[4, 0x0F, 0xAE],
 add_insn("xrstor", "twobytemem", modifiers=[5, 0x0F, 0xAE],
          cpu=["XSAVE", "386"])
 
+#####################################################################
+# Intel MOVBE instruction
+#####################################################################
+for sz in (16, 32, 64):
+    add_group("movbe",
+        cpu=["MOVBE"],
+        opersize=sz,
+        opcode=[0x0F, 0x38, 0xF0],
+        operands=[Operand(type="Reg", size=sz, dest="Spare"),
+                  Operand(type="Mem", size=sz, relaxed=True, dest="EA")])
+    add_group("movbe",
+        cpu=["MOVBE"],
+        opersize=sz,
+        opcode=[0x0F, 0x38, 0xF1],
+        operands=[Operand(type="Mem", size=sz, relaxed=True, dest="EA"),
+                  Operand(type="Reg", size=sz, dest="Spare")])
+add_insn("movbe", "movbe")
+
 #####################################################################
 # AMD 3DNow! instructions
 #####################################################################
index 4f83c1edf3b01fd92d980dac4c34d41de7a518da..687fb31a3cc9600e87dbfad7d06d31bc54a4cbbd 100644 (file)
@@ -101,6 +101,8 @@ EXTRA_DIST += modules/arch/x86/tests/mem64rip.asm
 EXTRA_DIST += modules/arch/x86/tests/mem64rip.hex
 EXTRA_DIST += modules/arch/x86/tests/mixcase.asm
 EXTRA_DIST += modules/arch/x86/tests/mixcase.hex
+EXTRA_DIST += modules/arch/x86/tests/movbe.asm
+EXTRA_DIST += modules/arch/x86/tests/movbe.hex
 EXTRA_DIST += modules/arch/x86/tests/movdq32.asm
 EXTRA_DIST += modules/arch/x86/tests/movdq32.hex
 EXTRA_DIST += modules/arch/x86/tests/movdq64.asm
diff --git a/modules/arch/x86/tests/movbe.asm b/modules/arch/x86/tests/movbe.asm
new file mode 100644 (file)
index 0000000..637524a
--- /dev/null
@@ -0,0 +1,20 @@
+[bits 64]
+movbe cx, [5]
+movbe cx, word [5]
+movbe ecx, [5]
+movbe ecx, dword [5]
+movbe rcx, [5]
+movbe rcx, qword [5]
+movbe r9, [5]
+movbe r9, qword [5]
+movbe [5], bx
+movbe word [5], bx
+movbe [5], ebx
+movbe dword [5], ebx
+movbe [5], r10d
+movbe dword [5], r10d
+movbe [5], rbx
+movbe qword [5], rbx
+movbe [5], r10
+movbe qword [5], r10
+
diff --git a/modules/arch/x86/tests/movbe.hex b/modules/arch/x86/tests/movbe.hex
new file mode 100644 (file)
index 0000000..108bedf
--- /dev/null
@@ -0,0 +1,176 @@
+66 
+0f 
+38 
+f0 
+0c 
+25 
+05 
+00 
+00 
+00 
+66 
+0f 
+38 
+f0 
+0c 
+25 
+05 
+00 
+00 
+00 
+0f 
+38 
+f0 
+0c 
+25 
+05 
+00 
+00 
+00 
+0f 
+38 
+f0 
+0c 
+25 
+05 
+00 
+00 
+00 
+48 
+0f 
+38 
+f0 
+0c 
+25 
+05 
+00 
+00 
+00 
+48 
+0f 
+38 
+f0 
+0c 
+25 
+05 
+00 
+00 
+00 
+4c 
+0f 
+38 
+f0 
+0c 
+25 
+05 
+00 
+00 
+00 
+4c 
+0f 
+38 
+f0 
+0c 
+25 
+05 
+00 
+00 
+00 
+66 
+0f 
+38 
+f1 
+1c 
+25 
+05 
+00 
+00 
+00 
+66 
+0f 
+38 
+f1 
+1c 
+25 
+05 
+00 
+00 
+00 
+0f 
+38 
+f1 
+1c 
+25 
+05 
+00 
+00 
+00 
+0f 
+38 
+f1 
+1c 
+25 
+05 
+00 
+00 
+00 
+44 
+0f 
+38 
+f1 
+14 
+25 
+05 
+00 
+00 
+00 
+44 
+0f 
+38 
+f1 
+14 
+25 
+05 
+00 
+00 
+00 
+48 
+0f 
+38 
+f1 
+1c 
+25 
+05 
+00 
+00 
+00 
+48 
+0f 
+38 
+f1 
+1c 
+25 
+05 
+00 
+00 
+00 
+4c 
+0f 
+38 
+f1 
+14 
+25 
+05 
+00 
+00 
+00 
+4c 
+0f 
+38 
+f1 
+14 
+25 
+05 
+00 
+00 
+00 
index adcc87eae9388e171b1165b19febc753fe7d7240..41cde2192fd8e47990dff6077dee6553ba027c0a 100644 (file)
@@ -70,6 +70,7 @@
 #define CPU_FMA     36      /* Intel Fused-Multiply-Add Extensions */
 #define CPU_AES     37      /* AES instruction */
 #define CPU_CLMUL   38      /* PCLMULQDQ instruction */
+#define CPU_MOVBE   39      /* MOVBE instruction */
 
 typedef struct yasm_arch_x86 {
     yasm_arch_base arch;        /* base structure */
index 526e1569c2e1006bf8cc3d0c82bf97f257ffc925..29c0f49d0d18e630a497e89eac144c7de05661cd 100644 (file)
@@ -350,6 +350,8 @@ clmul,              x86_cpu_set,    CPU_CLMUL
 noclmul,       x86_cpu_clear,  CPU_CLMUL
 pclmulqdq,     x86_cpu_set,    CPU_CLMUL
 nopclmulqdq,   x86_cpu_clear,  CPU_CLMUL
+movbe,         x86_cpu_set,    CPU_MOVBE
+nomovbe,       x86_cpu_clear,  CPU_MOVBE
 %%
 
 void