qemu-ppc
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]