[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: |
Nikunj A Dadhania |
Subject: |
Re: [Qemu-ppc] [PATCH 6/7] target-ppc: Add xvtstdc[sp, dp] instructions |
Date: |
Fri, 13 Jan 2017 09:02:56 +0530 |
User-agent: |
Notmuch/0.21 (https://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu) |
Richard Henderson <address@hidden> writes:
> 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);
> }
Right, that is pretty concise. Will send updated series changing patch 6
and 7.
> (Also, an apparent typo for your zero && sign case.)
Yes, was by mistake.
Regards
Nikunj
- [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
- [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