[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PATCH v3 02/15] s390x/tcg: Fix rounding from float128 to u
From: |
David Hildenbrand |
Subject: |
[qemu-s390x] [PATCH v3 02/15] s390x/tcg: Fix rounding from float128 to uint64_t/uin32_t |
Date: |
Mon, 18 Feb 2019 13:26:57 +0100 |
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>
---
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 0e9247bf7e..21236caed8 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] [PATCH v3 00/15] s390x/tcg: Implement floating-point extension facility, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 01/15] s390x/tcg: Fix TEST DATA CLASS instructions, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 02/15] s390x/tcg: Fix rounding from float128 to uint64_t/uin32_t,
David Hildenbrand <=
- [qemu-s390x] [PATCH v3 04/15] s390x/tcg: Fix parts of IEEE exception handling, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 05/15] s390x/tcg: Hide IEEE underflows in some scenarios, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 03/15] s390x/tcg: Factor out conversion of softfloat exceptions, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 06/15] s390x/tcg: Refactor SET FPC AND SIGNAL handling, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 07/15] s390x/tcg: Fix simulated-IEEE exceptions, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 08/15] s390x/tcg: Handle SET FPC AND LOAD FPC 3-bit BFP rounding modes, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 09/15] s390x/tcg: Check for exceptions in SET BFP ROUNDING MODE, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 10/15] s390x/tcg: Refactor saving/restoring the bfp rounding mode, David Hildenbrand, 2019/02/18
- [qemu-s390x] [PATCH v3 11/15] s390x/tcg: Prepare for IEEE-inexact-exception control (XxC), David Hildenbrand, 2019/02/18