From nobody Fri Jun 7 10:33:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1639664236179422.7785399887765; Thu, 16 Dec 2021 06:17:16 -0800 (PST) Received: from localhost ([::1]:52416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxrZL-0003ou-2Y for importer@patchew.org; Thu, 16 Dec 2021 09:17:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxrU3-0005ck-DP; Thu, 16 Dec 2021 09:11:47 -0500 Received: from [201.28.113.2] (port=9856 helo=outlook.eldorado.org.br) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxrU1-0005cQ-Ex; Thu, 16 Dec 2021 09:11:47 -0500 Received: from power9a ([10.10.71.235]) by outlook.eldorado.org.br with Microsoft SMTPSVC(8.5.9600.16384); Thu, 16 Dec 2021 11:10:40 -0300 Received: from eldorado.org.br (unknown [10.10.70.45]) by power9a (Postfix) with ESMTP id 6EA1B800EBC; Thu, 16 Dec 2021 11:10:40 -0300 (-03) From: matheus.ferst@eldorado.org.br To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH] tests/tcg/ppc64le: remove INT128 requirement to run non_signalling_xscv Date: Thu, 16 Dec 2021 11:09:51 -0300 Message-Id: <20211216140951.1183987-1-matheus.ferst@eldorado.org.br> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-OriginalArrivalTime: 16 Dec 2021 14:10:40.0842 (UTC) FILETIME=[B516AAA0:01D7F286] X-Host-Lookup-Failed: Reverse DNS lookup failed for 201.28.113.2 (failed) Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=201.28.113.2; envelope-from=matheus.ferst@eldorado.org.br; helo=outlook.eldorado.org.br X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Matheus Ferst , danielhb413@gmail.com, richard.henderson@linaro.org, groug@kaod.org, f4bug@amsat.org, clg@kaod.org, alex.bennee@linaro.org, aurelien@aurel32.net, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1639664238167100001 Content-Type: text/plain; charset="utf-8" From: Matheus Ferst The values can be passed with registers to the inline assembler and moved to/from the VSR with mtvsrd/mfvsrd. Signed-off-by: Matheus Ferst --- tests/tcg/ppc64le/non_signalling_xscv.c | 27 +++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/tcg/ppc64le/non_signalling_xscv.c b/tests/tcg/ppc64le/no= n_signalling_xscv.c index 77f0703333..494e01864d 100644 --- a/tests/tcg/ppc64le/non_signalling_xscv.c +++ b/tests/tcg/ppc64le/non_signalling_xscv.c @@ -5,23 +5,24 @@ =20 #define TEST(INSN, B_HI, B_LO, T_HI, T_LO) \ do { \ - __uint128_t t, b =3D B_HI; \ - b <<=3D 64; \ - b |=3D B_LO; \ - asm(INSN " %x0, %x1\n\t" \ - : "=3Dwa" (t) \ - : "wa" (b)); \ + uint64_t th, tl, bh =3D B_HI, bl =3D B_LO; = \ + asm("mtvsrd 0, %3\n\t" \ + "xxswapd 0, 0\n\t" \ + "mtvsrd 0, %2\n\t" \ + INSN " 0, 0\n\t" \ + "mfvsrd %0, 0\n\t" \ + "xxswapd 0, 0\n\t" \ + "mfvsrd %1, 0\n\t" \ + : "=3Dr" (th), "=3Dr" (tl) = \ + : "r" (bh), "r" (bl) \ + : "vs0"); \ printf(INSN "(0x%016" PRIx64 "%016" PRIx64 ") =3D 0x%016" PRIx64 \ - "%016" PRIx64 "\n", (uint64_t)(b >> 64), (uint64_t)b, \ - (uint64_t)(t >> 64), (uint64_t)t); \ - assert((uint64_t)(t >> 64) =3D=3D T_HI && (uint64_t)t =3D=3D T_LO)= ; \ + "%016" PRIx64 "\n", bh, bl, th, tl); \ + assert(th =3D=3D T_HI && tl =3D=3D T_LO); = \ } while (0) =20 int main(void) { -#ifndef __SIZEOF_INT128__ - puts("__uint128_t not available, skipping...\n"); -#else /* SNaN shouldn't be silenced */ TEST("xscvspdpn", 0x7fbfffff00000000ULL, 0x0, 0x7ff7ffffe0000000ULL, 0= x0); TEST("xscvdpspn", 0x7ff7ffffffffffffULL, 0x0, 0x7fbfffff7fbfffffULL, 0= x0); @@ -31,6 +32,6 @@ int main(void) * signifcand will return Infinity as the result. */ TEST("xscvdpspn", 0x7ff000001fffffffULL, 0x0, 0x7f8000007f800000ULL, 0= x0); -#endif + return 0; } --=20 2.25.1