From nobody Mon Nov 10 22:28:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559300390; cv=none; d=zoho.com; s=zohoarc; b=ew2ib8DHW9GA/t4HopWlO8Zef/o/BVeMVKbHMJZhVLFeZ2u2wkVNsK/1iF8T+JKRWi9N7s89guCNOgvB9XXkKDY53s3boLx6SWKM7XwBe1+I81ecbT7Wih1iEmH8YaKXWHktq+b5Fhc2eD1JqCxZ3T84pfJbZmI/XXeunGEwx1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559300390; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=q2c7Dzarvx6LAyd9K1A2puHMJOcCpZy3SF9AgS51Rcs=; b=SsLnEbp0A22Pafg5KzNUnQQuwpnWOq+b4r/0X0Vq40iDJEn23pKzqFWXgatVYf4cdfMS1qD1DsITAQOjDkL5JGztkI64aKeThay6KtGZxIGvy7mgybIF6rS1O/jDy8lGW8AcuXBZs0yxsfEwBO94RuN7Rdt1/8vmyVMTjeoJhLA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559300390819239.5912355340746; Fri, 31 May 2019 03:59:50 -0700 (PDT) Received: from localhost ([127.0.0.1]:40995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWfGB-0001ts-PP for importer@patchew.org; Fri, 31 May 2019 06:59:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWf20-00079I-8K for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWf1z-0001gl-6K for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56248) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWf1y-0001fr-Tu for qemu-devel@nongnu.org; Fri, 31 May 2019 06:45:03 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A4A7302451A; Fri, 31 May 2019 10:45:02 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-233.ams2.redhat.com [10.36.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24D51473DB; Fri, 31 May 2019 10:45:00 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 12:44:23 +0200 Message-Id: <20190531104432.29379-15-david@redhat.com> In-Reply-To: <20190531104432.29379-1-david@redhat.com> References: <20190531104432.29379-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 31 May 2019 10:45:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 14/23] s390x/tcg: Implement VECTOR LOAD ROUNDED 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: Christian Borntraeger , Denys Vlasenko , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We can reuse some of the infrastructure introduced for VECTOR FP CONVERT FROM FIXED 64-BIT and friends. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 2 ++ target/s390x/translate_vx.inc.c | 3 +++ target/s390x/vec_fpu_helper.c | 43 +++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index cb25141ffe..7526f8e8c6 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -280,6 +280,8 @@ DEF_HELPER_FLAGS_4(gvec_vfi64, TCG_CALL_NO_WG, void, pt= r, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfi64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfll32, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) DEF_HELPER_FLAGS_4(gvec_vfll32s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vflr64, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) +DEF_HELPER_FLAGS_4(gvec_vflr64s, TCG_CALL_NO_WG, void, ptr, cptr, env, i32) =20 #ifndef CONFIG_USER_ONLY DEF_HELPER_3(servc, i32, env, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index 5afdb36aec..f03914d528 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -1232,6 +1232,8 @@ F(0xe7c7, VFI, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) /* VECTOR LOAD LENGTHENED */ F(0xe7c4, VFLL, VRR_a, V, 0, 0, 0, 0, vfll, 0, IF_VEC) +/* VECTOR LOAD ROUNDED */ + F(0xe7c5, VFLR, VRR_a, V, 0, 0, 0, 0, vcdg, 0, IF_VEC) =20 #ifndef CONFIG_USER_ONLY /* COMPARE AND SWAP AND PURGE */ diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index a25985e5c9..73e1b1062a 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2672,6 +2672,9 @@ static DisasJumpType op_vcdg(DisasContext *s, DisasOp= s *o) case 0xc7: fn =3D se ? gen_helper_gvec_vfi64s : gen_helper_gvec_vfi64; break; + case 0xc5: + fn =3D se ? gen_helper_gvec_vflr64s : gen_helper_gvec_vflr64; + break; default: g_assert_not_reached(); } diff --git a/target/s390x/vec_fpu_helper.c b/target/s390x/vec_fpu_helper.c index f8919beed5..d5fd931b61 100644 --- a/target/s390x/vec_fpu_helper.c +++ b/target/s390x/vec_fpu_helper.c @@ -448,3 +448,46 @@ void HELPER(gvec_vfll32s)(void *v1, const void *v2, CP= US390XState *env, { vfll32(v1, v2, env, true, GETPC()); } + +static void vflr64(S390Vector *v1, const S390Vector *v2, CPUS390XState *en= v, + bool s, bool XxC, uint8_t erm, uintptr_t retaddr) +{ + uint8_t vxc, vec_exc =3D 0; + S390Vector tmp =3D {}; + int i, old_mode; + + old_mode =3D s390_swap_bfp_rounding_mode(env, erm); + for (i =3D 0; i < 2; i++) { + float64 a =3D make_float64(s390_vec_read_element64(v2, i)); + uint32_t ret =3D float32_val(float64_to_float32(a, &env->fpu_statu= s)); + + /* place at even element */ + s390_vec_write_element32(&tmp, i * 2, ret); + /* indicate the source element */ + vxc =3D check_ieee_exc(env, i, XxC, &vec_exc); + if (s || vxc) { + break; + } + } + s390_restore_bfp_rounding_mode(env, old_mode); + handle_ieee_exc(env, vxc, vec_exc, retaddr); + *v1 =3D tmp; +} + +void HELPER(gvec_vflr64)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vflr64(v1, v2, env, false, XxC, erm, GETPC()); +} + +void HELPER(gvec_vflr64s)(void *v1, const void *v2, CPUS390XState *env, + uint32_t desc) +{ + const uint8_t erm =3D extract32(simd_data(desc), 4, 4); + const bool XxC =3D extract32(simd_data(desc), 2, 1); + + vflr64(v1, v2, env, true, XxC, erm, GETPC()); +} --=20 2.20.1