[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 14/27] s390x/tcg: Fix rounding from float128 to uint6
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 14/27] s390x/tcg: Fix rounding from float128 to uint64_t/uint32_t |
Date: |
Mon, 4 Mar 2019 13:01:57 +0100 |
From: David Hildenbrand <address@hidden>
Let's use the proper conversion functions now that we have them.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/fpu_helper.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c
index 0e9247bf7ef4..21236caed869 100644
--- a/target/s390x/fpu_helper.c
+++ b/target/s390x/fpu_helper.c
@@ -509,9 +509,7 @@ uint64_t HELPER(clgdb)(CPUS390XState *env, uint64_t v2,
uint32_t m3)
uint64_t HELPER(clgxb)(CPUS390XState *env, uint64_t h, uint64_t l, uint32_t m3)
{
int hold = swap_round_mode(env, m3);
- float128 v2 = make_float128(h, l);
- /* ??? Not 100% correct. */
- uint64_t ret = float128_to_int64(v2, &env->fpu_status);
+ uint64_t ret = float128_to_uint64(make_float128(h, l), &env->fpu_status);
set_float_rounding_mode(hold, &env->fpu_status);
handle_exceptions(env, GETPC());
return ret;
@@ -541,9 +539,7 @@ uint64_t HELPER(clfdb)(CPUS390XState *env, uint64_t v2,
uint32_t m3)
uint64_t HELPER(clfxb)(CPUS390XState *env, uint64_t h, uint64_t l, uint32_t m3)
{
int hold = swap_round_mode(env, m3);
- float128 v2 = make_float128(h, l);
- /* Not 100% correct. */
- uint32_t ret = float128_to_int64(v2, &env->fpu_status);
+ uint32_t ret = float128_to_uint32(make_float128(h, l), &env->fpu_status);
set_float_rounding_mode(hold, &env->fpu_status);
handle_exceptions(env, GETPC());
return ret;
--
2.17.2
- [qemu-s390x] [PULL 05/27] s390x/vfio-ap: document hot plug/unplug of vfio-ap device, (continued)
- [qemu-s390x] [PULL 05/27] s390x/vfio-ap: document hot plug/unplug of vfio-ap device, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 04/27] s390x/vfio-ap: Implement hot plug/unplug of vfio-ap device, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 08/27] s390x/tcg: Clarify terminology in vec_reg_offset(), Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 06/27] s390x/tcg: RXE has an optional M3 field, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 07/27] s390x/tcg: Simplify disassembler operands initialization, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 10/27] s390x/tcg: Factor out gen_addi_and_wrap_i64() from get_address(), Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 09/27] s390x/tcg: Factor out vec_full_reg_offset(), Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 11/27] s390x/tcg: Implement LOAD LENGTHENED short HFP to long HFP, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 12/27] s390x/tcg: Implement LOAD COUNT TO BLOCK BOUNDARY, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 13/27] s390x/tcg: Fix TEST DATA CLASS instructions, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 14/27] s390x/tcg: Fix rounding from float128 to uint64_t/uint32_t,
Cornelia Huck <=
- [qemu-s390x] [PULL 15/27] s390x/tcg: Factor out conversion of softfloat exceptions, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 17/27] s390x/tcg: Hide IEEE underflows in some scenarios, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 16/27] s390x/tcg: Fix parts of IEEE exception handling, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 18/27] s390x/tcg: Refactor SET FPC AND SIGNAL handling, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 19/27] s390x/tcg: Fix simulated-IEEE exceptions, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 20/27] s390x/tcg: Handle SET FPC AND LOAD FPC 3-bit BFP rounding modes, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 21/27] s390x/tcg: Check for exceptions in SET BFP ROUNDING MODE, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 23/27] s390x/tcg: Prepare for IEEE-inexact-exception control (XxC), Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 22/27] s390x/tcg: Refactor saving/restoring the bfp rounding mode, Cornelia Huck, 2019/03/04
- [qemu-s390x] [PULL 26/27] s390x/tcg: Handle all rounding modes overwritten by BFP instructions, Cornelia Huck, 2019/03/04