qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qemu-s390x] [PATCH v2 12/15] s390x/tcg: Implement XxC and checks fo


From: David Hildenbrand
Subject: Re: [qemu-s390x] [PATCH v2 12/15] s390x/tcg: Implement XxC and checks for most FP instructions
Date: Thu, 14 Feb 2019 11:08:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 14.02.19 06:25, Richard Henderson wrote:
> On 2/13/19 11:53 AM, David Hildenbrand wrote:
>> On 13.02.19 20:31, Richard Henderson wrote:
>>> On 2/13/19 6:33 AM, David Hildenbrand wrote:
>>>> With the floating-point extension facility
>>>> - CONVERT FROM LOGICAL
>>>> - CONVERT TO LOGICAL
>>>> - CONVERT TO FIXED
>>>> - CONVERT FROM FIXED
>>>> - LOAD FP INTEGER
>>>> have both, a rounding mode specification and the inexact-exception control
>>>> (XxC). Other instructions will be handled separatly.
>>>>
>>>> Check for valid rounding modes and forward also the XxC (via m4). To avoid
>>>> a lot of boilerplate code and changes to the helpers, combine both, the
>>>> m3 and m4 field in a combined 32 bit TCG variable. Perform checks at
>>>> a central place, taking in account if the m3 or m4 field was ignore
>>>> before the floating-point extension facility was introduced.
>>>>
>>>> Signed-off-by: David Hildenbrand <address@hidden>
>>>
>>> Reviewed-by: Richard Henderson <address@hidden>
>>>
>>>> +static inline bool xxc_from_m34(uint32_t m34)
>>>> +{
>>>> +    /* XxC is bit 1 of m4 */
>>>> +    return (extract32(m34, 4, 4) & 0x4) != 0;
>>>
>>> Better as extract32(m32, 6, 1);
>>
>> Is it "better as" that or "better written as" that?
>>
>> I think "extract32(m34, 4, 4) & 0x4" is slightly easier to understand.
>> (get m4 field and take the bit number 1)
> 
> I don't like not extracting the bit that you want.  Do you prefer to let the
> compiler fold the constant?  E.g.  4 + 3 - 1?

Yes, that looks better.

> 
> I hate big-endian bit numbering...
> 
> 
> r~
> 


-- 

Thanks,

David / dhildenb



reply via email to

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