Commit 51ba4180 authored by Avi Kivity's avatar Avi Kivity
Browse files

Test for REPE/SCAS with ZF initially clear



REPE tests ZF after the string instruction is executed.  Try it with ZF
initially clear to make sure.

Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 80a4ea7b
...@@ -53,6 +53,13 @@ void test_cmps_one(unsigned char *m1, unsigned char *m3) ...@@ -53,6 +53,13 @@ void test_cmps_one(unsigned char *m1, unsigned char *m3)
: : "cc"); : : "cc");
report("repe/cmpsb (1)", rcx == 0 && rsi == m1 + 30 && rdi == m3 + 30); report("repe/cmpsb (1)", rcx == 0 && rsi == m1 + 30 && rdi == m3 + 30);
rsi = m1; rdi = m3; rcx = 30;
asm volatile("or $1, %[tmp]\n\t" // clear ZF
"repe/cmpsb"
: "+S"(rsi), "+D"(rdi), "+c"(rcx), [tmp]"=&r"(tmp)
: : "cc");
report("repe/cmpsb (1.zf)", rcx == 0 && rsi == m1 + 30 && rdi == m3 + 30);
rsi = m1; rdi = m3; rcx = 15; rsi = m1; rdi = m3; rcx = 15;
asm volatile("xor %[tmp], %[tmp] \n\t" asm volatile("xor %[tmp], %[tmp] \n\t"
"repe/cmpsw" "repe/cmpsw"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment