From patchwork Thu Jul 11 18:31:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1959486 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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 4WKjxL4Vj6z1xqc for ; Fri, 12 Jul 2024 04:31:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5C4A3875460 for ; Thu, 11 Jul 2024 18:31:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 47045383E525 for ; Thu, 11 Jul 2024 18:31:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47045383E525 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 47045383E525 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720722689; cv=none; b=j9bvLf/m31J2E2BORc6pDnCgH12uwqJlhJlSMEUHh+K1t/siOtrLmRjcJIEINF6tmrsl/5bykmg7g4sHnhqAbdY0iTvAeoMG8hKGxn49QuTpthg/a/RIKR+gfYNOpDOkl6i+so/k/ITVeEjvP4ZIVQm+sZJvqOrGK9JmfjCRHFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720722689; c=relaxed/simple; bh=eC5+ci1KSJvqFRlZG05ujFmycXXeU0u3FFFKKl9NKco=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Qb/u+lWOpkKUxNhhnecxa2cK+noidOJbcC1gnR01eLWSp5/LIEyN6fXh4U0SzEiKzjuKPvlTaoiEKlp+c/zfh0YHmH7LYnIrDU8cEAjGSumwonUgsEw0m/lWxm56QRPGxe7QpLlWxPUxbg74amVLJ1Z6hNgNoV7fX98yuR8Q9zI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D40D81007; Thu, 11 Jul 2024 11:31:51 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 05B733F766; Thu, 11 Jul 2024 11:31:25 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org,richard.earnshaw@arm.com, ramanara@nvidia.com, richard.sandiford@arm.com Cc: richard.earnshaw@arm.com, ramanara@nvidia.com Subject: [PATCH] arm: Update fp16-aapcs-[24].c after insn_propagation patch Date: Thu, 11 Jul 2024 19:31:24 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-19.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP 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 These tests used to generate: bl swap ldr r2, [sp, #4] mov r0, r2 @ __fp16 but g:9d20529d94b23275885f380d155fe8671ab5353a means that we can load directly into r0: bl swap ldrh r0, [sp, #4] @ __fp16 This patch updates the tests to "defend" this change. While there, the scans include: mov\tr1, r[03]} But if the spill of r2 occurs first, there's no real reason why r2 couldn't be used as the temporary, instead r3. The patch tries to update the scans while preserving the spirit of the originals. Spot-checked with armv8l-unknown-linux-gnueabihf. OK to install? Richard gcc/testsuite/ * gcc.target/arm/fp16-aapcs-2.c: Expect the return value to be loaded directly from the stack. Test that the swap generates two moves out of r0/r1 and two moves in. * gcc.target/arm/fp16-aapcs-4.c: Likewise. --- gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c | 8 +++++--- gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c index c34387f5782..12d20560f53 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c +++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c @@ -16,6 +16,8 @@ F (__fp16 a, __fp16 b, __fp16 c) return c; } -/* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[0-2]} 3 } } */ -/* { dg-final { scan-assembler-times {mov\tr1, r[03]} 1 } } */ -/* { dg-final { scan-assembler-times {mov\tr0, r[0-9]+} 2 } } */ +/* The swap must include two moves out of r0/r1 and two moves in. */ +/* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[01]} 2 } } */ +/* { dg-final { scan-assembler-times {mov\tr[01], r[0-9]+} 2 } } */ +/* c should be spilled around the call. */ +/* { dg-final { scan-assembler {str\tr2, ([^\n]*).*ldrh\tr0, \1} { target arm_little_endian } } } */ diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c index daac29137ae..09fa64aa494 100644 --- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c +++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c @@ -16,6 +16,8 @@ F (__fp16 a, __fp16 b, __fp16 c) return c; } -/* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[0-2]} 3 } } */ -/* { dg-final { scan-assembler-times {mov\tr1, r[03]} 1 } } */ -/* { dg-final { scan-assembler-times {mov\tr0, r[0-9]+} 2 } } */ +/* The swap must include two moves out of r0/r1 and two moves in. */ +/* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[01]} 2 } } */ +/* { dg-final { scan-assembler-times {mov\tr[01], r[0-9]+} 2 } } */ +/* c should be spilled around the call. */ +/* { dg-final { scan-assembler {str\tr2, ([^\n]*).*ldrh\tr0, \1} { target arm_little_endian } } } */