[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 087/111] m68k: fcmp correctly compares infinity.
From: |
Bryce Lanham |
Subject: |
[Qemu-devel] [PATCH 087/111] m68k: fcmp correctly compares infinity. |
Date: |
Wed, 17 Aug 2011 15:47:32 -0500 |
From: Laurent Vivier <address@hidden>
seen with gcc testsuite,
gcc-4.1.2/gcc/testsuite/gcc.c-torture/execute/960405-1.c
Signed-off-by: Laurent Vivier <address@hidden>
---
target-m68k/helper.c | 4 ++--
tests/m68k/Makefile | 2 +-
tests/m68k/inf.S | 17 +++++++++++++++++
3 files changed, 20 insertions(+), 3 deletions(-)
create mode 100644 tests/m68k/inf.S
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 62aadfd..6cc4202 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -1581,8 +1581,8 @@ void HELPER(fcmp_FP0_FP1)(CPUState *env)
/* +/-inf compares equal against itself, but sub returns nan. */
if (!floatx80_is_any_nan(FP0_to_floatx80(env))
&& !floatx80_is_any_nan(FP1_to_floatx80(env))) {
- if (floatx80_lt_quiet(FP1_to_floatx80(env), floatx80_zero,
- &env->fp_status))
+ res = floatx80_zero;
+ if (floatx80_lt_quiet(FP1_to_floatx80(env), res, &env->fp_status))
res = floatx80_chs(res);
}
}
diff --git a/tests/m68k/Makefile b/tests/m68k/Makefile
index d043aeb..27525d3 100644
--- a/tests/m68k/Makefile
+++ b/tests/m68k/Makefile
@@ -1,5 +1,5 @@
TESTS=fmovecr fmove fmovem fsub fdiv fmul fabs fgetexp fscale flogn fetox \
- bfins
+ bfins inf
all: $(TESTS)
diff --git a/tests/m68k/inf.S b/tests/m68k/inf.S
new file mode 100644
index 0000000..2b2de84
--- /dev/null
+++ b/tests/m68k/inf.S
@@ -0,0 +1,17 @@
+ .include "trap.i"
+
+ .data
+X: .long 0x7ffe0000, 0x80000000, 0x00000000
+
+ .text
+ .globl _start
+_start:
+ fmove.x X, %fp0
+ fmove.x X, %fp1
+ fadd.x %fp0, %fp1
+ fmul.l #2,%fp0
+ fcmp.x %fp0, %fp1
+ fbeq a
+ nop
+a:
+ exit 0
--
1.7.2.3
- [Qemu-devel] [PATCH 040/111] m68k: add sbcd instruction, (continued)
- [Qemu-devel] [PATCH 040/111] m68k: add sbcd instruction, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 082/111] m68k: add fmod instruction, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 068/111] m68k: correct addsubq, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 053/111] m68k: for bitfield opcodes, correct operands corruption, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 057/111] m68k: correctly compute divsl, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 027/111] m68k: add DBcc instruction., Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 083/111] m68k: flush flags before negx instruction., Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 084/111] m68k: correct fmovemx FP registers order., Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 047/111] m68k: use read_imm1() when it is possible, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 079/111] m68k: add fsin instruction, Bryce Lanham, 2011/08/17
- [Qemu-devel] [PATCH 087/111] m68k: fcmp correctly compares infinity.,
Bryce Lanham <=
- Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, Anthony Liguori, 2011/08/17
- Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, Bryce Lanham, 2011/08/17
- Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, Laurent Vivier, 2011/08/18
- Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, François Revol, 2011/08/18
- Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, Laurent Vivier, 2011/08/18
- Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, Natalia Portillo, 2011/08/18
- Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, Laurent Vivier, 2011/08/18
- Re: [Qemu-devel] [RFC][PATCH 000/111] QEMU m68k core additions, Natalia Portillo, 2011/08/18