[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 6/7] target-ppc: Add xvtstdc[sp, dp] instructions
From: |
Richard Henderson |
Subject: |
Re: [Qemu-ppc] [PATCH 6/7] target-ppc: Add xvtstdc[sp, dp] instructions |
Date: |
Thu, 12 Jan 2017 09:23:38 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
On 01/12/2017 08:24 AM, Nikunj A Dadhania wrote:
> + nan = tp##_is_any_nan(xb.fld); \
> + infinity = tp##_is_infinity(xb.fld); \
> + sign = tp##_is_neg(xb.fld); \
> + zero = denormal = 0; \
> + if (tp##_is_zero_or_denormal(xb.fld)) { \
> + if (tp##_is_zero(xb.fld)) { \
> + zero = 1; \
> + } else { \
> + denormal = 1; \
> + } \
> + } \
> + \
> + if ((extract32(dcmx, 6, 1) && nan) || \
> + (extract32(dcmx, 5, 1) && infinity && !sign) || \
> + (extract32(dcmx, 4, 1) && infinity && sign) || \
> + (extract32(dcmx, 3, 1) && zero && !sign) || \
> + (extract32(dcmx, 3, 1) && zero && sign) || \
> + (extract32(dcmx, 1, 1) && denormal && !sign) || \
> + (extract32(dcmx, 0, 1) && denormal && sign)) { \
> + match = 1; \
> + } \
I'll note that all of these are mutually exclusive, therefore you're doing much
more work than required.
sign = tp##_is_neg(x));
if (tp##is_any_nan(x)) {
match = extract32(dcmx, 6, 1);
} else if (tp##_is_infinity(x)) {
match = extract32(dcmx, 4 + !sign, 1);
} else if (tp##_is_zero(x)) {
match = extract32(dcmx, 2 + !sign, 1);
} else if (tp##_is_zero_or_denormal(x)) {
match = extract32(dcmx, 0 + !sign, 1);
}
(Also, an apparent typo for your zero && sign case.)
r~
- [Qemu-ppc] [PATCH 0/7] POWER9 TCG enablements - part12, Nikunj A Dadhania, 2017/01/12
- [Qemu-ppc] [PATCH 1/7] target-ppc: Use ppc_vsr_t.f128 in xscmp[o, u, exp]qp, Nikunj A Dadhania, 2017/01/12
- [Qemu-ppc] [PATCH 2/7] target-ppc: Add xscvsdqp and xscvudqp instructions, Nikunj A Dadhania, 2017/01/12
- [Qemu-ppc] [PATCH 3/7] target-ppc: Add xsdivqp instruction, Nikunj A Dadhania, 2017/01/12
- [Qemu-ppc] [PATCH 4/7] target-ppc: Add xsmulqp instruction, Nikunj A Dadhania, 2017/01/12
- [Qemu-ppc] [PATCH 6/7] target-ppc: Add xvtstdc[sp, dp] instructions, Nikunj A Dadhania, 2017/01/12
- Re: [Qemu-ppc] [PATCH 6/7] target-ppc: Add xvtstdc[sp, dp] instructions,
Richard Henderson <=
- [Qemu-ppc] [PATCH 5/7] target-ppc: Add xvcv[hpsp, sphp] instructions, Nikunj A Dadhania, 2017/01/12
- [Qemu-ppc] [PATCH 7/7] target-ppc: Add xststdc[sp, dp, qp] instructions, Nikunj A Dadhania, 2017/01/12
- Re: [Qemu-ppc] [PATCH 0/7] POWER9 TCG enablements - part12, David Gibson, 2017/01/12