From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <rth@twiddle.net>
Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [RFC PATCH for 2.11 12/23] target/arm/translate-a64.c: add FP16 FAGCT to AdvSIMD 3 Same
Date: Fri, 21 Jul 2017 10:56:04 +0100 [thread overview]
Message-ID: <87tw266rm3.fsf@linaro.org> (raw)
In-Reply-To: <4d6ac494-d606-ebaf-6498-7c526467ac62@twiddle.net>
Richard Henderson <rth@twiddle.net> writes:
> 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.
Cool, I'll look at that.
> 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.
Wouldn't the other option to be to drop float_status out of the guests
CPUEnv and grab it from the TLS variable instead? Of course all guests
would need to be MTTCG enabled for that to work.
> 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.
Peter has found what might be an upstream source repository so we can
certainly look at that.
--
Alex Bennée
WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <rth@twiddle.net>
Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH for 2.11 12/23] target/arm/translate-a64.c: add FP16 FAGCT to AdvSIMD 3 Same
Date: Fri, 21 Jul 2017 10:56:04 +0100 [thread overview]
Message-ID: <87tw266rm3.fsf@linaro.org> (raw)
In-Reply-To: <4d6ac494-d606-ebaf-6498-7c526467ac62@twiddle.net>
Richard Henderson <rth@twiddle.net> writes:
> 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.
Cool, I'll look at that.
> 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.
Wouldn't the other option to be to drop float_status out of the guests
CPUEnv and grab it from the TLS variable instead? Of course all guests
would need to be MTTCG enabled for that to work.
> 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.
Peter has found what might be an upstream source repository so we can
certainly look at that.
--
Alex Bennée
next prev parent reply other threads:[~2017-07-21 9:56 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 15:04 [RFC PATCH for 2.11 00/23] Implementing FP16 for ARMv8.2 using SoftFloat2a and 3c Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 01/23] softfloat: move existing softfloat2a into versioned directory Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-23 14:29 ` [Qemu-arm] " Philippe Mathieu-Daudé
2017-07-23 14:29 ` [Qemu-devel] " Philippe Mathieu-Daudé
2017-07-20 15:04 ` [RFC PATCH for 2.11 02/23] fpu: import SoftFloat3c Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-21 9:37 ` Thomas Huth
2017-07-21 9:57 ` Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 03/23] softfloat3c: dos2unix all files Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 18:59 ` Richard Henderson
2017-07-20 18:59 ` [Qemu-devel] " Richard Henderson
2017-07-21 8:22 ` Thomas Huth
2017-07-21 8:56 ` Alex Bennée
2017-07-21 9:22 ` Peter Maydell
2017-07-21 9:44 ` Alex Bennée
2017-07-21 9:27 ` Daniel P. Berrange
2017-07-21 13:31 ` Aurelien Jarno
2017-07-20 15:04 ` [RFC PATCH for 2.11 04/23] softfloat3c: fixup include paths Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 05/23] softfloat3c: initial build machinery Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 19:18 ` Richard Henderson
2017-07-20 19:18 ` [Qemu-devel] " Richard Henderson
2017-07-21 9:32 ` Alex Bennée
2017-07-21 9:32 ` [Qemu-devel] " Alex Bennée
2017-07-21 13:25 ` Aurelien Jarno
2017-07-20 15:04 ` [RFC PATCH for 2.11 06/23] softfloat3c: silence compiler warning Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 07/23] softfloat3c: f16_to_f128M remove unused variable Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 08/23] target-aarch64: enable SoftFloat3 build for FP16 Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 09/23] arm: introduce ARM_V8_FP16 feature bit Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 10/23] target/arm/translate-a64.c: handle_3same_64 comment fix Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 11/23] target/arm/translate-a64.c: AdvSIMD scalar 3 Same FP16 initial decode Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 12/23] target/arm/translate-a64.c: add FP16 FAGCT to AdvSIMD 3 Same Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 19:35 ` Richard Henderson
2017-07-20 19:35 ` [Qemu-devel] " Richard Henderson
2017-07-21 9:56 ` Alex Bennée [this message]
2017-07-21 9:56 ` Alex Bennée
2017-07-21 13:21 ` Aurelien Jarno
2017-07-21 13:50 ` Alex Bennée
2017-07-21 13:58 ` Peter Maydell
2017-07-21 17:43 ` Aurelien Jarno
2017-07-28 13:00 ` Alex Bennée
2017-07-28 13:00 ` [Qemu-devel] " Alex Bennée
2017-07-28 16:07 ` Richard Henderson
2017-07-28 16:07 ` [Qemu-devel] " Richard Henderson
2017-07-20 15:04 ` [RFC PATCH for 2.11 13/23] target/arm/translate-a64.c: add FP16 FADD " Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 19:37 ` Richard Henderson
2017-07-20 19:37 ` [Qemu-devel] " Richard Henderson
2017-07-20 15:04 ` [RFC PATCH for 2.11 14/23] target/arm/translate-a64.c: add ARMv8.2 fadd scalar half-precision Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 19:40 ` Richard Henderson
2017-07-20 19:40 ` [Qemu-devel] " Richard Henderson
2017-07-21 9:58 ` Alex Bennée
2017-07-21 9:58 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 15/23] target/arm/translate-a64.c: AdvSIMD scalar 2 register misc decode Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 19:49 ` Richard Henderson
2017-07-20 19:49 ` [Qemu-devel] " Richard Henderson
2017-07-21 9:35 ` Alex Bennée
2017-07-21 9:35 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 16/23] include/exec/helper-head.h: support f16 in helper calls Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 17/23] fpu/softfloat2a: implement propagateFloat16NaN Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 18/23] fpu/softfloat2a: implement float16_squash_input_denormal Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 19/23] fpu/softfloat2a: implement float16_abs helper Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 20/23] fpu/softfloat2a: add half-precision expansions for MINMAX fns Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 21/23] fpu/softfloat2a: propagate signalling NaNs in MINMAX Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 22/23] fpu/softfloat2a: improve comments on ARM NaN propagation Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:04 ` [RFC PATCH for 2.11 23/23] target/arm: implement half-precision F(MIN|MAX)(V|NMV) Alex Bennée
2017-07-20 15:04 ` [Qemu-devel] " Alex Bennée
2017-07-20 15:17 ` [RFC PATCH for 2.11 00/23] Implementing FP16 for ARMv8.2 using SoftFloat2a and 3c Peter Maydell
2017-07-20 15:17 ` [Qemu-devel] " Peter Maydell
2017-07-20 19:53 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tw266rm3.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.