From patchwork Wed Mar 7 11:23:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renlin Li X-Patchwork-Id: 882554 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-474377-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="ChPqXRwI"; 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 3zxB8s1mhtz9sfF for ; Wed, 7 Mar 2018 22:23:23 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=oip1ESOebY/cAG+xcdq733cvyJnOZObk479dCLeHyiZj3d9LIj tSeRUvIuvvtjOgXrFB2Bda57oP+gbyma9EsO97yS21TAu/b/Vc2MWu1cGgiMXTri fQ+8t4w4gQ4+XFGEqHo/OC4ReuyJ9U4K2GKppOEF0d6DvN93oO8IANfEE= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=lwddrdBIcsZjEGBmF0YrqZrw9Wc=; b=ChPqXRwIB8pmSqh5kTJJ pnv3GIkNpgilDAFzt8MsuHewUVQYrPzsUhdQaFKm9+eJgpUzuqcObFOLIcvVt2eR b2jBibMQ7+OG52T2Gl8E76E1BZupg8CG9iX66/e7+9fsAek6Bn3TY15jYSG/qA0N tnxcBajs+n05SO8I0kNIPQ8= Received: (qmail 61014 invoked by alias); 7 Mar 2018 11:23:16 -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 60963 invoked by uid 89); 7 Mar 2018 11:23:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_LOTSOFHASH, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=0h, renlin.li@arm.com, renlinliarmcom, 19520 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; Wed, 07 Mar 2018 11:23:14 +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 9126514; Wed, 7 Mar 2018 03:23:12 -0800 (PST) Received: from [10.2.206.38] (e109742-lin.cambridge.arm.com [10.2.206.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E75513F487; Wed, 7 Mar 2018 03:23:11 -0800 (PST) To: "gcc-patches@gcc.gnu.org" , Tamar Christina , James Greenhalgh From: Renlin Li Subject: [PATCH][AARCH64]Fix immediate alternative of movhf_aarch64 pattern. Message-ID: <0a56bab2-06f6-48df-4897-2ddca3b6e5d8@foss.arm.com> Date: Wed, 7 Mar 2018 11:23:10 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi all, For the immediate alternative, the constraint checks the operand with HF mode while SImode is provided to the output template generation function. Before the change, this inconsistency causes an ICE compiling the new test case in the patch. aarch64-none-elf regression test Okay. Okay to commit the patch? Regards, Renlin gcc/ChangeLog: 2018-03-07 Renlin Li * config/aarch64/aarch64.md (movhf_aarch64): Fix mode argument to aarch64_output_scalar_simd_mov_immediate. gcc/testsuite/ChangeLog: 2018-03-07 Renlin Li * gcc.target/aarch64/movi_hf.c: New. * gcc.target/aarch64/f16_mov_immediate_1.c: Update. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 5a2a9309a3bbbfad6fcb6db07422d774909f0ba1..391fdd07e52f4d165a0109e3baa82571bafa37de 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1145,7 +1145,7 @@ umov\\t%w0, %1.h[0] mov\\t%0.h[0], %1.h[0] fmov\\t%h0, %1 - * return aarch64_output_scalar_simd_mov_immediate (operands[1], SImode); + * return aarch64_output_scalar_simd_mov_immediate (operands[1], HImode); ldr\\t%h0, %1 str\\t%h1, %0 ldrh\\t%w0, %1 diff --git a/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c b/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c index 1ed3831e139745227487eafa3ccfdc05c99deb34..3d22d225851af653f17e04ce7c7cc65ee1c86172 100644 --- a/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c +++ b/gcc/testsuite/gcc.target/aarch64/f16_mov_immediate_1.c @@ -45,5 +45,5 @@ __fp16 f5 () } /* { dg-final { scan-assembler-times "mov\tw\[0-9\]+, #?19520" 3 } } */ -/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0xbc, lsl 8" 1 } } */ -/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.2s, 0x4c, lsl 8" 1 } } */ +/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.4h, 0xbc, lsl 8" 1 } } */ +/* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.4h, 0x4c, lsl 8" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/movi_hf.c b/gcc/testsuite/gcc.target/aarch64/movi_hf.c new file mode 100644 index 0000000000000000000000000000000000000000..9521b9b09c87bd5f19cb6b62b1228bae685d8667 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/movi_hf.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -std=c99" } */ + +__fp16 +foo () +{ + /* { dg-final { scan-assembler "movi\tv\[0-9\]+\.8b" } } */ + return 0x1.544p5; +}