[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 134/136] target/i386: check for empty register in FXAM
From: |
Paolo Bonzini |
Subject: |
[PULL 134/136] target/i386: check for empty register in FXAM |
Date: |
Tue, 25 Feb 2020 13:07:32 +0100 |
The fxam instruction returns the wrong result after fdecstp or after
an underflow. Check fptags to handle this.
Reported-by: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target/i386/fpu_helper.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/target/i386/fpu_helper.c b/target/i386/fpu_helper.c
index 99f28f2..792a128 100644
--- 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) {
--
1.8.3.1
- [PULL 126/136] hw/riscv: Let devices own the MemoryRegion they create, (continued)
- [PULL 126/136] hw/riscv: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 128/136] hw/input/milkymist-softusb: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 130/136] hw/block/onenand: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 131/136] memory: batch allocate ioeventfds[] in address_space_update_ioeventfds(), Paolo Bonzini, 2020/02/25
- [PULL 135/136] accel/kvm: Check ioctl(KVM_SET_USER_MEMORY_REGION) return value, Paolo Bonzini, 2020/02/25
- [PULL 136/136] WHPX: Assigning maintainer for Windows Hypervisor Platform, Paolo Bonzini, 2020/02/25
- [PULL 120/136] scripts/cocci: Patch to let devices own their MemoryRegions, Paolo Bonzini, 2020/02/25
- [PULL 125/136] hw/dma: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 133/136] qdev-monitor: Forbid repeated device_del, Paolo Bonzini, 2020/02/25
- [PULL 129/136] hw/net/milkymist-minimac2: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/02/25
- [PULL 134/136] target/i386: check for empty register in FXAM,
Paolo Bonzini <=
- [PULL 132/136] mem-prealloc: optimize large guest startup, Paolo Bonzini, 2020/02/25
- Re: [PULL 000/136] Misc patches for 2020-02-25 (refactoring and Coccinelle edition), Aleksandar Markovic, 2020/02/26