[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v4 1/9] softfloat: Implement run-time-configurable
From: |
Leon Alrae |
Subject: |
Re: [Qemu-ppc] [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit |
Date: |
Thu, 14 Apr 2016 16:31:19 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
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-ppc] [PATCH v4 9/9] target-mips: Clean up order of helpers for CVT.<L|W>.<S|D>, (continued)
- [Qemu-ppc] [PATCH v4 9/9] target-mips: Clean up order of helpers for CVT.<L|W>.<S|D>, Aleksandar Markovic, 2016/04/12
- [Qemu-ppc] [PATCH v4 6/9] target-mips: Activate IEEE 274-2008 support, Aleksandar Markovic, 2016/04/12
- [Qemu-ppc] [PATCH v4 7/9] target-mips: Add abs2008 flavor of <ABS|NEG>.<S|D>, Aleksandar Markovic, 2016/04/12
- [Qemu-ppc] [PATCH v4 8/9] target-mips: Add nan2008 flavor of <CEIL|CVT|FLOOR|ROUND|TRUNC>.<L|W>.<S|D>, Aleksandar Markovic, 2016/04/12
- [Qemu-ppc] [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit, Aleksandar Markovic, 2016/04/12
- Re: [Qemu-ppc] [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit, Leon Alrae, 2016/04/13
- Re: [Qemu-ppc] [PATCH v4 1/9] softfloat: Implement run-time-configurable meaning of signaling NaN bit,
Leon Alrae <=