[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 1/9] softfloat: Implement run-time-configurab
From: |
Aleksandar Markovic |
Subject: |
Re: [Qemu-devel] [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit |
Date: |
Fri, 15 Apr 2016 08:48:22 +0000 |
Agreed. This looks much better, and is simpler and faster. Though, it looks to
me that "fst" should be called "status" instead (just not to break consistency
throughout SoftFloat library and in other places of assigning name "status" to
the last argument of any function if its type is float_status*). If you agree,
I am going to replace name "fst" with name "status" in the code that you
provided, otherwise as-is.
________________________________________
From: Leon Alrae
Sent: Thursday, April 14, 2016 8:31 AM
To: Aleksandar Markovic; address@hidden
Cc: address@hidden; address@hidden; address@hidden; address@hidden;
address@hidden; address@hidden; Aleksandar Markovic; address@hidden;
address@hidden; Petar Jovanovic; address@hidden; Miodrag Dinic; address@hidden;
address@hidden; address@hidden; address@hidden; address@hidden; Maciej Rozycki
Subject: Re: [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning
of signaling NaN bit
On 12/04/2016 13:58, Aleksandar Markovic wrote:
> @@ -3200,11 +3200,17 @@ FLOAT_RINT(rint_d, 64)
> #define FLOAT_CLASS_POSITIVE_ZERO 0x200
>
> #define FLOAT_CLASS(name, bits) \
> -uint ## bits ## _t helper_float_ ## name (uint ## bits ## _t arg) \
> +uint ## bits ## _t helper_float_ ## name (CPUMIPSState *env, \
> + uint ## bits ## _t arg, uint32_t is_msa) \
> { \
> - if (float ## bits ## _is_signaling_nan(arg)) { \
> + float_status* fst; \
> + \
> + fst = (is_msa == 1) ? \
> + &env->active_tc.msa_fp_status : &env->active_fpu.fp_status; \
> + \
> + if (float ## bits ## _is_signaling_nan(arg, fst)) { \
> return FLOAT_CLASS_SIGNALING_NAN; \
> - } else if (float ## bits ## _is_quiet_nan(arg)) { \
> + } else if (float ## bits ## _is_quiet_nan(arg, fst)) { \
> return FLOAT_CLASS_QUIET_NAN; \
> } else if (float ## bits ## _is_neg(arg)) { \
> if (float ## bits ## _is_infinity(arg)) { \
Let's make it a common function which takes float_status passed from FPU and
MSA helpers and avoid is_msa:
#define FLOAT_CLASS(name, bits) \
-uint ## bits ## _t helper_float_ ## name (uint ## bits ## _t arg) \
+uint ## bits ## _t float_ ## name (uint ## bits ## _t arg, \
+ float_status *fst) \
{ \
- if (float ## bits ## _is_signaling_nan(arg)) { \
+ if (float ## bits ## _is_signaling_nan(arg, fst)) { \
return FLOAT_CLASS_SIGNALING_NAN; \
- } else if (float ## bits ## _is_quiet_nan(arg)) { \
+ } else if (float ## bits ## _is_quiet_nan(arg, fst)) { \
return FLOAT_CLASS_QUIET_NAN; \
} else if (float ## bits ## _is_neg(arg)) { \
if (float ## bits ## _is_infinity(arg)) { \
@@ -3227,6 +3228,12 @@ uint ## bits ## _t helper_float_ ## name (uint ## bits
## _t arg) \
return FLOAT_CLASS_POSITIVE_NORMAL; \
} \
} \
+} \
+ \
+uint ## bits ## _t helper_float_ ## name (CPUMIPSState *env, \
+ uint ## bits ## _t arg) \
+{ \
+ return float_ ## name(arg, &env->active_fpu.fp_status); \
}
FLOAT_CLASS(class_s, 32)
And in MSA:
+ float_status *status = &env->active_tc.msa_fp_status;
if (df == DF_WORD) {
- pwd->w[0] = helper_float_class_s(pws->w[0]);
- pwd->w[1] = helper_float_class_s(pws->w[1]);
- pwd->w[2] = helper_float_class_s(pws->w[2]);
- pwd->w[3] = helper_float_class_s(pws->w[3]);
+ pwd->w[0] = float_class_s(pws->w[0], status);
+ pwd->w[1] = float_class_s(pws->w[1], status);
+ pwd->w[2] = float_class_s(pws->w[2], status);
+ pwd->w[3] = float_class_s(pws->w[3], status);
} else {
- pwd->d[0] = helper_float_class_d(pws->d[0]);
- pwd->d[1] = helper_float_class_d(pws->d[1]);
+ pwd->d[0] = float_class_d(pws->d[0], status);
+ pwd->d[1] = float_class_d(pws->d[1], status);
}
Thanks,
Leon
- [Qemu-devel] [PATCH v4 6/9] target-mips: Activate IEEE 274-2008 support, (continued)
- [Qemu-devel] [PATCH v4 6/9] target-mips: Activate IEEE 274-2008 support, Aleksandar Markovic, 2016/04/12
- [Qemu-devel] [PATCH v4 5/9] softfloat: Clean up white spaces in softfloat-specialize.h, Aleksandar Markovic, 2016/04/12
- [Qemu-devel] [PATCH v4 2/9] softfloat: For Mips only, correct default NaN values, Aleksandar Markovic, 2016/04/12
- [Qemu-devel] [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit, Aleksandar Markovic, 2016/04/12
- Re: [Qemu-devel] [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit, Leon Alrae, 2016/04/13
- Re: [Qemu-devel] [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit, Leon Alrae, 2016/04/14