From: David Hildenbrand <david@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Thomas Huth <thuth@redhat.com>,
Halil Pasic <pasic@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 12/15] s390x/tcg: Implement XxC and checks for most FP instructions
Date: Thu, 14 Feb 2019 11:08:31 +0100 [thread overview]
Message-ID: <fbf58651-4727-c60d-4491-9cd0d7c55245@redhat.com> (raw)
In-Reply-To: <0d90f059-bb8f-7979-6b41-feaea75953d5@linaro.org>
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 <david@redhat.com>
>>>
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>>
>>>> +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
next prev parent reply other threads:[~2019-02-14 10:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-13 14:33 [Qemu-devel] [PATCH v2 00/15] s390x/tcg: Implement floating-point extension facility David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 01/15] s390x/tcg: Fix TEST DATA CLASS instructions David Hildenbrand
2019-02-13 19:17 ` Richard Henderson
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 02/15] s390x/tcg: Fix rounding from float128 to uint64_t/uin32_t David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 03/15] s390x/tcg: Factor out conversion of softfloat exceptions David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 04/15] s390x/tcg: Fix parts of IEEE exception handling David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 05/15] s390x/tcg: Hide IEEE underflows in some scenarios David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 06/15] s390x/tcg: Refactor SET FPC AND SIGNAL handling David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 07/15] s390x/tcg: Fix simulated-IEEE exceptions David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 08/15] s390x/tcg: Handle SET FPC AND LOAD FPC 3-bit BFP rounding modes David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 09/15] s390x/tcg: Check for exceptions in SET BFP ROUNDING MODE David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 10/15] s390x/tcg: Refactor saving/restoring the bfp rounding mode David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 11/15] s390x/tcg: Prepare for IEEE-inexact-exception control (XxC) David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 12/15] s390x/tcg: Implement XxC and checks for most FP instructions David Hildenbrand
2019-02-13 19:31 ` Richard Henderson
2019-02-13 19:53 ` David Hildenbrand
2019-02-14 5:25 ` Richard Henderson
2019-02-14 10:08 ` David Hildenbrand [this message]
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 13/15] s390x/tcg: Implement rounding mode and XxC for LOAD ROUNDED David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 14/15] s390x/tcg: Handle all rounding modes overwritten by BFP instructions David Hildenbrand
2019-02-13 14:33 ` [Qemu-devel] [PATCH v2 15/15] s390x: Add floating-point extension facility to "qemu" cpu model David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fbf58651-4727-c60d-4491-9cd0d7c55245@redhat.com \
--to=david@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).