From patchwork Tue Feb 12 11:02:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 1040506 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43zKc946wdz9sN1 for ; Tue, 12 Feb 2019 22:07:04 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtVu2-0007sb-6O for incoming@patchwork.ozlabs.org; Tue, 12 Feb 2019 06:07:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtVqo-0005po-Q4 for qemu-devel@nongnu.org; Tue, 12 Feb 2019 06:03:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtVqn-0002bd-EO for qemu-devel@nongnu.org; Tue, 12 Feb 2019 06:03:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42300) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtVqj-0002BU-44; Tue, 12 Feb 2019 06:03:39 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D13A980467; Tue, 12 Feb 2019 11:03:19 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-158.ams2.redhat.com [10.36.116.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04CA660FDC; Tue, 12 Feb 2019 11:03:17 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Tue, 12 Feb 2019 12:02:55 +0100 Message-Id: <20190212110308.13707-4-david@redhat.com> In-Reply-To: <20190212110308.13707-1-david@redhat.com> References: <20190212110308.13707-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 12 Feb 2019 11:03:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 02/15] s390x/tcg: Fix rounding from float128 to uint64_t/uin32_t X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Janosch Frank , David Hildenbrand , Cornelia Huck , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Let's use the proepr conversion functions now that we have them. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/fpu_helper.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/s390x/fpu_helper.c b/target/s390x/fpu_helper.c index a3214bd546..f9ec519067 100644 --- a/target/s390x/fpu_helper.c +++ b/target/s390x/fpu_helper.c @@ -509,9 +509,7 @@ uint64_t HELPER(clgdb)(CPUS390XState *env, uint64_t v2, uint32_t m3) uint64_t HELPER(clgxb)(CPUS390XState *env, uint64_t h, uint64_t l, uint32_t m3) { int hold = swap_round_mode(env, m3); - float128 v2 = make_float128(h, l); - /* ??? Not 100% correct. */ - uint64_t ret = float128_to_int64(v2, &env->fpu_status); + uint64_t ret = float128_to_uint64(make_float128(h, l), &env->fpu_status); set_float_rounding_mode(hold, &env->fpu_status); handle_exceptions(env, GETPC()); return ret; @@ -541,9 +539,7 @@ uint64_t HELPER(clfdb)(CPUS390XState *env, uint64_t v2, uint32_t m3) uint64_t HELPER(clfxb)(CPUS390XState *env, uint64_t h, uint64_t l, uint32_t m3) { int hold = swap_round_mode(env, m3); - float128 v2 = make_float128(h, l); - /* Not 100% correct. */ - uint32_t ret = float128_to_int64(v2, &env->fpu_status); + uint32_t ret = float128_to_uint32(make_float128(h, l), &env->fpu_status); set_float_rounding_mode(hold, &env->fpu_status); handle_exceptions(env, GETPC()); return ret;