From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:54539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtdaM-0002Kw-0f for qemu-devel@nongnu.org; Tue, 12 Feb 2019 14:19:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtdPP-0003ed-Ak for qemu-devel@nongnu.org; Tue, 12 Feb 2019 14:07:56 -0500 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:37682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gtdPN-0003V8-RQ for qemu-devel@nongnu.org; Tue, 12 Feb 2019 14:07:55 -0500 Received: by mail-pg1-x541.google.com with SMTP id q206so1687223pgq.4 for ; Tue, 12 Feb 2019 11:07:48 -0800 (PST) References: <20190212110308.13707-1-david@redhat.com> <20190212110308.13707-10-david@redhat.com> From: Richard Henderson Message-ID: <43fda672-487e-fef9-17c8-ce0657f27dbe@linaro.org> Date: Tue, 12 Feb 2019 11:07:44 -0800 MIME-Version: 1.0 In-Reply-To: <20190212110308.13707-10-david@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 08/15] s390x/tcg: Handle SET FPC AND LOAD FPC 3-bit BFP rounding modes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Hildenbrand , qemu-devel@nongnu.org Cc: Thomas Huth , Janosch Frank , Cornelia Huck , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Richard Henderson On 2/12/19 3:03 AM, David Hildenbrand wrote: > We already forward the 3 bits correctly in the translation functions. We > also have to handle them properly and check for specification > exceptions. > > Setting an invalid rounding mode (BFP only, all DFP rounding modes) > results in a specification exception. Setting unassigned bits in the > fpc, results in a specification exception. > > This fixes LOAD FPC (AND SIGNAL), SET FPC (AND SIGNAL). Also for, > SET BFP ROUNDING MODE, 3-bit rounding mode is now explicitly checked. > > Notes: > 1. Use "float_round_to_zero" for now to handle "Round to prepare for > shorter precision". Looking at the PoP "Summary of Rounding and Range > Actions" for BFP. They differ when it comes to tiny values. > 2. TCG_CALL_NO_WG is required for sfpc handler, as we now inject > exceptions. > > We won't be modeling abscence of the "floating-point extension facility" > for now, not necessary as most take the facility for granted without > checking. > > z14 PoP, 9-23, "LOAD FPC" > When the floating-point extension facility is > installed, bits 29-31 of the second operand must > specify a valid BFP rounding mode and bits 6-7, > 14-15, 24, and 28 must be zero; otherwise, a > specification exception is recognized. Reviewed-by: Richard Henderson > + /* > + * FIXME: we actually want something like round_to_odd, but that does not > + * support all data types yet. > + */ > + float_round_to_zero, Yes, you want round_to_odd. I suppose that's not valid for float128 right now? r~