From: Gleb Natapov <[email protected]>
Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
diff --git a/kvm/user/test/x86/emulator.c b/kvm/user/test/x86/emulator.c
index c6adbb5..db84c13 100644
--- a/kvm/user/test/x86/emulator.c
+++ b/kvm/user/test/x86/emulator.c
@@ -17,18 +17,11 @@ void report(const char *name, int result)
}
}
-void test_cmps(void *mem)
+void test_cmps_one(unsigned char *m1, unsigned char *m3)
{
- unsigned char *m1 = mem, *m2 = mem + 1024;
- unsigned char m3[1024];
void *rsi, *rdi;
long rcx, tmp;
- for (int i = 0; i < 100; ++i)
- m1[i] = m2[i] = m3[i] = i;
- for (int i = 100; i < 200; ++i)
- m1[i] = (m3[i] = m2[i] = i) + 1;
-
rsi = m1; rdi = m3; rcx = 30;
asm volatile("xor %[tmp], %[tmp] \n\t"
"repe/cmpsb"
@@ -91,6 +84,19 @@ void test_cmps(void *mem)
}
+void test_cmps(void *mem)
+{
+ unsigned char *m1 = mem, *m2 = mem + 1024;
+ unsigned char m3[1024];
+
+ for (int i = 0; i < 100; ++i)
+ m1[i] = m2[i] = m3[i] = i;
+ for (int i = 100; i < 200; ++i)
+ m1[i] = (m3[i] = m2[i] = i) + 1;
+ test_cmps_one(m1, m3);
+ test_cmps_one(m1, m2);
+}
+
void test_cr8(void)
{
unsigned long src, dst;
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html