From patchwork Tue May 21 03:04:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1937200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=HVaKQmGN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vjzp72lpFz20PS for ; Tue, 21 May 2024 13:05:35 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79E883858C98 for ; Tue, 21 May 2024 03:05:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id 99CF93858D34 for ; Tue, 21 May 2024 03:05:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 99CF93858D34 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 99CF93858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716260709; cv=none; b=a89y1NnHK/kvk154QG8Xy0Zxrgf6hcEBiUal/R3clzkkfsDlJmFoUdBHi69j2o1I5FBxvAkQUW1Tx6VDqANtYNENKNql6HTCZ9uDM02HAkaaYw2mhm4ajIzHhizEuzt7FhOR/nJ7GzI2Ns0hfCg9695YiCz3smtnHR8dAovw8cU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716260709; c=relaxed/simple; bh=dOMqpyEFZSutDB7WSu/TamJnp5d7AyMV+vWTIELqlr4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=t9XQaO98x4ePm1nldZ0VazaanZejVL3VpKds3NWu08sn7B+N79ZgUvfJkUeBbfupt7T/DRSpESWFKnEeZKsnXXzCXlciNhbK0aZKQXhuko7WMHxM7Xf69Ri+iHKUj8nocNsTFfzAEdhYVRc174c2tMZxuRDuWKf7TNmcAwBeNA0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3c99fcedac1so1479488b6e.0 for ; Mon, 20 May 2024 20:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1716260706; x=1716865506; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=OZOXlHsdJN3nMRpeswTlB1GyFgnf7JRqJoRf4mhoVA8=; b=HVaKQmGNCx/zVG0geFnnQ5CuwOssb+VbOa3JZ0CyDXXQwgcNXnO7N5k1BLgFLSd74t 3AdDX3RgQ/dV1xHnxCTNtop4qA1YlRLCm1I2Z2ANjXljutAwlwr9jvxhYEbrUNaCXWWb sWBxPFf6Ig9FJXf8xyUEh0POTnbH0yg/kwNezq3gme1+RDn263O7AI/4dvpeuPHL9AlQ 7EZqiGELM4jezORd5pwWGaL3ye8PJSaP5krU1PMcU/aFf4CN6aZdJh43b8sKnhSOa2uE mV4NcHJLbN7YAqK+vvT8f/gSFhK7aQIX1QW9k7CC7zjnaKtiuesBib13GjdV+JM0xKsa tyOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716260706; x=1716865506; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OZOXlHsdJN3nMRpeswTlB1GyFgnf7JRqJoRf4mhoVA8=; b=v70htqqlbViA2cWtYQuqI/7aABExGlxebuUE9D1V/7cHDfhX2/GtCquLidAQKZxgLW aJcv9TgjG3fo2ir0gJJ2yCSWEIUFuCEaDhUgMz/h1gEMzzT2vL0qhnh8ey+rLj9zR/8p AAgxbgzS3ZaQrAhw4ixh0xU/kRfOeVtthazExKa3FJgqJBr9nls6xtKLimRztB0lQFIH 0tA2aEhyjztpWhhBS4TtJ+A8Y9B9rwXa5M9JXb0ajvH3rePHK9z4W9PGlApdtskf6KZq CEAuKF6Q8lGdOXRY9focOectE6RoNNuUgOVHlVrhT0II4d8fA6UOmSb+Nz+iVYNh8vkr Ucsw== X-Forwarded-Encrypted: i=1; AJvYcCUFN5rilIsUA/FLKomjjiim4yX6Fh7kkoCohHceIPA0Z00GM8SZNPRR5miYaQa/BP/ISNiz2dOb70J9ER1PMEkxZHwq19877A== X-Gm-Message-State: AOJu0Yy8ndAwmDvUpiYSnyCynoV8mzjU/8Pp6mvWGxVIlf8R0sdtGIyG upym5RwcdIsNEYWqs6eOxpq6UbkwuARk3JBTMPKHK65aL0IM2sIPKP2XnZtghQ== X-Google-Smtp-Source: AGHT+IF2sgoyCraVEdgo8nCcPTcrGnSv1Ty/2/HmGQREwujuluA+o70EL6Vzt7aizYCSDqSI2ppmWw== X-Received: by 2002:a05:6808:2208:b0:3c6:805:4889 with SMTP id 5614622812f47-3c99704879amr43221325b6e.17.1716260705692; Mon, 20 May 2024 20:05:05 -0700 (PDT) Received: from free.home ([2804:7f1:218b:1961:ef8:d680:5399:8b1a]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2ae0f10sm20683578b3a.128.2024.05.20.20.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 20:05:05 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 44L34gNL093130 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 21 May 2024 00:04:43 -0300 From: Alexandre Oliva To: "Kewen.Lin" Cc: Rainer Orth , Mike Stump , David Edelsohn , Kewen Lin , Segher Boessenkool , gcc-patches@gcc.gnu.org, Michael Meissner Subject: [PATCH v2] [testsuite] xfail pr79004 on longdouble64; drop long_double_64bit (was: ppc: testsuite: pr79004 needs -mlong-double-128) Organization: Free thinker, does not speak for AdaCore References: <20210412210424.GK26583@gate.crashing.org> <6f1df02a-c133-6297-b785-b05d135ca165@linux.ibm.com> <2da63b96-5fc6-71cb-40e9-d2728edcd7fb@linux.ibm.com> <14e17aa0-3d01-3731-4472-b39ee3c73948@linux.ibm.com> Date: Tue, 21 May 2024 00:04:42 -0300 In-Reply-To: (Kewen Lin's message of "Wed, 8 May 2024 16:36:01 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org On May 8, 2024, "Kewen.Lin" wrote: >>> How about the generic one "longdouble64"? I did a grep and found it has one >>> use, I'd expect it can work here. :) >> >> ... since this and longdouble128 exist, maybe we can fix it and leave >> them all alone, despite the interface oddity. >> > ... personally I'm inclined to drop this 64 bit one. :) Some of the asm opcodes expected by pr79004 depend on -mlong-double-128 to be output. E.g., without this flag, the conditions of patterns @extenddf2 and extendsf2 do not hold, and so GCC resorts to libcalls instead of even trying rs6000_expand_float128_convert. Perhaps the conditions are too strict, and they could enable the use of conversion insns involving __ieee128/_Float128 even with 64-bit long doubles. For now, xfail the opcodes that are not available on longdouble64. While at that, drop long_double_64bit, since it's broken and sort of redundant. Regstrapped on x86_64-linux-gnu, also tested with gcc-13 on ppc64-vx7r2. Ok to install? for gcc/testsuite/ChangeLog PR target/105359 * gcc.target/powerpc/pr79004.c: Xfail opcodes not available on longdouble64. * lib/target-supports.exp (check_effective_target_long_double_64bit): Drop. (add_options_for_long_double_64bit): Likewise. --- gcc/testsuite/gcc.target/powerpc/pr79004.c | 14 +++++---- gcc/testsuite/lib/target-supports.exp | 43 ---------------------------- 2 files changed, 8 insertions(+), 49 deletions(-) diff --git a/gcc/testsuite/gcc.target/powerpc/pr79004.c b/gcc/testsuite/gcc.target/powerpc/pr79004.c index caf1f6c1eefe4..2cb8bf4bc14bc 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr79004.c +++ b/gcc/testsuite/gcc.target/powerpc/pr79004.c @@ -100,10 +100,12 @@ void to_uns_short_store_n (TYPE a, unsigned short *p, long n) { p[n] = (unsigned void to_uns_int_store_n (TYPE a, unsigned int *p, long n) { p[n] = (unsigned int)a; } void to_uns_long_store_n (TYPE a, unsigned long *p, long n) { p[n] = (unsigned long)a; } -/* { dg-final { scan-assembler-not {\mbl __} } } */ -/* { dg-final { scan-assembler {\mxscvdpqp\M} } } */ -/* { dg-final { scan-assembler {\mxscvqpdp\M} } } */ -/* { dg-final { scan-assembler {\mxscvqpdpo\M} } } */ +/* On targets with 64-bit long double, some opcodes to deal with __float128 are + disabled, see PR target/105359. */ +/* { dg-final { scan-assembler-not {\mbl __} { xfail longdouble64 } } } */ +/* { dg-final { scan-assembler {\mxscvdpqp\M} { xfail longdouble64 } } } */ +/* { dg-final { scan-assembler {\mxscvqpdp\M} { xfail longdouble64 } } } */ +/* { dg-final { scan-assembler {\mxscvqpdpo\M} { xfail longdouble64 } } } */ /* { dg-final { scan-assembler {\mxscvqpsdz\M} } } */ /* { dg-final { scan-assembler {\mxscvqpswz\M} } } */ /* { dg-final { scan-assembler {\mxscvsdqp\M} } } */ @@ -111,7 +113,7 @@ void to_uns_long_store_n (TYPE a, unsigned long *p, long n) { p[n] = (unsigned l /* { dg-final { scan-assembler {\mlxsd\M} } } */ /* { dg-final { scan-assembler {\mlxsiwax\M} } } */ /* { dg-final { scan-assembler {\mlxsiwzx\M} } } */ -/* { dg-final { scan-assembler {\mlxssp\M} } } */ +/* { dg-final { scan-assembler {\mlxssp\M} { xfail longdouble64 } } } */ /* { dg-final { scan-assembler {\mstxsd\M} } } */ /* { dg-final { scan-assembler {\mstxsiwx\M} } } */ -/* { dg-final { scan-assembler {\mstxssp\M} } } */ +/* { dg-final { scan-assembler {\mstxssp\M} { xfail longdouble64 } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ec9baa4f32a30..dc7d4f2b5f39e 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2930,49 +2930,6 @@ proc add_options_for_long_double_ieee128 { flags } { return "$flags" } -# Check if GCC and GLIBC supports explicitly specifying that the long double -# format uses the IEEE 64-bit. Under little endian PowerPC Linux, you need -# GLIBC 2.32 or later to be able to use a different long double format for -# running a program than the system default. - -proc check_effective_target_long_double_64bit { } { - return [check_runtime_nocache long_double_64bit { - #include - #include - /* use volatile to prevent optimization. */ - volatile double a = 3.0; - volatile long double one = 1.0L; - volatile long double two = 2.0L; - volatile long double b; - char buffer[20]; - int main() - { - double a2; - long double b2; - if (sizeof (long double) != 8) - return 1; - b = one + two; - /* eliminate removing volatile cast warning. */ - a2 = a; - b2 = b; - if (memcmp (&a2, &b2, 16) != 0) - return 1; - sprintf (buffer, "%lg", b); - return strcmp (buffer, "3") != 0; - } - } [add_options_for_ppc_long_double_override_64bit ""]] -} - -# Return the appropriate options to specify that long double uses the IEEE -# 64-bit format on PowerPC. - -proc add_options_for_long_double_64bit { flags } { - if { [istarget powerpc*-*-*] } { - return "$flags -mlong-double-64" - } - return "$flags" -} - # Return 1 if the target supports executing VSX instructions, 0 # otherwise. Cache the result.