qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 01/26] s390x/tcg: Fix FP CONVERT TO (LOGICAL) FIXED NaN ha


From: Richard Henderson
Subject: Re: [PATCH v2 01/26] s390x/tcg: Fix FP CONVERT TO (LOGICAL) FIXED NaN handling
Date: Tue, 1 Jun 2021 14:27:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 5/17/21 7:27 AM, David Hildenbrand wrote:
@@ -634,6 +664,9 @@ uint64_t HELPER(clfxb)(CPUS390XState *env, uint64_t h, 
uint64_t l, uint32_t m34)
s390_restore_bfp_rounding_mode(env, old_mode);
     handle_exceptions(env, xxc_from_m34(m34), GETPC());
+    if (float128_is_any_nan(make_float128(h, l))) {
+        return 0;
+    }

I wonder if handle_exceptions should return s390_exc.
Then you can test

  exc = handle_exceptions(...);
  if (unlikely(exc & S390_IEEE_MASK_INVALID)) {
    ret = 0;
  }
  return ret;



+++ b/target/s390x/vec_fpu_helper.c
@@ -326,6 +326,9 @@ void HELPER(gvec_vcdlg64s)(void *v1, const void *v2, 
CPUS390XState *env,
static uint64_t vcgd64(uint64_t a, float_status *s)
  {
+    if (float64_is_any_nan(a)) {
+        return INT64_MIN;
+    }
      return float64_to_int64(a, s);
  }
@@ -349,6 +352,9 @@ void HELPER(gvec_vcgd64s)(void *v1, const void *v2, CPUS390XState *env, static uint64_t vclgd64(uint64_t a, float_status *s)
  {
+    if (float64_is_any_nan(a)) {
+        return 0;
+    }
      return float64_to_uint64(a, s);
  }

You do still need to raise invalid, as far as I can see.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]