From patchwork Wed Aug 28 15:42:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1977955 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=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4Wv7wZ11YMz1yZd for ; Thu, 29 Aug 2024 01:43:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CBDC2386100E for ; Wed, 28 Aug 2024 15:43:03 +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 7E1B03858C31 for ; Wed, 28 Aug 2024 15:42:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E1B03858C31 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 7E1B03858C31 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=1724859763; cv=none; b=EytIiOfDKMau4oVWJSnAtx6qoa95dlvbuUJWJ1nyMO/J55B9INWPLZ38EqfTJ3ITPaH2xa5LS90UeWrzPvxriF9ryQ2rHChc0TwwiUbR46Fq22EcY1b7K5SYhoOp9UumZPGP7R+saxRLN/oJ2KxxpwtTWo1u1RHuymJdzKcZEiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724859763; c=relaxed/simple; bh=OOLDTG5ptGTAOyBBihPnNclpaMqGvCN/ChVR7OhtbTc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ckDS3VPG9zaxxrsLBEK81RyTAG5AVw2ZZDJMHL5kT41hk4t+dzZzXcvY+vv4d03OSt8CrY4SthKdKFDL2zn3OyinzJVWUHtIa2/S4aTYQOz8K6EUHiNtBLmtt6o/ghEK7p5dssq0mj5m9rALQZEpGIk1ZA6lQM6nbwY8ecZcz00= 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 326F3DA7 for ; Wed, 28 Aug 2024 08:43:07 -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 92A303F73B for ; Wed, 28 Aug 2024 08:42:40 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [pushed] aarch64: Add a test for zeroing <64bits>x2_t structures Date: Wed, 28 Aug 2024 16:42:39 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-18.8 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, T_SCC_BODY_TEXT_LINE 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 g:8d6c6fbc5271dde433998c09407b30e2cf195420 improved the code generated for functions like: void test_s8 (int8x8x2_t *ptr) { *ptr = (int8x8x2_t) {}; } Previously we would load zero from the constant pool, whereas now we just use "stp xzr, xzr". This patch adds a test for this improvement. Tested on aarch64-linux-gnu & pushed. Richard gcc/testsuite/ * gcc.target/aarch64/struct_zero.c: New test. --- .../gcc.target/aarch64/struct_zero.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/struct_zero.c diff --git a/gcc/testsuite/gcc.target/aarch64/struct_zero.c b/gcc/testsuite/gcc.target/aarch64/struct_zero.c new file mode 100644 index 00000000000..13f7236a4d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/struct_zero.c @@ -0,0 +1,21 @@ +/* { dg-options "-O2" } */ + +#include + +void test_s8 (int8x8x2_t *ptr) { *ptr = (int8x8x2_t) {}; } +void test_u8 (uint8x8x2_t *ptr) { *ptr = (uint8x8x2_t) {}; } +void test_p8 (poly8x8x2_t *ptr) { *ptr = (poly8x8x2_t) {}; } +void test_s16 (int16x4x2_t *ptr) { *ptr = (int16x4x2_t) {}; } +void test_u16 (uint16x4x2_t *ptr) { *ptr = (uint16x4x2_t) {}; } +void test_p16 (poly16x4x2_t *ptr) { *ptr = (poly16x4x2_t) {}; } +void test_bf16 (bfloat16x4x2_t *ptr) { *ptr = (bfloat16x4x2_t) {}; } +void test_f16 (float16x4x2_t *ptr) { *ptr = (float16x4x2_t) {}; } +void test_s32 (int32x2x2_t *ptr) { *ptr = (int32x2x2_t) {}; } +void test_u32 (uint32x2x2_t *ptr) { *ptr = (uint32x2x2_t) {}; } +void test_f32 (float32x2x2_t *ptr) { *ptr = (float32x2x2_t) {}; } +void test_s64 (int64x1x2_t *ptr) { *ptr = (int64x1x2_t) {}; } +void test_u64 (uint64x1x2_t *ptr) { *ptr = (uint64x1x2_t) {}; } +void test_p64 (poly64x1x2_t *ptr) { *ptr = (poly64x1x2_t) {}; } +void test_f64 (float64x1x2_t *ptr) { *ptr = (float64x1x2_t) {}; } + +/* { dg-final { scan-assembler-times {\tstp\txzr, xzr, \[x0\]\n} 15 } } */