From patchwork Mon May 21 15:54:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 917710 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478085-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ysm18EIB"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40qNcv2T4Mz9s19 for ; Tue, 22 May 2018 01:54:22 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=R6ULvjVsZNQDa1wzvUxnO0S49g8OIuhnGLLDdFSwp8DXkD YD75YoUML7WwqAan7uY+InyhKZf1VFfCw7vCUoef4Yc6JH+kf+xXpG+Jo1VcdpCZ e0MrT3BlmWf7cpDBtgMf7rylS5tHuYBQMPFqRqIsPhZZNaj3YryOLPM3DEuAc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=ozlove4y6x+sVL9urqxSOan2jJY=; b=Ysm18EIBsKDtdKdtBkH0 1IrZYn+78YRvBMeVoOE/Gn1mB+kViEHH/gJ8i5hnoXLfGMhPbd3cmrQpRFmm5WnG PEuJhu2VlsdESilqucWL2Hq69KL3gAJDK2IGYmu9degXJd9zESbAzmtk+IBrhxNg W4XvNcAoF0yj0alKTZT3Lrc= Received: (qmail 55714 invoked by alias); 21 May 2018 15:54:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 55406 invoked by uid 89); 21 May 2018 15:54:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 May 2018 15:54:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E649C1596 for ; Mon, 21 May 2018 08:54:11 -0700 (PDT) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9219A3F577 for ; Mon, 21 May 2018 08:54:11 -0700 (PDT) Message-ID: <5B02EBA2.80204@foss.arm.com> Date: Mon, 21 May 2018 16:54:10 +0100 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH][AArch64][committed] Fix gcc.target/aarch64/vec_init_1.c for tiny and large mcmodels Hi all, This recently-committed test fails the INS scan for tiny and large memory models. That is because instead of the: make_vector: adrp x1, a adrp x0, b movi v0.4s, 0 ldr s2, [x1, #:lo12:a] ldr s1, [x0, #:lo12:b] ins v0.s[2], v2.s[0] ins v0.s[3], v1.s[0] ret That we generate for the default small model, we end up with a simple register addressing mode with no addend/offset for the lane load: make_vector: movi v0.4s, 0 adr x1, a adr x0, b ld1 {v0.s}[2], [x1] ld1 {v0.s}[3], [x0] ret and make_vector: movi v0.4s, 0 adrp x0, .LC0 ldr x1, [x0, #:lo12:.LC0] adrp x0, .LC1 ldr x0, [x0, #:lo12:.LC1] ld1 {v0.s}[2], [x1] ld1 {v0.s}[3], [x0] ret So we end up merging the load and the lane insert. This patch adjusts the testcase to scan for the right thing accordingly. Checked that the testcase passes with -mcmodel=tiny, -mcmodel=small, -mcmodel=large. Committing to trunk as obvious. Thanks, Kyrill 2018-05-21 Kyrylo Tkachov * gcc.target/aarch64/vec_init_1.c: Scan for LD1 instead of INS for tiny and large memory models. commit fb56afe1f049ba92235c4c272bd39dc730ce5d1f Author: kyrtka01 Date: Mon May 21 15:39:05 2018 +0100 [AArch64] Fix gcc.target/aarch64/vec_init_1.c for tiny and large mcmodels diff --git a/gcc/testsuite/gcc.target/aarch64/vec_init_1.c b/gcc/testsuite/gcc.target/aarch64/vec_init_1.c index e245dc1..c8b48da 100644 --- a/gcc/testsuite/gcc.target/aarch64/vec_init_1.c +++ b/gcc/testsuite/gcc.target/aarch64/vec_init_1.c @@ -25,7 +25,11 @@ main (int argc, char **argv) return 0; } -/* { dg-final { scan-assembler-times "ins\\t" 2 } } */ +/* For memory models that don't have an addend on the lane value + load we can merge the load and lane insert into an LD1. + For others we expect LDR + INS sequences. */ +/* { dg-final { scan-assembler-times "ld1\\t" 2 { target { aarch64_tiny || aarch64_large } } } } */ +/* { dg-final { scan-assembler-times "ins\\t" 2 { target aarch64_small } } } */ /* What we want to check, is that make_vector does not stp the whole vector to the stack. Unfortunately here we scan the body of main() too, which may be a bit fragile - the test is currently passing only because of the option