qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [RFC PATCH for 2.11 12/23] target/arm/translate-a64.c: ad


From: Richard Henderson
Subject: Re: [Qemu-arm] [RFC PATCH for 2.11 12/23] target/arm/translate-a64.c: add FP16 FAGCT to AdvSIMD 3 Same
Date: Thu, 20 Jul 2017 09:35:40 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/20/2017 05:04 AM, Alex Bennée wrote:
+static softfloat_flags softfloat_mapping_table[] = {
+    { float_flag_inexact  , softfloat_flag_inexact },
+    { float_flag_underflow, softfloat_flag_underflow },
+    { float_flag_overflow , softfloat_flag_overflow },
+    { float_flag_invalid  , softfloat_flag_invalid },
+};
+/* FIXME: 2a has no infinite flag */
+
+static uint8_t sync_softfloat_flags_from_2a(float_status *flags2a)
+{
+    uint8_t flags = flags2a->float_exception_flags;
+    int i;
+    if (flags) {
+        for (i = 0; i < ARRAY_SIZE(softfloat_mapping_table); i++) {
+            struct softfloat_flags *map = &softfloat_mapping_table[i];
+            if (flags & map->float2a_flag) {
+                softfloat_raiseFlags(map->float3c_flag);
+            }
+        }
+    } else {
+        softfloat_exceptionFlags = 0;
+    }
+
+    return softfloat_exceptionFlags;
+}
+

For conversions like this IMO it's better to make the compiler do the work. C.f. target/alpha/fpu_helper.c and CONVERT_BIT.

BTW, I think these TLS variables that softfloat3a are using are going to be a real problem. It's one thing to do it temporarily like you are here, coordinating between 2a and 3c, but later, when the front end is fully converted? That's just nonsense.

Is it going to be worthwhile to significantly hack up the incoming sources?

If so, then we might do something like this:  Given a 3c function foo,

  T foo_st(T, T, float3a_status *) { ... }
  T foo(T x, T y) { return foo_st(x, y, &tls_status); }

And of course pack all of the relevant state into a struct then

  #define softfloat_exceptionFlags tls_status.exceptionflags

etc, instead of having individual tls variables. This feels like something that we could push back upstream, assuming that upstream is active.


r~



reply via email to

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