projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cce8944
)
target/i386: check for empty register in FXAM
author
Paolo Bonzini
<pbonzini@redhat.com>
Fri, 21 Feb 2020 16:20:17 +0000
(17:20 +0100)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Tue, 25 Feb 2020 08:18:01 +0000
(09:18 +0100)
The fxam instruction returns the wrong result after fdecstp or after
an underflow. Check fptags to handle this.
Reported-by: <chengang@emindsoft.com.cn>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/fpu_helper.c
patch
|
blob
|
history
diff --git
a/target/i386/fpu_helper.c
b/target/i386/fpu_helper.c
index 99f28f267f60f7b9b1b79bc5461bbcad71d50650..792a128a6da2d6cd2b6b99634c84fe615ef82972 100644
(file)
--- a/
target/i386/fpu_helper.c
+++ b/
target/i386/fpu_helper.c
@@
-991,7
+991,11
@@
void helper_fxam_ST0(CPUX86State *env)
env->fpus |= 0x200; /* C1 <-- 1 */
}
- /* XXX: test fptags too */
+ if (env->fptags[env->fpstt]) {
+ env->fpus |= 0x4100; /* Empty */
+ return;
+ }
+
expdif = EXPD(temp);
if (expdif == MAXEXPD) {
if (MANTD(temp) == 0x8000000000000000ULL) {