From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPtm5-0007Cb-OA for qemu-devel@nongnu.org; Tue, 27 Jun 2017 12:55:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPsC1-0006Av-6l for qemu-devel@nongnu.org; Tue, 27 Jun 2017 11:14:20 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:52632) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dPsC0-000669-Qr for qemu-devel@nongnu.org; Tue, 27 Jun 2017 11:14:17 -0400 References: <20170626220330.6785-1-laurent@vivier.eu> <20170626220330.6785-5-laurent@vivier.eu> From: Laurent Vivier Message-ID: <65e8a6ec-60cf-f626-1db9-4ffa225fd45d@vivier.eu> Date: Tue, 27 Jun 2017 17:13:55 +0200 MIME-Version: 1.0 In-Reply-To: <20170626220330.6785-5-laurent@vivier.eu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 4/7] softfloat: define floatx80_round() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Richard Henderson , Peter Maydell Aurélien or Peter, could you ACK this one? Thanks, Laurent Le 27/06/2017 à 00:03, Laurent Vivier a écrit : > Add a function to round a floatx80 to the defined precision > (floatx80_rounding_precision) > > Signed-off-by: Laurent Vivier > Reviewed-by: Richard Henderson > --- > fpu/softfloat.c | 15 +++++++++++++++ > include/fpu/softfloat.h | 1 + > 2 files changed, 16 insertions(+) > > diff --git a/fpu/softfloat.c b/fpu/softfloat.c > index 7af14e2..e9bf359 100644 > --- a/fpu/softfloat.c > +++ b/fpu/softfloat.c > @@ -5086,6 +5086,21 @@ float128 floatx80_to_float128(floatx80 a, float_status *status) > } > > /*---------------------------------------------------------------------------- > +| Rounds the extended double-precision floating-point value `a' > +| and returns the result as an extended double-precision floating-point > +| value. The operation is performed according to the IEC/IEEE Standard for > +| Binary Floating-Point Arithmetic. > +*----------------------------------------------------------------------------*/ > + > +floatx80 floatx80_round(floatx80 a, float_status *status) > +{ > + return roundAndPackFloatx80(status->floatx80_rounding_precision, > + extractFloatx80Sign(a), > + extractFloatx80Exp(a), > + extractFloatx80Frac(a), 0, status); > +} > + > +/*---------------------------------------------------------------------------- > | Rounds the extended double-precision floating-point value `a' to an integer, > | and returns the result as an extended quadruple-precision floating-point > | value. The operation is performed according to the IEC/IEEE Standard for > diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h > index f1288ef..d9689ec 100644 > --- a/include/fpu/softfloat.h > +++ b/include/fpu/softfloat.h > @@ -621,6 +621,7 @@ float128 floatx80_to_float128(floatx80, float_status *status); > /*---------------------------------------------------------------------------- > | Software IEC/IEEE extended double-precision operations. > *----------------------------------------------------------------------------*/ > +floatx80 floatx80_round(floatx80 a, float_status *status); > floatx80 floatx80_round_to_int(floatx80, float_status *status); > floatx80 floatx80_add(floatx80, floatx80, float_status *status); > floatx80 floatx80_sub(floatx80, floatx80, float_status *status); >