* [Qemu-devel] [4184] Check for 3DNow! CPUID at translation time
@ 2008-04-09 6:41 Aurelien Jarno
0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2008-04-09 6:41 UTC (permalink / raw)
To: qemu-devel
Revision: 4184
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4184
Author: aurel32
Date: 2008-04-09 06:41:37 +0000 (Wed, 09 Apr 2008)
Log Message:
-----------
Check for 3DNow! CPUID at translation time
Modified Paths:
--------------
trunk/target-i386/translate.c
Modified: trunk/target-i386/translate.c
===================================================================
--- trunk/target-i386/translate.c 2008-04-08 20:01:34 UTC (rev 4183)
+++ trunk/target-i386/translate.c 2008-04-09 06:41:37 UTC (rev 4184)
@@ -100,6 +100,7 @@
int rip_offset; /* only used in x86_64, but left for simplicity */
int cpuid_features;
int cpuid_ext_features;
+ int cpuid_ext2_features;
} DisasContext;
static void gen_eob(DisasContext *s);
@@ -2649,11 +2650,18 @@
}
if (is_xmm && !(s->flags & HF_OSFXSR_MASK))
goto illegal_op;
- if (b == 0x77 || b == 0x0e) {
- /* emms or femms */
+ if (b == 0x0e) {
+ if (!(s->cpuid_ext2_features & CPUID_EXT2_3DNOW))
+ goto illegal_op;
+ /* femms */
gen_op_emms();
return;
}
+ if (b == 0x77) {
+ /* emms */
+ gen_op_emms();
+ return;
+ }
/* prepare MMX state (XXX: optimize by storing fptt and fptags in
the static cpu state) */
if (!is_xmm) {
@@ -3183,6 +3191,8 @@
}
switch(b) {
case 0x0f: /* 3DNow! data insns */
+ if (!(s->cpuid_ext2_features & CPUID_EXT2_3DNOW))
+ goto illegal_op;
val = ldub_code(s->pc++);
sse_op2 = sse_op_table5[val];
if (!sse_op2)
@@ -6757,6 +6767,7 @@
}
dc->cpuid_features = env->cpuid_features;
dc->cpuid_ext_features = env->cpuid_ext_features;
+ dc->cpuid_ext2_features = env->cpuid_ext2_features;
#ifdef TARGET_X86_64
dc->lma = (flags >> HF_LMA_SHIFT) & 1;
dc->code64 = (flags >> HF_CS64_SHIFT) & 1;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-04-09 6:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09 6:41 [Qemu-devel] [4184] Check for 3DNow! CPUID at translation time Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).