Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
linux-arm
kvm-unit-tests-ae
Commits
80a4ea7b
Commit
80a4ea7b
authored
Aug 17, 2010
by
Avi Kivity
Browse files
Test non-repeated scas
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
ea7d43d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
x86/emulator.c
View file @
80a4ea7b
...
...
@@ -121,6 +121,46 @@ void test_cmps(void *mem)
test_cmps_one
(
m1
,
m2
);
}
void
test_scas
(
void
*
mem
)
{
bool
z
;
void
*
di
;
*
(
ulong
*
)
mem
=
0x77665544332211
;
di
=
mem
;
asm
(
"scasb; setz %0"
:
"=rm"
(
z
),
"+D"
(
di
)
:
"a"
(
0xff11
));
report
(
"scasb match"
,
di
==
mem
+
1
&&
z
);
di
=
mem
;
asm
(
"scasb; setz %0"
:
"=rm"
(
z
),
"+D"
(
di
)
:
"a"
(
0xff54
));
report
(
"scasb mismatch"
,
di
==
mem
+
1
&&
!
z
);
di
=
mem
;
asm
(
"scasw; setz %0"
:
"=rm"
(
z
),
"+D"
(
di
)
:
"a"
(
0xff2211
));
report
(
"scasw match"
,
di
==
mem
+
2
&&
z
);
di
=
mem
;
asm
(
"scasw; setz %0"
:
"=rm"
(
z
),
"+D"
(
di
)
:
"a"
(
0xffdd11
));
report
(
"scasw mismatch"
,
di
==
mem
+
2
&&
!
z
);
di
=
mem
;
asm
(
"scasl; setz %0"
:
"=rm"
(
z
),
"+D"
(
di
)
:
"a"
(
0xff44332211ul
));
report
(
"scasd match"
,
di
==
mem
+
4
&&
z
);
di
=
mem
;
asm
(
"scasl; setz %0"
:
"=rm"
(
z
),
"+D"
(
di
)
:
"a"
(
0x45332211
));
report
(
"scasd mismatch"
,
di
==
mem
+
4
&&
!
z
);
di
=
mem
;
asm
(
"scasq; setz %0"
:
"=rm"
(
z
),
"+D"
(
di
)
:
"a"
(
0x77665544332211ul
));
report
(
"scasq match"
,
di
==
mem
+
8
&&
z
);
di
=
mem
;
asm
(
"scasq; setz %0"
:
"=rm"
(
z
),
"+D"
(
di
)
:
"a"
(
3
));
report
(
"scasq mismatch"
,
di
==
mem
+
8
&&
!
z
);
}
void
test_cr8
(
void
)
{
unsigned
long
src
,
dst
;
...
...
@@ -506,6 +546,7 @@ int main()
report
(
"mov reg, r/m (1)"
,
t2
==
0x123456789abcdef
);
test_cmps
(
mem
);
test_scas
(
mem
);
test_push
(
mem
);
test_pop
(
mem
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment