From patchwork Fri Nov 8 10:54:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178869 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2504947ilf; Fri, 8 Nov 2019 02:54:52 -0800 (PST) X-Google-Smtp-Source: APXvYqz0O6Dsteu25Qlu0R6AMQOGGGsQVmq9uSXqd0rB2p3SUykqyedzKhCMjNU5PWwUqa73PobJ X-Received: by 2002:a50:ae26:: with SMTP id c35mr9672875edd.55.1573210491938; Fri, 08 Nov 2019 02:54:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573210491; cv=none; d=google.com; s=arc-20160816; b=dNKCTJ7Qq+PiCIS+7WM3x7WhwSaLHudqWw9kORK/bRjHUwDH/zY+YcPP9mJfnDcoHA Cfei2cOGaPX0Fixy4ep4ldQKyefM4JHVuzvJSKw4UYvebsOwMO+KFmyJDo6Iry07UZRd Zv6+8ATTrzbgIskkxNpFIEWAFAux5AiZgq9TQaOmPmyheLpH2JnokyTwx/i4VJqiSVvd v5FdVLF7IH4K8BYc+mKnPZ3Q1F3jcmi1qQifq+3b2G0S5QD4u98orRQb65gFkVODPCSl cJgq4G22nIhalrXYzygOj1LQtJ57aDoPHI7ieK6T5Bh2xbdkIU+O50qxfArK9dnaxoc4 j/zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=kv8Pk7QLFje7jijJIJfsJv6Tsk/b8ftTEdiQ5o1gC9k=; b=DHh1qbBOXwW7BCXOP7XMjk6B/b6Bbxx3iyVnjv++F9aBeTPEQH+3wol9cvpYvdEQmc 1EytdECXXwbQ1rgwsN688Hh1Da4vLTDPazdAXgGtfjbavgnbfQM56j7xT99gzp5oxs3t KbH5o564dlFoPSqPgKJOLhSaqHy1LA5WReSqRjSpDFS/9oMVslR0LNQuzLTcmX/RBVhr iI3VLUmI5mwsduEhiAKFtiWjOSJhNUU5cIAO3hHdgvqPH2O2F/OOAVoijhuaKHO0va8e P9B87Oss932lL3B589P6agZ1MM6yP9acZLfG9V4HQSeVQspaWsqRpFN+pRX/2PX6KGe+ vUQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Puh5m3g7; dkim=pass header.i=@linaro.org header.s=google header.b=NJvtvgti; spf=pass (google.com: domain of gcc-patches-return-512802-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512802-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l11si3600986ejq.208.2019.11.08.02.54.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 02:54:51 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-512802-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Puh5m3g7; dkim=pass header.i=@linaro.org header.s=google header.b=NJvtvgti; spf=pass (google.com: domain of gcc-patches-return-512802-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512802-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=fhwHnt/5iB4QIPPzhsXa8I7BXjmGP0HRQ16lHpdylwodRx+FynGQ3 WJIJaNfqPbV0CHdiBQkcDwNJ5GLGJZI5yWbMRVgR3Sil+2at6einBsaYkB8Uxq2P DG+NOKf8so3blzbGZYDOZlPzt7axeakBbFnfo8U/XL9XUTnithJwPs= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=H8ywbrHGz6cHUyslId+WGcMd6r4=; b=Puh5m3g7TIkn6DEldg39 2K5o00lxf8w346Ko8O3XJsJMPDZd+NsThTGrkmi8PG0rcoGmaDZU7wZ41v36ih8W nol6+bh/CR+ygIJqoAvqT4BEuzAtgOkyxEhxaRBHWKjQzQjj24ldErc15Psk3N8U XuY1mIuM2T/VMn4zA1lfRaM= Received: (qmail 105517 invoked by alias); 8 Nov 2019 10:54:27 -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 105486 invoked by uid 89); 8 Nov 2019 10:54:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*RU:209.85.128.68, HX-Spam-Relays-External:209.85.128.68 X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 10:54:25 +0000 Received: by mail-wm1-f68.google.com with SMTP id q130so5731898wme.2 for ; Fri, 08 Nov 2019 02:54:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kv8Pk7QLFje7jijJIJfsJv6Tsk/b8ftTEdiQ5o1gC9k=; b=NJvtvgtiwa8/Pd+FiABZo3CiD08Vuzk0BC/g2mjVW8n3WOQciRSFzVDEVKoq4NiiPj l+epx3IODP4ejNE0gJVBUxHaU8Y9KKVX3qg7CJepdK0ok7t8Q8r6IDcZg/TyWJExkKiE Yz6sJKiQ8dspU33lyHDNZgilvOO64HjvA7JrasoHxPGGAcil38xKPHiG4WjsfI4wZOzf Kz8s1vfNRxSG/7fQQ+pAYug+mJDMs938NKanmTq0XZUCIoZXlWGzZqY3XLBk2dHC6q7s 8F8GIQrKHAfZeVj4JPTEw0aW1DnRJg3U7cLhh5QYhhaEcVuZvKBcQLWFrGipz30LT2Jy OCpw== Return-Path: Received: from localhost.localdomain (212.red-213-99-162.dynamicip.rima-tde.net. [213.99.162.212]) by smtp.gmail.com with ESMTPSA id 19sm8046565wrc.47.2019.11.08.02.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 02:54:22 -0800 (PST) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, james.greenhalgh@arm.com, richard.sandiford@arm.com, marcus.shawcroft@arm.com, kyrylo.tkachov@arm.com Subject: [PATCH 1/6] aarch64: Add "c" constraint Date: Fri, 8 Nov 2019 11:54:03 +0100 Message-Id: <20191108105408.27584-2-richard.henderson@linaro.org> In-Reply-To: <20191108105408.27584-1-richard.henderson@linaro.org> References: <20191108105408.27584-1-richard.henderson@linaro.org> Mirror arm in letting "c" match the condition code register. * config/aarch64/constraints.md (c): New constraint. --- gcc/config/aarch64/constraints.md | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 diff --git a/gcc/config/aarch64/constraints.md b/gcc/config/aarch64/constraints.md index d0c3dd5bc1f..b9e5d13e851 100644 --- a/gcc/config/aarch64/constraints.md +++ b/gcc/config/aarch64/constraints.md @@ -39,6 +39,10 @@ (define_register_constraint "y" "FP_LO8_REGS" "Floating point and SIMD vector registers V0 - V7.") +(define_constraint "c" + "@internal The condition code register." + (match_operand 0 "cc_register")) + (define_constraint "I" "A constant that can be used with an ADD operation." (and (match_code "const_int") From patchwork Fri Nov 8 10:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178870 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2505330ilf; Fri, 8 Nov 2019 02:55:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwMKow/Em9SgGlru2C3oHYo+MsUHieGPr4qPqy4tMJvNaNRcrBn4OqZiE3ew4uoTrUBLyjA X-Received: by 2002:a50:cb86:: with SMTP id k6mr9560646edi.270.1573210509062; Fri, 08 Nov 2019 02:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573210509; cv=none; d=google.com; s=arc-20160816; b=kOL3O4JeWlCBPmEnF907K7SC8qJ0/0xJoqlbvih6l6yZ5hNeAfrolDvISaxq2ZdW1J FW1fvsTa7yCZT6ABa35a+V2xzUxqxiFPEeSuHp2QOwvodJhL9Qa+ygxjytjD39zujiMs /TbbsU/1y077nr3RJGH5PYeLKjGoWLbHPdhcvA9NQrcne6OPLsN1jqs6qk95G0i9eGnT tp4hWqRZtxg33Clg5Jzy7ZX+rmYh2auAT46A3Hgg5glhzAI+8q8bW7/kdeaLlS2Egy+1 jJE8/qPlDNwUkKFUpM3YfBwd1VodyX6tU2iHsJ5dePPoZBm4KHAzihW1hcA/W4dRVsHB 7Qyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=089Bc4beoJzRBjhSd5mq9EoVlTd3JUiH87uldhE5CrI=; b=UnTUacjZyvkmJbU0jQF52fPl+hWmRvbywiizJGfgqrg3I2MQFYj/9tYGScBjL8lKdk LKpqLFER1liQpgF95OdBUtP4jiC87s4RuRl+sqaiFo8tKJ7H+70T32V2PLu+Jx3EEOhA P5G/ENZOkTuH+QDA+H/o/S2OXyG+3rC7AzEWGJMG/f2L/krjsQLssyVlRnHwdpFxZivL QXrpgZNlf5qp423VYk2cHQbmqdAjIxc/QbvF5NJHZn9MjSDIjtIR4NO854jMAUtxAm1d C70fAuthYwkqQpLI1KZ69/jnptRbjl2j6DQLZ91ZTzyIsclGLCYfeHBXDr/9XoEVOWHP ncbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BIHD1kSb; dkim=pass header.i=@linaro.org header.s=google header.b=PqlROorF; spf=pass (google.com: domain of gcc-patches-return-512803-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512803-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w57si3691256eda.78.2019.11.08.02.55.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 02:55:09 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-512803-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BIHD1kSb; dkim=pass header.i=@linaro.org header.s=google header.b=PqlROorF; spf=pass (google.com: domain of gcc-patches-return-512803-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512803-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=FJxy1zuiQmZ0QMptT6e1OQaosHXKThwP2T599zoL6Wc/LpJ5s67JG za27YMKj+MTUtapm+J7Iycqn5blt/0HU6BWgy5LYyW04J3/E/KyMYV7R6keKK7+1 tFwJHpXcepwpgfTuqC3PK4qAyt6bOLYnVi4N4epFUCR8OOgY9/3pQI= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=FMGzwvLLe1OshKMnoXIuBcXR6z0=; b=BIHD1kSbuDWEgNv9mq2z +s93Y40wbhlUfliBahAFitoeSTB7ct44TZYEFonNlOYN+Z/8DOITO4j/Q+qreufI bPuQuIGpGak9nigtvHtafLKi27yIiywBTtoPlEjx1ltfB5FAgYKNZJqsXikpZZYc +v2av+Z5Kn5QvwCg6g+/amE= Received: (qmail 105869 invoked by alias); 8 Nov 2019 10:54:29 -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 105683 invoked by uid 89); 8 Nov 2019 10:54:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f67.google.com Received: from mail-wm1-f67.google.com (HELO mail-wm1-f67.google.com) (209.85.128.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 10:54:27 +0000 Received: by mail-wm1-f67.google.com with SMTP id v3so7055756wmh.1 for ; Fri, 08 Nov 2019 02:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=089Bc4beoJzRBjhSd5mq9EoVlTd3JUiH87uldhE5CrI=; b=PqlROorFbiH4SmUEVW+hx79FsY5b6terYClEtIvgV9jEPcl3yZS0A3/f4b96sVVLhA 7nLJVm0mJCI1UN/NeR02fJL7z6fZ9d07PQ87NoR+TS6rcAztn8M5Gw7aRkaHOeqdfMVo KRYjcomKL8G40RVbp9RS5ucNfxorfG3PFHlS5Y+mRcDrC1yrfftgvNXbfHKjoOZJdQW+ YPiiNMFIPwPKNc6Jz98TkrOdZIrXjKodu/iJI1tnAs7QJ1j8BMzGbocQyDP0PkxuxtFN nBl88ygWy/pLfBxGwNNUXr4z5tJGCYUy/s9idMtW00+GRC/hHPNXKwBBfBvGZA3TLus+ bAOw== Return-Path: Received: from localhost.localdomain (212.red-213-99-162.dynamicip.rima-tde.net. [213.99.162.212]) by smtp.gmail.com with ESMTPSA id 19sm8046565wrc.47.2019.11.08.02.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 02:54:24 -0800 (PST) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, james.greenhalgh@arm.com, richard.sandiford@arm.com, marcus.shawcroft@arm.com, kyrylo.tkachov@arm.com Subject: [PATCH 2/6] arm: Fix the "c" constraint Date: Fri, 8 Nov 2019 11:54:04 +0100 Message-Id: <20191108105408.27584-3-richard.henderson@linaro.org> In-Reply-To: <20191108105408.27584-1-richard.henderson@linaro.org> References: <20191108105408.27584-1-richard.henderson@linaro.org> The existing definition using register class CC_REG does not work because CC_REGNUM does not support normal modes, and so fails to match register_operand. Use a non-register constraint and the cc_register predicate instead. * config/arm/constraints.md (c): Use cc_register predicate. --- gcc/config/arm/constraints.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md index b76de81b85c..e02b678d26d 100644 --- a/gcc/config/arm/constraints.md +++ b/gcc/config/arm/constraints.md @@ -94,8 +94,9 @@ "@internal Thumb only. The union of the low registers and the stack register.") -(define_register_constraint "c" "CC_REG" - "@internal The condition code register.") +(define_constraint "c" + "@internal The condition code register." + (match_operand 0 "cc_register")) (define_register_constraint "Cs" "CALLER_SAVE_REGS" "@internal The caller save registers. Useful for sibcalls.") From patchwork Fri Nov 8 10:54:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178873 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2506172ilf; Fri, 8 Nov 2019 02:55:54 -0800 (PST) X-Google-Smtp-Source: APXvYqwuh9hH92iIVUUHTPHkmtEGnqZdNawTze+yjxVQfVBSs2lpFDqimJSnKoLAq6NZw2Y7UUtL X-Received: by 2002:aa7:c716:: with SMTP id i22mr9341117edq.237.1573210553930; Fri, 08 Nov 2019 02:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573210553; cv=none; d=google.com; s=arc-20160816; b=HqnCyDJDDEL8cFv7WzCTOFnQKpshS1GxvZtKfFpL60enEzQu7nq6sVDCU6GVySFJZx OtTIwKRAmJZ6IoAyZvMEN8K0l6bMlWFC7nKFGR8/hvhzTSw1u84oN0iq2W4ayOQxWScH jSSE4g1Ng032RXgTtXpN02VlJZwRJPIuenCm+dEI0N8KeO8xVtEZ7zPaA/IkKUbL4KQ0 5ZOoMErEGQ+b+7UqTuwkbBLHx3JX7eSYl1/wwzGVTeE+5Ilqx+z4u7AzfHh1y3krQxWm 7eCgF7gFlzB+EdnY26zVF5pcItp/97+XLnVh/Yv4+9+k6fhNNd9j9XSkRMdpxNy6jyK8 gaGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=iBu8U0AW1LmXehiUw/WHfvnWBIQeCXoc1IVbNQen3wM=; b=oTA/PLFrsrr2/J/BYlE0djZHkUy5MJCu+XEs8cROUNWuO+LlbtQCH8FOcyZTAdU8b4 CvZAYc9TjLgVLmdv8YdHPP0/+DOJGl5tEdpDAkZuf17R0sk0w/Bbn+YvALPYNRr2O4Q3 KME7cq7XHN9vFNA1A6j8kTdK1bPmfakrWz2OY+NxXgzByRwf2N8hVXIZQHqSLFUhvKcF EsuXGV7bgjA3ULElI4w68ZelR71+o5Lvz9YWeIAD6+evZtEHoYEPMHhDUdwOSBHDvtqe XYDZITGzq1Nv4ozyr2yv4n/w3OivuI3gHmo+lt+ofLtgcHANddTYsjaLx0tHo1m7IU7O no5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DApnQ4DM; dkim=pass header.i=@linaro.org header.s=google header.b=WB9Mg3gG; spf=pass (google.com: domain of gcc-patches-return-512806-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512806-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c2si4422222eda.322.2019.11.08.02.55.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 02:55:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-512806-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DApnQ4DM; dkim=pass header.i=@linaro.org header.s=google header.b=WB9Mg3gG; spf=pass (google.com: domain of gcc-patches-return-512806-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512806-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=sTVx3JBXgmC+8ofncxQYsphK1lmwHh8lSxCVfWZj3I69fNVCeMIvn 2iqOEz8vx3WaiDpt/Ix2tA+7TxhdOUuugw8b9IvC4MO7rJBMjPzYBYpB9jK3zUIg FTidjLmZpYhP27gNPj3w69Zil7Py7Yyty0Tbw+Sjsd3LzdjRtfhuYw= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=CaavqFbtIMTOCwbHLgzDFVaZtH0=; b=DApnQ4DMd2jhS7ARVYl1 iMQpyRNH9SPBxneGQVFuJZEPIniCehL/k6ZML45muqu2w1Xl70A1yXdYRA1rrX6S 0BXDVd3dvbR3VgVQTB5J+jBtEGUFGfPymmhUmm5A8iIrSgME+hlnckRJtYIAyz/z b2WR13nlMHb77sNl3Mxc6nk= Received: (qmail 106735 invoked by alias); 8 Nov 2019 10:54:35 -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 106608 invoked by uid 89); 8 Nov 2019 10:54:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=if_then_else X-HELO: mail-wm1-f65.google.com Received: from mail-wm1-f65.google.com (HELO mail-wm1-f65.google.com) (209.85.128.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 10:54:29 +0000 Received: by mail-wm1-f65.google.com with SMTP id q70so5696044wme.1 for ; Fri, 08 Nov 2019 02:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iBu8U0AW1LmXehiUw/WHfvnWBIQeCXoc1IVbNQen3wM=; b=WB9Mg3gGuJy3bLWNhXuwA0pmFdwL9LQqzoPjFM89U98YjNr4u4zbhlE5QOGn0PTEPL QzLveUa6yN/yMt+Awb+uPHKOq1gmvupP3/nnFEhvuFEL+s4sn4o7y/z6FbpUChHY4W88 cPaCEJluMEZJYY41bldEfd3BBEplB3MkgD6zmOtqah3EUfeQyAgAD6zKn0n1B1pDWE5S 4SRXbs6N8okcNFJCL9t6I8pWfDQioJ+zqpqSZeNuUspjRrCJCnQupUwStVAkak9WXiWd 3VtP3NdxdhopFkzF/s9KpbNWQNXFjDeRjXIhHuYS+7+zEQ3Uab2gAJVv3ZpcWb3aOiJ7 z4HQ== Return-Path: Received: from localhost.localdomain (212.red-213-99-162.dynamicip.rima-tde.net. [213.99.162.212]) by smtp.gmail.com with ESMTPSA id 19sm8046565wrc.47.2019.11.08.02.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 02:54:25 -0800 (PST) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, james.greenhalgh@arm.com, richard.sandiford@arm.com, marcus.shawcroft@arm.com, kyrylo.tkachov@arm.com Subject: [PATCH 3/6] arm: Rename CC_NOOVmode to CC_NZmode Date: Fri, 8 Nov 2019 11:54:05 +0100 Message-Id: <20191108105408.27584-4-richard.henderson@linaro.org> In-Reply-To: <20191108105408.27584-1-richard.henderson@linaro.org> References: <20191108105408.27584-1-richard.henderson@linaro.org> CC_NZmode is a more accurate description of what we require from the mode, and matches up with the definition in aarch64. Rename noov_comparison_operator to nz_comparison_operator in order to match. * config/arm/arm-modes.def (CC_NZ): Rename from CC_NOOV. * config/arm/predicates.md (nz_comparison_operator): Rename from noov_comparison_operator. * config/arm/arm.c (arm_select_cc_mode): Use CC_NZmode name. (arm_gen_dicompare_reg): Likewise. (maybe_get_arm_condition_code): Likewise. (thumb1_final_prescan_insn): Likewise. (arm_emit_coreregs_64bit_shift): Likewise. * config/arm/arm.md (addsi3_compare0): Likewise. (*addsi3_compare0_scratch, subsi3_compare0): Likewise. (*mulsi3_compare0, *mulsi3_compare0_v6): Likewise. (*mulsi3_compare0_scratch, *mulsi3_compare0_scratch_v6): Likewise. (*mulsi3addsi_compare0, *mulsi3addsi_compare0_v6): Likewise. (*mulsi3addsi_compare0_scratch): Likewise. (*mulsi3addsi_compare0_scratch_v6): Likewise. (*andsi3_compare0, *andsi3_compare0_scratch): Likewise. (*zeroextractsi_compare0_scratch): Likewise. (*ne_zeroextractsi, *ne_zeroextractsi_shifted): Likewise. (*ite_ne_zeroextractsi, *ite_ne_zeroextractsi_shifted): Likewise. (andsi_not_shiftsi_si_scc_no_reuse): Likewise. (andsi_not_shiftsi_si_scc): Likewise. (*andsi_notsi_si_compare0, *andsi_notsi_si_compare0_scratch): Likewise. (*iorsi3_compare0, *iorsi3_compare0_scratch): Likewise. (*xorsi3_compare0, *xorsi3_compare0_scratch): Likewise. (*shiftsi3_compare0, *shiftsi3_compare0_scratch): Likewise. (*not_shiftsi_compare0, *not_shiftsi_compare0_scratch): Likewise. (*notsi_compare0, *notsi_compare0_scratch): Likewise. (return_addr_mask, *check_arch2): Likewise. (*arith_shiftsi_compare0, *arith_shiftsi_compare0_scratch): Likewise. (*sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch): Likewise. (compare_scc splitters): Likewise. (movcond_addsi): Likewise. * config/arm/thumb2.md (thumb2_addsi3_compare0): Likewise. (*thumb2_addsi3_compare0_scratch): Likewise. (*thumb2_mulsi_short_compare0): Likewise. (*thumb2_mulsi_short_compare0_scratch): Likewise. (compare peephole2s): Likewise. * config/arm/thumb1.md (thumb1_cbz): Use CC_NZmode and nz_comparison_operator names. (cbranchsi4_insn): Likewise. --- gcc/config/arm/arm.c | 12 +-- gcc/config/arm/arm-modes.def | 4 +- gcc/config/arm/arm.md | 186 +++++++++++++++++------------------ gcc/config/arm/predicates.md | 2 +- gcc/config/arm/thumb1.md | 8 +- gcc/config/arm/thumb2.md | 34 +++---- 6 files changed, 123 insertions(+), 123 deletions(-) -- 2.17.1 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index eddd3ca93ed..b620322318b 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -15379,7 +15379,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) || GET_CODE (x) == ASHIFT || GET_CODE (x) == ASHIFTRT || GET_CODE (x) == ROTATERT || (TARGET_32BIT && GET_CODE (x) == ZERO_EXTRACT))) - return CC_NOOVmode; + return CC_NZmode; /* A comparison of ~reg with a const is really a special canoncialization of compare (~const, reg), which is a reverse @@ -15495,11 +15495,11 @@ arm_gen_dicompare_reg (rtx_code code, rtx x, rtx y, rtx scratch) } rtx clobber = gen_rtx_CLOBBER (VOIDmode, scratch); - cc_reg = gen_rtx_REG (CC_NOOVmode, CC_REGNUM); + cc_reg = gen_rtx_REG (CC_NZmode, CC_REGNUM); rtx set = gen_rtx_SET (cc_reg, - gen_rtx_COMPARE (CC_NOOVmode, + gen_rtx_COMPARE (CC_NZmode, gen_rtx_IOR (SImode, x_lo, x_hi), const0_rtx)); emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, set, @@ -23884,7 +23884,7 @@ maybe_get_arm_condition_code (rtx comparison) return code; return ARM_NV; - case E_CC_NOOVmode: + case E_CC_NZmode: switch (comp_code) { case NE: return ARM_NE; @@ -25307,7 +25307,7 @@ thumb1_final_prescan_insn (rtx_insn *insn) cfun->machine->thumb1_cc_insn = insn; cfun->machine->thumb1_cc_op0 = SET_DEST (set); cfun->machine->thumb1_cc_op1 = const0_rtx; - cfun->machine->thumb1_cc_mode = CC_NOOVmode; + cfun->machine->thumb1_cc_mode = CC_NZmode; if (INSN_CODE (insn) == CODE_FOR_thumb1_subsi3_insn) { rtx src1 = XEXP (SET_SRC (set), 1); @@ -30484,7 +30484,7 @@ arm_emit_coreregs_64bit_shift (enum rtx_code code, rtx out, rtx in, else { /* We have a shift-by-register. */ - rtx cc_reg = gen_rtx_REG (CC_NOOVmode, CC_REGNUM); + rtx cc_reg = gen_rtx_REG (CC_NZmode, CC_REGNUM); /* This alternative requires the scratch registers. */ gcc_assert (scratch1 && REG_P (scratch1)); diff --git a/gcc/config/arm/arm-modes.def b/gcc/config/arm/arm-modes.def index a6b520df32d..2ce53e0efba 100644 --- a/gcc/config/arm/arm-modes.def +++ b/gcc/config/arm/arm-modes.def @@ -29,7 +29,7 @@ ADJUST_FLOAT_FORMAT (HF, ((arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE) /* CCFPEmode should be used with floating inequalities, CCFPmode should be used with floating equalities. - CC_NOOVmode should be used with SImode integer equalities. + CC_NZmode should be used if only the N and Z bits are set correctly. CC_Zmode should be used if only the Z flag is set correctly CC_Cmode should be used if only the C flag is set correctly, after an addition. @@ -47,7 +47,7 @@ ADJUST_FLOAT_FORMAT (HF, ((arm_fp16_format == ARM_FP16_FORMAT_ALTERNATIVE) against one of the other operands. CCmode should be used otherwise. */ -CC_MODE (CC_NOOV); +CC_MODE (CC_NZ); CC_MODE (CC_Z); CC_MODE (CC_NV); CC_MODE (CC_SWP); diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 4f035cbfddd..1e325b8924d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -1062,8 +1062,8 @@ ) (define_insn "addsi3_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (match_operand:SI 1 "s_register_operand" "r, r,r") (match_operand:SI 2 "arm_add_operand" "I,L,r")) (const_int 0))) @@ -1079,8 +1079,8 @@ ) (define_insn "*addsi3_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (match_operand:SI 0 "s_register_operand" "r, r, r") (match_operand:SI 1 "arm_add_operand" "I,L, r")) (const_int 0)))] @@ -2001,8 +2001,8 @@ ) (define_insn "subsi3_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (minus:SI (match_operand:SI 1 "arm_rhs_operand" "r,r,I") (match_operand:SI 2 "arm_rhs_operand" "I,r,r")) (const_int 0))) @@ -2240,8 +2240,8 @@ ) (define_insn "*mulsi3_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (mult:SI + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (mult:SI (match_operand:SI 2 "s_register_operand" "r,r") (match_operand:SI 1 "s_register_operand" "%0,r")) (const_int 0))) @@ -2254,8 +2254,8 @@ ) (define_insn "*mulsi3_compare0_v6" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (mult:SI + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (mult:SI (match_operand:SI 2 "s_register_operand" "r") (match_operand:SI 1 "s_register_operand" "r")) (const_int 0))) @@ -2268,8 +2268,8 @@ ) (define_insn "*mulsi_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (mult:SI + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (mult:SI (match_operand:SI 2 "s_register_operand" "r,r") (match_operand:SI 1 "s_register_operand" "%0,r")) (const_int 0))) @@ -2281,8 +2281,8 @@ ) (define_insn "*mulsi_compare0_scratch_v6" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (mult:SI + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (mult:SI (match_operand:SI 2 "s_register_operand" "r") (match_operand:SI 1 "s_register_operand" "r")) (const_int 0))) @@ -2294,8 +2294,8 @@ ) (define_insn "*mulsi3addsi_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (mult:SI (match_operand:SI 2 "s_register_operand" "r,r,r,r") (match_operand:SI 1 "s_register_operand" "%0,r,0,r")) @@ -2311,8 +2311,8 @@ ) (define_insn "*mulsi3addsi_compare0_v6" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (mult:SI (match_operand:SI 2 "s_register_operand" "r") (match_operand:SI 1 "s_register_operand" "r")) @@ -2328,8 +2328,8 @@ ) (define_insn "*mulsi3addsi_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (mult:SI (match_operand:SI 2 "s_register_operand" "r,r,r,r") (match_operand:SI 1 "s_register_operand" "%0,r,0,r")) @@ -2343,8 +2343,8 @@ ) (define_insn "*mulsi3addsi_compare0_scratch_v6" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (mult:SI (match_operand:SI 2 "s_register_operand" "r") (match_operand:SI 1 "s_register_operand" "r")) @@ -2834,8 +2834,8 @@ ) (define_insn "*andsi3_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (match_operand:SI 1 "s_register_operand" "r,r,r") (match_operand:SI 2 "arm_not_operand" "I,K,r")) (const_int 0))) @@ -2851,8 +2851,8 @@ ) (define_insn "*andsi3_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (match_operand:SI 0 "s_register_operand" "r,r,r") (match_operand:SI 1 "arm_not_operand" "I,K,r")) (const_int 0))) @@ -2867,8 +2867,8 @@ ) (define_insn "*zeroextractsi_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (zero_extract:SI + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (zero_extract:SI (match_operand:SI 0 "s_register_operand" "r") (match_operand 1 "const_int_operand" "n") (match_operand 2 "const_int_operand" "n")) @@ -2908,12 +2908,12 @@ && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) + (INTVAL (operands[3]) & 1) <= 8 && INTVAL (operands[2]) + INTVAL (operands[3]) <= 32)" - [(parallel [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (and:SI (match_dup 1) (match_dup 2)) + [(parallel [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (match_dup 1) (match_dup 2)) (const_int 0))) (set (match_dup 0) (and:SI (match_dup 1) (match_dup 2)))]) (set (match_dup 0) - (if_then_else:SI (eq (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (if_then_else:SI (eq (reg:CC_NZ CC_REGNUM) (const_int 0)) (match_dup 0) (const_int 1)))] " operands[2] = GEN_INT (((1 << INTVAL (operands[2])) - 1) @@ -2938,12 +2938,12 @@ "TARGET_ARM" "#" "TARGET_ARM" - [(parallel [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2)) + [(parallel [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (ashift:SI (match_dup 1) (match_dup 2)) (const_int 0))) (set (match_dup 0) (ashift:SI (match_dup 1) (match_dup 2)))]) (set (match_dup 0) - (if_then_else:SI (eq (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (if_then_else:SI (eq (reg:CC_NZ CC_REGNUM) (const_int 0)) (match_dup 0) (const_int 1)))] " operands[2] = GEN_INT (32 - INTVAL (operands[2])); @@ -2976,12 +2976,12 @@ && INTVAL (operands[2]) + (INTVAL (operands[3]) & 1) <= 8 && INTVAL (operands[2]) + INTVAL (operands[3]) <= 32) && !reg_overlap_mentioned_p (operands[0], operands[4])" - [(parallel [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (and:SI (match_dup 1) (match_dup 2)) + [(parallel [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (match_dup 1) (match_dup 2)) (const_int 0))) (set (match_dup 0) (and:SI (match_dup 1) (match_dup 2)))]) (set (match_dup 0) - (if_then_else:SI (eq (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (if_then_else:SI (eq (reg:CC_NZ CC_REGNUM) (const_int 0)) (match_dup 0) (match_dup 4)))] " operands[2] = GEN_INT (((1 << INTVAL (operands[2])) - 1) @@ -3005,12 +3005,12 @@ "TARGET_ARM && !reg_overlap_mentioned_p (operands[0], operands[3])" "#" "TARGET_ARM && !reg_overlap_mentioned_p (operands[0], operands[3])" - [(parallel [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2)) + [(parallel [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (ashift:SI (match_dup 1) (match_dup 2)) (const_int 0))) (set (match_dup 0) (ashift:SI (match_dup 1) (match_dup 2)))]) (set (match_dup 0) - (if_then_else:SI (eq (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (if_then_else:SI (eq (reg:CC_NZ CC_REGNUM) (const_int 0)) (match_dup 0) (match_dup 3)))] " operands[2] = GEN_INT (32 - INTVAL (operands[2])); @@ -3328,8 +3328,8 @@ ;; bics output. Pattern restricts Thumb2 shift operand as bics for Thumb2 ;; does not support shift by register. (define_insn "andsi_not_shiftsi_si_scc_no_reuse" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (not:SI (match_operator:SI 0 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r,r") (match_operand:SI 2 "shift_amount_operand" "M,r")])) @@ -3348,8 +3348,8 @@ ;; Same as andsi_not_shiftsi_si_scc_no_reuse, but the bics result is also ;; getting reused later. (define_insn "andsi_not_shiftsi_si_scc" - [(parallel [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(parallel [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (not:SI (match_operator:SI 0 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r,r") (match_operand:SI 2 "shift_amount_operand" "M,r")])) @@ -3370,8 +3370,8 @@ ) (define_insn "*andsi_notsi_si_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (not:SI (match_operand:SI 2 "s_register_operand" "r")) (match_operand:SI 1 "s_register_operand" "r")) (const_int 0))) @@ -3384,8 +3384,8 @@ ) (define_insn "*andsi_notsi_si_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (not:SI (match_operand:SI 2 "s_register_operand" "r")) (match_operand:SI 1 "s_register_operand" "r")) (const_int 0))) @@ -3474,8 +3474,8 @@ ) (define_insn "*iorsi3_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (ior:SI (match_operand:SI 1 "s_register_operand" "%r,0,r") (match_operand:SI 2 "arm_rhs_operand" "I,l,r")) (const_int 0))) @@ -3490,8 +3490,8 @@ ) (define_insn "*iorsi3_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (ior:SI (match_operand:SI 1 "s_register_operand" "%r,0,r") (match_operand:SI 2 "arm_rhs_operand" "I,l,r")) (const_int 0))) @@ -3564,8 +3564,8 @@ ) (define_insn "*xorsi3_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (xor:SI (match_operand:SI 1 "s_register_operand" "r,r") + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (xor:SI (match_operand:SI 1 "s_register_operand" "r,r") (match_operand:SI 2 "arm_rhs_operand" "I,r")) (const_int 0))) (set (match_operand:SI 0 "s_register_operand" "=r,r") @@ -3577,8 +3577,8 @@ ) (define_insn "*xorsi3_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (xor:SI (match_operand:SI 0 "s_register_operand" "r,r") + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (xor:SI (match_operand:SI 0 "s_register_operand" "r,r") (match_operand:SI 1 "arm_rhs_operand" "I,r")) (const_int 0)))] "TARGET_32BIT" @@ -4227,8 +4227,8 @@ ) (define_insn "*shiftsi3_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (match_operator:SI 3 "shift_operator" + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r,r") (match_operand:SI 2 "arm_rhs_operand" "M,r")]) (const_int 0))) @@ -4242,8 +4242,8 @@ ) (define_insn "*shiftsi3_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (match_operator:SI 3 "shift_operator" + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r,r") (match_operand:SI 2 "arm_rhs_operand" "M,r")]) (const_int 0))) @@ -4268,8 +4268,8 @@ (set_attr "type" "mvn_shift,mvn_shift_reg")]) (define_insn "*not_shiftsi_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (not:SI (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r,r") (match_operand:SI 2 "shift_amount_operand" "M,r")])) @@ -4284,8 +4284,8 @@ (set_attr "type" "mvn_shift,mvn_shift_reg")]) (define_insn "*not_shiftsi_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (not:SI (match_operator:SI 3 "shift_operator" [(match_operand:SI 1 "s_register_operand" "r,r") (match_operand:SI 2 "shift_amount_operand" "M,r")])) @@ -4875,8 +4875,8 @@ ) (define_insn "*notsi_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (not:SI (match_operand:SI 1 "s_register_operand" "r")) + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (not:SI (match_operand:SI 1 "s_register_operand" "r")) (const_int 0))) (set (match_operand:SI 0 "s_register_operand" "=r") (not:SI (match_dup 1)))] @@ -4887,8 +4887,8 @@ ) (define_insn "*notsi_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (not:SI (match_operand:SI 1 "s_register_operand" "r")) + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (not:SI (match_operand:SI 1 "s_register_operand" "r")) (const_int 0))) (clobber (match_scratch:SI 0 "=r"))] "TARGET_32BIT" @@ -8384,7 +8384,7 @@ (define_expand "return_addr_mask" [(set (match_dup 1) - (compare:CC_NOOV (unspec [(const_int 0)] UNSPEC_CHECK_ARCH) + (compare:CC_NZ (unspec [(const_int 0)] UNSPEC_CHECK_ARCH) (const_int 0))) (set (match_operand:SI 0 "s_register_operand") (if_then_else:SI (eq (match_dup 1) (const_int 0)) @@ -8392,12 +8392,12 @@ (const_int 67108860)))] ; 0x03fffffc "TARGET_ARM" " - operands[1] = gen_rtx_REG (CC_NOOVmode, CC_REGNUM); + operands[1] = gen_rtx_REG (CC_NZmode, CC_REGNUM); ") (define_insn "*check_arch2" - [(set (match_operand:CC_NOOV 0 "cc_register" "") - (compare:CC_NOOV (unspec [(const_int 0)] UNSPEC_CHECK_ARCH) + [(set (match_operand:CC_NZ 0 "cc_register" "") + (compare:CC_NZ (unspec [(const_int 0)] UNSPEC_CHECK_ARCH) (const_int 0)))] "TARGET_ARM" "teq\\t%|r0, %|r0\;teq\\t%|pc, %|pc" @@ -8933,8 +8933,8 @@ "") (define_insn "*arith_shiftsi_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (match_operator:SI 1 "shiftable_operator" [(match_operator:SI 3 "shift_operator" [(match_operand:SI 4 "s_register_operand" "r,r") @@ -8952,8 +8952,8 @@ (set_attr "type" "alus_shift_imm,alus_shift_reg")]) (define_insn "*arith_shiftsi_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (match_operator:SI 1 "shiftable_operator" [(match_operator:SI 3 "shift_operator" [(match_operand:SI 4 "s_register_operand" "r,r") @@ -8983,8 +8983,8 @@ (set_attr "type" "alus_shift_imm,alus_shift_reg")]) (define_insn "*sub_shiftsi_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (minus:SI (match_operand:SI 1 "s_register_operand" "r,r") (match_operator:SI 2 "shift_operator" [(match_operand:SI 3 "s_register_operand" "r,r") @@ -9001,8 +9001,8 @@ (set_attr "type" "alus_shift_imm,alus_shift_reg")]) (define_insn "*sub_shiftsi_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (minus:SI (match_operand:SI 1 "s_register_operand" "r,r") (match_operator:SI 2 "shift_operator" [(match_operand:SI 3 "s_register_operand" "r,r") @@ -9146,11 +9146,11 @@ (clobber (reg:CC CC_REGNUM))] "TARGET_32BIT && reload_completed" [(parallel - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (minus:SI (match_dup 1) (match_dup 2)) + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (minus:SI (match_dup 1) (match_dup 2)) (const_int 0))) (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))]) - (cond_exec (ne:CC_NOOV (reg:CC_NOOV CC_REGNUM) (const_int 0)) + (cond_exec (ne:CC_NZ (reg:CC_NZ CC_REGNUM) (const_int 0)) (set (match_dup 0) (const_int 1)))]) (define_insn_and_split "*compare_scc" @@ -9855,8 +9855,8 @@ ) (define_split - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (ior:SI + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (ior:SI (and:SI (match_operand:SI 0 "s_register_operand" "") (const_int 1)) (match_operator:SI 1 "arm_comparison_operator" @@ -9868,14 +9868,14 @@ [(set (match_dup 4) (ior:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)]) (match_dup 0))) - (set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (and:SI (match_dup 4) (const_int 1)) + (set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (match_dup 4) (const_int 1)) (const_int 0)))] "") (define_split - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (ior:SI + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (ior:SI (match_operator:SI 1 "arm_comparison_operator" [(match_operand:SI 2 "s_register_operand" "") (match_operand:SI 3 "arm_add_operand" "")]) @@ -9887,8 +9887,8 @@ [(set (match_dup 4) (ior:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)]) (match_dup 0))) - (set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV (and:SI (match_dup 4) (const_int 1)) + (set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (and:SI (match_dup 4) (const_int 1)) (const_int 0)))] "") ;; ??? The conditional patterns above need checking for Thumb-2 usefulness @@ -9977,8 +9977,8 @@ "TARGET_32BIT" "#" "&& reload_completed" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (match_dup 3) (match_dup 4)) (const_int 0))) diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md index 267c446c03e..da208b62724 100644 --- a/gcc/config/arm/predicates.md +++ b/gcc/config/arm/predicates.md @@ -422,7 +422,7 @@ (match_operand 0 "arm_vsel_comparison_operator")) (match_operand 0 "expandable_comparison_operator"))) -(define_special_predicate "noov_comparison_operator" +(define_special_predicate "nz_comparison_operator" (match_code "lt,ge,eq,ne")) (define_special_predicate "minmax_operator" diff --git a/gcc/config/arm/thumb1.md b/gcc/config/arm/thumb1.md index 5c70200bef3..9df793cc47c 100644 --- a/gcc/config/arm/thumb1.md +++ b/gcc/config/arm/thumb1.md @@ -1023,9 +1023,9 @@ if (!rtx_equal_p (cfun->machine->thumb1_cc_op0, operands[1]) || !rtx_equal_p (cfun->machine->thumb1_cc_op1, operands[2])) t = NULL_RTX; - if (cfun->machine->thumb1_cc_mode == CC_NOOVmode) + if (cfun->machine->thumb1_cc_mode == CC_NZmode) { - if (!noov_comparison_operator (operands[0], VOIDmode)) + if (!nz_comparison_operator (operands[0], VOIDmode)) t = NULL_RTX; } else if (cfun->machine->thumb1_cc_mode != CCmode) @@ -1097,9 +1097,9 @@ if (!rtx_equal_p (cfun->machine->thumb1_cc_op0, operands[1]) || !rtx_equal_p (cfun->machine->thumb1_cc_op1, operands[2])) t = NULL_RTX; - if (cfun->machine->thumb1_cc_mode == CC_NOOVmode) + if (cfun->machine->thumb1_cc_mode == CC_NZmode) { - if (!noov_comparison_operator (operands[0], VOIDmode)) + if (!nz_comparison_operator (operands[0], VOIDmode)) t = NULL_RTX; } else if (cfun->machine->thumb1_cc_mode != CCmode) diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md index 7fce50b045b..2558e404b88 100644 --- a/gcc/config/arm/thumb2.md +++ b/gcc/config/arm/thumb2.md @@ -1287,8 +1287,8 @@ ) (define_insn "thumb2_addsi3_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (match_operand:SI 1 "s_register_operand" "l, 0, r") (match_operand:SI 2 "arm_add_operand" "lPt,Ps,rIL")) (const_int 0))) @@ -1321,8 +1321,8 @@ ) (define_insn "*thumb2_addsi3_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (plus:SI (match_operand:SI 0 "s_register_operand" "l, r") (match_operand:SI 1 "arm_add_operand" "lPv,rIL")) (const_int 0)))] @@ -1359,8 +1359,8 @@ (set_attr "type" "muls")]) (define_insn "*thumb2_mulsi_short_compare0" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (mult:SI (match_operand:SI 1 "register_operand" "%0") (match_operand:SI 2 "register_operand" "l")) (const_int 0))) @@ -1372,8 +1372,8 @@ (set_attr "type" "muls")]) (define_insn "*thumb2_mulsi_short_compare0_scratch" - [(set (reg:CC_NOOV CC_REGNUM) - (compare:CC_NOOV + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ (mult:SI (match_operand:SI 1 "register_operand" "%0") (match_operand:SI 2 "register_operand" "l")) (const_int 0))) @@ -1477,15 +1477,15 @@ ) (define_peephole2 - [(set (match_operand:CC_NOOV 0 "cc_register" "") - (compare:CC_NOOV (zero_extract:SI + [(set (match_operand:CC_NZ 0 "cc_register" "") + (compare:CC_NZ (zero_extract:SI (match_operand:SI 1 "low_register_operand" "") (const_int 1) (match_operand:SI 2 "const_int_operand" "")) (const_int 0))) (match_scratch:SI 3 "l") (set (pc) - (if_then_else (match_operator:CC_NOOV 4 "equality_operator" + (if_then_else (match_operator:CC_NZ 4 "equality_operator" [(match_dup 0) (const_int 0)]) (match_operand 5 "" "") (match_operand 6 "" "")))] @@ -1493,7 +1493,7 @@ && (INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) < 32) && peep2_reg_dead_p (2, operands[0])" [(parallel [(set (match_dup 0) - (compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2)) + (compare:CC_NZ (ashift:SI (match_dup 1) (match_dup 2)) (const_int 0))) (clobber (match_dup 3))]) (set (pc) @@ -1506,15 +1506,15 @@ ") (define_peephole2 - [(set (match_operand:CC_NOOV 0 "cc_register" "") - (compare:CC_NOOV (zero_extract:SI + [(set (match_operand:CC_NZ 0 "cc_register" "") + (compare:CC_NZ (zero_extract:SI (match_operand:SI 1 "low_register_operand" "") (match_operand:SI 2 "const_int_operand" "") (const_int 0)) (const_int 0))) (match_scratch:SI 3 "l") (set (pc) - (if_then_else (match_operator:CC_NOOV 4 "equality_operator" + (if_then_else (match_operator:CC_NZ 4 "equality_operator" [(match_dup 0) (const_int 0)]) (match_operand 5 "" "") (match_operand 6 "" "")))] @@ -1522,8 +1522,8 @@ && (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 32) && peep2_reg_dead_p (2, operands[0])" [(parallel [(set (match_dup 0) - (compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2)) - (const_int 0))) + (compare:CC_NZ (ashift:SI (match_dup 1) (match_dup 2)) + (const_int 0))) (clobber (match_dup 3))]) (set (pc) (if_then_else (match_op_dup 4 [(match_dup 0) (const_int 0)]) From patchwork Fri Nov 8 10:54:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178871 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2505552ilf; Fri, 8 Nov 2019 02:55:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzfVtEKGiWdSYFsYqd7OiR7nI54UnpXbNlSt+7ObbSovIKgrbapY2l3CAJtho2+sD4cNcdu X-Received: by 2002:a05:6402:1a4f:: with SMTP id bf15mr9443007edb.160.1573210521073; Fri, 08 Nov 2019 02:55:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573210521; cv=none; d=google.com; s=arc-20160816; b=dMxcm4htXE8f5IaHfbyIi1DTLzA0ze8wkXKQrAgYwDMSfiFyW/UfyvFhlJuTo+Yhkr HbVu+Vq/2VnPAdiHXmluPu43a06+mBI71y+QlHcz7Jle7RjzjbJCCg26Tfk7f9xh8j6c j/YMxQB8zDIhHj6dfWYT/x0YEepp5SEo1V66nUklrahsyc1UhjF9A7I8jarB3MWdLOGu MEiBpkrc4ofkD32kdy90GkgGsRxCre3t4aEjgHpTEpC/pSewXz8gYE2GucQZzU3eQMp0 svzKq4QnrpDaw54+K8sZ7skI4Xj3e3SVOq2mC9caSeG/I/QnID+0PEyyR0GbObqpYFjx IDTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=PUT+0WnXdm0K/nbIr/1I8fPsqSDSLyEIdNb78UAiEAw=; b=03yZQOzoZwkmTpGd2DKBLkUZVdM7qU5muetRhkSW/E1IjGqp2kGaV4rhSvWdXCezuU V82vjzp6TULDc52o6aBNgH21Go43MOIGD3eGosDJCa/Rj3GpvK//V+j5pwb7bBsZeC9s zEtnxLMnqQNjMTCAL+pVZVWTuLdji0VZDtqoaBHnaSAUDlj4E+0U8z5KLDdDsritJISU wKoAsyObyB31RYsVhpsZxQQGhAdpc5z4MQ2sSSUWep0Y7UGf31fEY95npkuU0VlH+mW5 zEw6I4y9/tl/+JSZ3OC+m1BOzRpJhxJ4bcc7DQbWDuDjJpw2OcfYMZ2YIHIEKfam8xUz LwfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mfsWizmW; dkim=pass header.i=@linaro.org header.s=google header.b=fXxPbmJk; spf=pass (google.com: domain of gcc-patches-return-512804-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512804-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s1si3848338edx.188.2019.11.08.02.55.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 02:55:21 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-512804-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mfsWizmW; dkim=pass header.i=@linaro.org header.s=google header.b=fXxPbmJk; spf=pass (google.com: domain of gcc-patches-return-512804-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512804-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=uo6CerCEGEvMmJOo364UnXnoinlGqYY2p9ubZZog4OVjXIWSkgEri Flb6Wsg5wMptRf9BWZ+HeLbk7agM26eAb3M3mevXvpAgkBdbIS+G+x+jj61TxYDR RvuIzp9z+hUT2h/4q8oCvjHP0JnceZS+eOLxJsdFfAhNn7Ezj724hA= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=chy6jpMpbuR1+Re1z1b0LmMZZnw=; b=mfsWizmWy60myJ5LsjuT XBxITNvIyZ0x/iIQeqlbZEFYpVZEKjHlKVDHtDUCSCUfvpKiscnhOV7LT+NLtLni PLXXzbK3PMtbDEntqbENLc7B3WrkiJooSkv/dd9ZLd7hAzEmFFRc5r5PSp8Jr2cv 8gNfMG1qqBCHdf33q4KKfOc= Received: (qmail 106498 invoked by alias); 8 Nov 2019 10:54:34 -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 106407 invoked by uid 89); 8 Nov 2019 10:54:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=geu, GEU, LEU, leu X-HELO: mail-wr1-f44.google.com Received: from mail-wr1-f44.google.com (HELO mail-wr1-f44.google.com) (209.85.221.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 10:54:30 +0000 Received: by mail-wr1-f44.google.com with SMTP id f2so6452835wrs.11 for ; Fri, 08 Nov 2019 02:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PUT+0WnXdm0K/nbIr/1I8fPsqSDSLyEIdNb78UAiEAw=; b=fXxPbmJkpa+rIsjyNUsajGYaUL7+qZr6/POIf7acdqYCRU4accv9VYqtVPaOONFyNB qO36uDrL1cKPrLiplqsyjbEWlU8rkIdLawLuyWMbP1uG/TP3XkKh5Ai9DFifLIFtv2Cf teocQNkuF3fgLJekRQRDUVaxSCSQ05PraPQSjJ7/VgPatsyNR0ds52jdlkGW2/if8GtF +eyto6SQ8VkOIMBuaKPcmZCEa8EfhfgxefEejmtoi6FHYAo+agxKKgATWMNUjn81Oan/ YXFYXak9aWPEPtSX+FKjchkCq3tEgjLW7i1MgDNpD8xHEBdqy/0xc2/eou3rWaD1l3E3 QnYg== Return-Path: Received: from localhost.localdomain (212.red-213-99-162.dynamicip.rima-tde.net. [213.99.162.212]) by smtp.gmail.com with ESMTPSA id 19sm8046565wrc.47.2019.11.08.02.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 02:54:27 -0800 (PST) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, james.greenhalgh@arm.com, richard.sandiford@arm.com, marcus.shawcroft@arm.com, kyrylo.tkachov@arm.com Subject: [PATCH 4/6] arm, aarch64: Add support for __GCC_ASM_FLAG_OUTPUTS__ Date: Fri, 8 Nov 2019 11:54:06 +0100 Message-Id: <20191108105408.27584-5-richard.henderson@linaro.org> In-Reply-To: <20191108105408.27584-1-richard.henderson@linaro.org> References: <20191108105408.27584-1-richard.henderson@linaro.org> Since all but a couple of lines is shared between the two targets, enable them both at once. * config/arm/aarch-common-protos.h (arm_md_asm_adjust): Declare. * config/arm/aarch-common.c (arm_md_asm_adjust): New. * config/arm/arm-c.c (arm_cpu_builtins): Define __GCC_ASM_FLAG_OUTPUTS__. * config/arm/arm.c (TARGET_MD_ASM_ADJUST): New. * config/aarch64/aarch64-c.c (aarch64_define_unconditional_macros): Define __GCC_ASM_FLAG_OUTPUTS__. * config/aarch64/aarch64.c (TARGET_MD_ASM_ADJUST): New. * doc/extend.texi (FlagOutputOperands): Add documentation for ARM and AArch64. --- gcc/config/arm/aarch-common-protos.h | 6 ++ gcc/config/aarch64/aarch64-c.c | 2 + gcc/config/aarch64/aarch64.c | 3 + gcc/config/arm/aarch-common.c | 131 +++++++++++++++++++++++++++ gcc/config/arm/arm-c.c | 1 + gcc/config/arm/arm.c | 3 + gcc/doc/extend.texi | 33 +++++++ 7 files changed, 179 insertions(+) -- 2.17.1 diff --git a/gcc/config/arm/aarch-common-protos.h b/gcc/config/arm/aarch-common-protos.h index 3bf38a104f6..f15cf336e9d 100644 --- a/gcc/config/arm/aarch-common-protos.h +++ b/gcc/config/arm/aarch-common-protos.h @@ -23,6 +23,8 @@ #ifndef GCC_AARCH_COMMON_PROTOS_H #define GCC_AARCH_COMMON_PROTOS_H +#include "hard-reg-set.h" + extern int aarch_accumulator_forwarding (rtx_insn *, rtx_insn *); extern bool aarch_rev16_p (rtx); extern bool aarch_rev16_shleft_mask_imm_p (rtx, machine_mode); @@ -141,5 +143,9 @@ struct cpu_cost_table const struct vector_cost_table vect; }; +rtx_insn * +arm_md_asm_adjust (vec &outputs, vec &/*inputs*/, + vec &constraints, + vec &clobbers, HARD_REG_SET &clobbered_regs); #endif /* GCC_AARCH_COMMON_PROTOS_H */ diff --git a/gcc/config/aarch64/aarch64-c.c b/gcc/config/aarch64/aarch64-c.c index 7c322ca0813..0af859f1c14 100644 --- a/gcc/config/aarch64/aarch64-c.c +++ b/gcc/config/aarch64/aarch64-c.c @@ -69,6 +69,8 @@ aarch64_define_unconditional_macros (cpp_reader *pfile) builtin_define ("__ARM_FEATURE_UNALIGNED"); builtin_define ("__ARM_PCS_AAPCS64"); builtin_define_with_int_value ("__ARM_SIZEOF_WCHAR_T", WCHAR_TYPE_SIZE / 8); + + builtin_define ("__GCC_ASM_FLAG_OUTPUTS__"); } /* Undefine/redefine macros that depend on the current backend state and may diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 1dfff331a5a..26de9879bc7 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -21947,6 +21947,9 @@ aarch64_libgcc_floating_mode_supported_p #undef TARGET_STRICT_ARGUMENT_NAMING #define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true +#undef TARGET_MD_ASM_ADJUST +#define TARGET_MD_ASM_ADJUST arm_md_asm_adjust + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-aarch64.h" diff --git a/gcc/config/arm/aarch-common.c b/gcc/config/arm/aarch-common.c index 965a07a43e3..8b98c8d3802 100644 --- a/gcc/config/arm/aarch-common.c +++ b/gcc/config/arm/aarch-common.c @@ -26,10 +26,16 @@ #include "config.h" #include "system.h" #include "coretypes.h" +#include "insn-modes.h" #include "tm.h" #include "rtl.h" #include "rtl-iter.h" #include "memmodel.h" +#include "errors.h" +#include "tree.h" +#include "expr.h" +#include "function.h" +#include "emit-rtl.h" /* Return TRUE if X is either an arithmetic shift left, or is a multiplication by a power of two. */ @@ -520,3 +526,128 @@ arm_mac_accumulator_is_mul_result (rtx producer, rtx consumer) && !reg_overlap_mentioned_p (mul_result, mac_op0) && !reg_overlap_mentioned_p (mul_result, mac_op1)); } + +/* Worker function for TARGET_MD_ASM_ADJUST. + We implement asm flag outputs. */ + +rtx_insn * +arm_md_asm_adjust (vec &outputs, vec &/*inputs*/, + vec &constraints, + vec &/*clobbers*/, HARD_REG_SET &/*clobbered_regs*/) +{ + bool saw_asm_flag = false; + + start_sequence (); + for (unsigned i = 0, n = outputs.length (); i < n; ++i) + { + const char *con = constraints[i]; + if (strncmp (con, "=@cc", 4) != 0) + continue; + con += 4; + if (strchr (con, ',') != NULL) + { + error ("alternatives not allowed in % flag output"); + continue; + } + + machine_mode mode = CCmode; + rtx_code code = UNKNOWN; + + switch (con[0]) + { + case 'c': + if (con[1] == 'c' && con[2] == 0) + mode = CC_Cmode, code = GEU; + else if (con[1] == 's' && con[2] == 0) + mode = CC_Cmode, code = LTU; + break; + case 'e': + if (con[1] == 'q' && con[2] == 0) + mode = CC_NZmode, code = EQ; + break; + case 'g': + if (con[1] == 'e' && con[2] == 0) + mode = CCmode, code = GE; + else if (con[1] == 't' && con[2] == 0) + mode = CCmode, code = GT; + break; + case 'h': + if (con[1] == 'i' && con[2] == 0) + mode = CCmode, code = GTU; + break; + case 'l': + if (con[1] == 'e' && con[2] == 0) + mode = CCmode, code = LE; + else if (con[1] == 't' && con[2] == 0) + mode = CCmode, code = LT; + else if (con[1] == 's' && con[2] == 0) + mode = CCmode, code = LEU; + break; + case 'm': + if (con[1] == 'i' && con[2] == 0) + mode = CC_NZmode, code = LT; + break; + case 'n': + if (con[1] == 'e' && con[2] == 0) + mode = CC_NZmode, code = NE; + break; + case 'p': + if (con[1] == 'l' && con[2] == 0) + mode = CC_NZmode, code = GE; + break; + case 'v': + if (con[1] == 'c' && con[2] == 0) + mode = CC_Vmode, code = EQ; + else if (con[1] == 's' && con[2] == 0) + mode = CC_Vmode, code = NE; + break; + } + if (code == UNKNOWN) + { + error ("unknown % flag output %qs", constraints[i]); + continue; + } + + rtx dest = outputs[i]; + machine_mode dest_mode = GET_MODE (dest); + if (!SCALAR_INT_MODE_P (dest_mode)) + { + error ("invalid type for % flag output"); + continue; + } + + if (!saw_asm_flag) + { + /* This is the first asm flag output. Here we put the flags + register in as the real output and adjust the condition to + allow it. */ + constraints[i] = "=c"; + outputs[i] = gen_rtx_REG (CCmode, CC_REGNUM); + saw_asm_flag = true; + } + else + { + /* We don't need the flags register as output twice. */ + constraints[i] = "=X"; + outputs[i] = gen_rtx_SCRATCH (word_mode); + } + + rtx x = gen_rtx_REG (mode, CC_REGNUM); + x = gen_rtx_fmt_ee (code, word_mode, x, const0_rtx); + + if (dest_mode == word_mode) + emit_insn (gen_rtx_SET (dest, x)); + else + { + rtx tmp = gen_reg_rtx (word_mode); + emit_insn (gen_rtx_SET (tmp, x)); + + tmp = convert_modes (dest_mode, word_mode, tmp, true); + emit_move_insn (dest, tmp); + } + } + rtx_insn *seq = get_insns (); + end_sequence (); + + return saw_asm_flag ? seq : NULL; +} diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c index 34695fa0112..c4485ce7af1 100644 --- a/gcc/config/arm/arm-c.c +++ b/gcc/config/arm/arm-c.c @@ -122,6 +122,7 @@ arm_cpu_builtins (struct cpp_reader* pfile) if (arm_arch_notm) builtin_define ("__ARM_ARCH_ISA_ARM"); builtin_define ("__APCS_32__"); + builtin_define ("__GCC_ASM_FLAG_OUTPUTS__"); def_or_undef_macro (pfile, "__thumb__", TARGET_THUMB); def_or_undef_macro (pfile, "__thumb2__", TARGET_THUMB2); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index b620322318b..d889e8ddc60 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -814,6 +814,9 @@ static const struct attribute_spec arm_attribute_table[] = #undef TARGET_CONSTANT_ALIGNMENT #define TARGET_CONSTANT_ALIGNMENT arm_constant_alignment + +#undef TARGET_MD_ASM_ADJUST +#define TARGET_MD_ASM_ADJUST arm_md_asm_adjust /* Obstack for minipool constant handling. */ static struct obstack minipool_obstack; diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 9db4f9b1d29..a26b8b976fa 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -9771,6 +9771,39 @@ referenced within the assembler template via @code{%0} etc, as there's no corresponding text in the assembly language. @table @asis +@item ARM +@itemx AArch64 +The flag output constraints for the ARM family are of the form +@samp{=@@cc@var{cond}} where @var{cond} is one of the standard +conditions defined in the ARM ARM for @code{ConditionHolds}. + +@table @code +@item eq +``equal'' or Z flag set +@item ne +``not equal'' or Z flag clear +@item cs +``carry'' or C flag set +@item cc +C flag clear +@item mi +``minus'' or N flag set +@item pl +``plus'' or N flag clear +@item hi +unsigned greater than +@item ls +unsigned less than or equal +@item ge +signed greater than or equal +@item lt +signed less than +@item gt +signed greater than +@item le +signed less than or equal +@end table + @item x86 family The flag output constraints for the x86 family are of the form @samp{=@@cc@var{cond}} where @var{cond} is one of the standard From patchwork Fri Nov 8 10:54:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178872 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2505851ilf; Fri, 8 Nov 2019 02:55:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwhmNtNU1cqZx/56Gb0IRwbMkGHPnNqfVu/DE0n3vyafAxm1wTlLA/Q1ANLKqM8veuzYCRB X-Received: by 2002:aa7:db52:: with SMTP id n18mr9043665edt.169.1573210536840; Fri, 08 Nov 2019 02:55:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573210536; cv=none; d=google.com; s=arc-20160816; b=IF3q6wNdya956YdORqvlDiXOGPTxu1PruLjxyh0PIOur8UaNzBCPUg2ajk8j/n6gZj pjpTotdNx07OQRl59BUZ4X61l6De8GoBed3MmtCwpGtQ7t456EnXk4wr4W4NLENDM4qz ynBQ5UoRXzS5M5LEoTgQLEOb2JlU2cXWSPvKoy/5Y0dNXOnTv4Wn9fhiuJyr8wEbHAQD 95ayhawRc4ynKA9fXpwH7KnUUINdAMW7T6gCJ12lENpXdYgYLlWZMgvXwYEjhViN0Qv8 3c12Pv9TO5foAykRsPGce5DjvewLUvi3TkUlLo1MHqbvfvR6jlou/u+ilNZZ7YHPsILg YTRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=9WtPtAWd9ubLryf1sZgnr9XBbX5IRKSHE7mRyyOM/GI=; b=VHatIX28Jgw1zUwgLdWnmV2YXynozK1sG53qZMpLzw2tS5Whp3kfWSlI7F2fMeCh1O yeNEW399kFMCvowbGkg3Spmv25eSUUAvw2Vs5JIWLIfMF4FShSPKFm9lMclQ45NY/cWU DcJZwn7geTD9YGv8GwetyUBxF2SwhsAtustWO0yTnT/VW5P38Ha1g7mJDO28ss9SN7Ac W/GQj5XYEV1e1xTXwaQbFsKh4NV7ZFvnjOlIeW4oaVoNEiqxdUTM0+uUZLl0DkUOf+Pw GrZbwfml9SfXmJZoBis3jTCrp36US74Z+aWciS39+u7GLn/iF9/LO1lM3seBf7X6zJ9J wbhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lA0txAq2; dkim=pass header.i=@linaro.org header.s=google header.b=p1lLLRg5; spf=pass (google.com: domain of gcc-patches-return-512805-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512805-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b17si3534640ejp.326.2019.11.08.02.55.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 02:55:36 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-512805-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lA0txAq2; dkim=pass header.i=@linaro.org header.s=google header.b=p1lLLRg5; spf=pass (google.com: domain of gcc-patches-return-512805-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512805-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=xhV05Kg//tzFS2BGyaHfC2bdOp5yUehZEmlHmixEhZI9AkO6qqDHQ ovpm5JMS/e3Pd5/zsCKrgoB01bjLJQ5uUT559oNOefHMBwoAc+NPxvMSXBCdgiq+ b2AsY6zrYihkotTE0DFtAVKKdu62D8r3uVNkSulaqonp2b1/hMwJzU= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=CLzxxMqaoZkBw4amLvxAF3idEFY=; b=lA0txAq24RegjflRi30x CMMKjEKSZSquM2cxCZncp03ZE3N3fOgc9jTeGqY5l/IpBZnXWhxcX0ItY/X3Kl+m QFiCDeGjsTkThqi6edp3L7uUT/rwsruy8EyA6LMyzu7wt/uHCBRIAw1FVxJdwFqd 6wBaoqvlD8DvIsDUVpXAxas= Received: (qmail 106677 invoked by alias); 8 Nov 2019 10:54:35 -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 106550 invoked by uid 89); 8 Nov 2019 10:54:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=ble, bhi X-HELO: mail-wr1-f43.google.com Received: from mail-wr1-f43.google.com (HELO mail-wr1-f43.google.com) (209.85.221.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 10:54:32 +0000 Received: by mail-wr1-f43.google.com with SMTP id e6so6564643wrw.1 for ; Fri, 08 Nov 2019 02:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9WtPtAWd9ubLryf1sZgnr9XBbX5IRKSHE7mRyyOM/GI=; b=p1lLLRg55b9ltq44SAnzKmAsAahYbzCzYYz4Fe2Ebq9QEBBETnoTltSssliH62XkrQ grkt9dW4wei4hh88WDrJh7X7oovdMmwZKsWNnO8AaZGh97x2Bh6m0JAJhG3MS9MJNkUp ddzNMFVYh1edkFO/+F7Klzofq+EydL+iL5o06Au1h+Asf+XcA8u9zIhRn9Nthyfn1Ou1 9ohk7M2oZIoQ6UZenjySxpFFRkBHMhaVuGQuvFNSqUAg4XTq4vLhuosHxUgbDAusFqsP RunYfNImKBPSYK4Ie/WkUt+3xAjia8ElzSqku2j19iEshuaNh3Olp6XnL12sievyKKMn eagA== Return-Path: Received: from localhost.localdomain (212.red-213-99-162.dynamicip.rima-tde.net. [213.99.162.212]) by smtp.gmail.com with ESMTPSA id 19sm8046565wrc.47.2019.11.08.02.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 02:54:29 -0800 (PST) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, james.greenhalgh@arm.com, richard.sandiford@arm.com, marcus.shawcroft@arm.com, kyrylo.tkachov@arm.com Subject: [PATCH 5/6] arm: Add testsuite checks for asm-flag Date: Fri, 8 Nov 2019 11:54:07 +0100 Message-Id: <20191108105408.27584-6-richard.henderson@linaro.org> In-Reply-To: <20191108105408.27584-1-richard.henderson@linaro.org> References: <20191108105408.27584-1-richard.henderson@linaro.org> Inspired by the tests in gcc.target/i386. Testing code generation, diagnostics, and execution. * gcc.target/arm/asm-flag-1.c: New test. * gcc.target/arm/asm-flag-3.c: New test. * gcc.target/arm/asm-flag-5.c: New test. * gcc.target/arm/asm-flag-6.c: New test. --- gcc/testsuite/gcc.target/arm/asm-flag-1.c | 35 ++++++++++++++++++ gcc/testsuite/gcc.target/arm/asm-flag-3.c | 36 +++++++++++++++++++ gcc/testsuite/gcc.target/arm/asm-flag-5.c | 30 ++++++++++++++++ gcc/testsuite/gcc.target/arm/asm-flag-6.c | 43 +++++++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 gcc/testsuite/gcc.target/arm/asm-flag-1.c create mode 100644 gcc/testsuite/gcc.target/arm/asm-flag-3.c create mode 100644 gcc/testsuite/gcc.target/arm/asm-flag-5.c create mode 100644 gcc/testsuite/gcc.target/arm/asm-flag-6.c -- 2.17.1 diff --git a/gcc/testsuite/gcc.target/arm/asm-flag-1.c b/gcc/testsuite/gcc.target/arm/asm-flag-1.c new file mode 100644 index 00000000000..e1ce4120d98 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/asm-flag-1.c @@ -0,0 +1,35 @@ +/* Test the valid @cc asm flag outputs. */ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#ifndef __GCC_ASM_FLAG_OUTPUTS__ +#error "missing preprocessor define" +#endif + +void f(char *out) +{ + asm("" + : "=@ccne"(out[0]), "=@cceq"(out[1]), + "=@cccs"(out[2]), "=@cccc"(out[3]), + "=@ccmi"(out[4]), "=@ccpl"(out[5]), + "=@ccvs"(out[6]), "=@ccvc"(out[7]), + "=@cchi"(out[8]), "=@ccls"(out[9]), + "=@ccge"(out[10]), "=@cclt"(out[11]), + "=@ccgt"(out[12]), "=@ccle"(out[13])); +} + +/* There will be at least one of each, probably two. */ +/* { dg-final { scan-assembler "movne" } } */ +/* { dg-final { scan-assembler "moveq" } } */ +/* { dg-final { scan-assembler "movcs" } } */ +/* { dg-final { scan-assembler "movcc" } } */ +/* { dg-final { scan-assembler "movmi" } } */ +/* { dg-final { scan-assembler "movpl" } } */ +/* { dg-final { scan-assembler "movvs" } } */ +/* { dg-final { scan-assembler "movvc" } } */ +/* { dg-final { scan-assembler "movhi" } } */ +/* { dg-final { scan-assembler "movls" } } */ +/* { dg-final { scan-assembler "movge" } } */ +/* { dg-final { scan-assembler "movls" } } */ +/* { dg-final { scan-assembler "movgt" } } */ +/* { dg-final { scan-assembler "movle" } } */ diff --git a/gcc/testsuite/gcc.target/arm/asm-flag-3.c b/gcc/testsuite/gcc.target/arm/asm-flag-3.c new file mode 100644 index 00000000000..8b0bd8a00f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/asm-flag-3.c @@ -0,0 +1,36 @@ +/* Test some of the valid @cc asm flag outputs. */ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#define DO(C) \ +void f##C(void) { char x; asm("" : "=@cc"#C(x)); if (!x) asm(""); asm(""); } + +DO(ne) +DO(eq) +DO(cs) +DO(cc) +DO(mi) +DO(pl) +DO(vs) +DO(vc) +DO(hi) +DO(ls) +DO(ge) +DO(lt) +DO(gt) +DO(le) + +/* { dg-final { scan-assembler "bne" } } */ +/* { dg-final { scan-assembler "beq" } } */ +/* { dg-final { scan-assembler "bcs" } } */ +/* { dg-final { scan-assembler "bcc" } } */ +/* { dg-final { scan-assembler "bmi" } } */ +/* { dg-final { scan-assembler "bpl" } } */ +/* { dg-final { scan-assembler "bvs" } } */ +/* { dg-final { scan-assembler "bvc" } } */ +/* { dg-final { scan-assembler "bhi" } } */ +/* { dg-final { scan-assembler "bls" } } */ +/* { dg-final { scan-assembler "bge" } } */ +/* { dg-final { scan-assembler "blt" } } */ +/* { dg-final { scan-assembler "bgt" } } */ +/* { dg-final { scan-assembler "ble" } } */ diff --git a/gcc/testsuite/gcc.target/arm/asm-flag-5.c b/gcc/testsuite/gcc.target/arm/asm-flag-5.c new file mode 100644 index 00000000000..4d4394e1478 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/asm-flag-5.c @@ -0,0 +1,30 @@ +/* Test error conditions of asm flag outputs. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +void f_B(void) { _Bool x; asm("" : "=@cccc"(x)); } +void f_c(void) { char x; asm("" : "=@cccc"(x)); } +void f_s(void) { short x; asm("" : "=@cccc"(x)); } +void f_i(void) { int x; asm("" : "=@cccc"(x)); } +void f_l(void) { long x; asm("" : "=@cccc"(x)); } +void f_ll(void) { long long x; asm("" : "=@cccc"(x)); } + +void f_f(void) +{ + float x; + asm("" : "=@cccc"(x)); /* { dg-error invalid type } */ +} + +void f_d(void) +{ + double x; + asm("" : "=@cccc"(x)); /* { dg-error invalid type } */ +} + +struct S { int x[3]; }; + +void f_S(void) +{ + struct S x; + asm("" : "=@cccc"(x)); /* { dg-error invalid type } */ +} diff --git a/gcc/testsuite/gcc.target/arm/asm-flag-6.c b/gcc/testsuite/gcc.target/arm/asm-flag-6.c new file mode 100644 index 00000000000..ef2e06afc37 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/asm-flag-6.c @@ -0,0 +1,43 @@ +/* Executable testcase for 'output flags.' */ +/* { dg-do run } */ + +int test_bits (long nzcv) +{ + long n, z, c, v; + + __asm__ ("msr APSR_nzcvq, %[in]" + : "=@ccmi"(n), "=@cceq"(z), "=@cccs"(c), "=@ccvs"(v) + : [in] "r"(nzcv << 28)); + + return n * 8 + z * 4 + c * 2 + v == nzcv; +} + +int test_cmp (long x, long y) +{ + long gt, lt, ge, le; + + __asm__ ("cmp %[x], %[y]" + : "=@ccgt"(gt), "=@cclt"(lt), "=@ccge"(ge), "=@ccle"(le) + : [x] "r"(x), [y] "r"(y)); + + return (gt == (x > y) + && lt == (x < y) + && ge == (x >= y) + && le == (x <= y)); +} + +int main () +{ + long i, j; + + for (i = 0; i < 16; ++i) + if (!test_bits (i)) + __builtin_abort (); + + for (i = -1; i <= 1; ++i) + for (j = -1; j <= 1; ++j) + if (!test_cmp (i, j)) + __builtin_abort (); + + return 0; +} From patchwork Fri Nov 8 10:54:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 178874 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2506377ilf; Fri, 8 Nov 2019 02:56:05 -0800 (PST) X-Google-Smtp-Source: APXvYqx8EMPJ/hz6jMoaDXudrdsFgFiWKZgQ8XsJ3iflRFitF4VAwK7nUGJ0tWCXp5mOPkGJP4ed X-Received: by 2002:a50:9fc1:: with SMTP id c59mr9521221edf.305.1573210565404; Fri, 08 Nov 2019 02:56:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573210565; cv=none; d=google.com; s=arc-20160816; b=0DWpWsNhw9sI6tWx4R1vQzQLxxJCi3LSqpWbWUew5jA+EH8B24zexaO3aC5xRyzzeu xp007zssbE+vbH42TQlJxiTbWcX6eV8qp6/H/yFwrB+nZ2mTdmTgZpM1MkcebRBgju3e 1dhXxEZ53pHo7FnQr5oWN5qWimunzLyrC9yHeeZkY3IW/86vJHGamuB4j59RvMjU7PyN jWI7Q1lYzeVC+Hu0uGJZh2OFRmf7vgjALR4qhwOSoBMHaMYdVk2GW9LkgXBY2l4V4+Xv 81A19Crjr6+w4R+I+fp5iX+bFePGZOkeSn+RHjDP6PGBLXcBcdmS190FaCQmqaQ/+AnD g/QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=mqAmKlKvyos3s3FytACODGPv7A2Gwjshw643MSV6yyc=; b=m/LeVrOgLZvJZgY+WscI2B9QryZsvbwbW/bVRZtGD0k+/7HTe2DDNJRN2Fb0rvuFTu yT9+4BERnHMyMzsDchfBzbTl+pnOjFwyWx/d5VTsC7IjPUI6VVYDkU7NUNBZL7PHQ2C3 dGlK0P3DrTQTOvASUjGKPKxTsggtxnerZdB9vcQcrLyAVq1R7kvSHgn3NI5eKFv+zPSR 8ayUM8WUj+AU5WH93OAzDExU0VsJgy4PTBF9MZSHosgHT+xJaCf8avhoefRSbbMXXawJ gGKNOdEJBTwAF0CjkagEEUMgs7f8//TUL/lAIVfNHrO5J9n1GxA5bMYcbUQvTu7648YW cPag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W8SB8EyG; dkim=pass header.i=@linaro.org header.s=google header.b=tzu2mrlA; spf=pass (google.com: domain of gcc-patches-return-512807-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512807-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id v11si3219159eju.135.2019.11.08.02.56.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2019 02:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-512807-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W8SB8EyG; dkim=pass header.i=@linaro.org header.s=google header.b=tzu2mrlA; spf=pass (google.com: domain of gcc-patches-return-512807-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-512807-patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=FYLL7rb+e8oeUIMMIjtd9G/drJmPor6nv/2aAUZ+1GQBJFE2s/zDw nCnjLOHDWroPWwpRK+nQUy3PZgkNn2sZH5UjHm2PUE01SOyzG8zn3LTzIVVAZtNY 1HGGCArVGkMQEEqGDNp0YupiPgnVGTJSTghGFXs3Ws+uNaF0q97qgo= 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:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=YDedawC06HBGHqmu0dGireglPxc=; b=W8SB8EyGvn8FAm+BVdYH 8IgQVaIh5eRaPWWPS52J1ZSpo1RKx7jcLx45SvEcexlEW/RFlirWpcD2zXSe4pFH tgWKVUNE9dYwUhavAMzpGcBmzfUATDk3l7gpN7o06euerySSUokbZ1JG8jZF6utl MUif+p7EoPK85ECcfEmGOrY= Received: (qmail 106929 invoked by alias); 8 Nov 2019 10:54:36 -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 106849 invoked by uid 89); 8 Nov 2019 10:54:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=ble, bhi X-HELO: mail-wm1-f51.google.com Received: from mail-wm1-f51.google.com (HELO mail-wm1-f51.google.com) (209.85.128.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 10:54:34 +0000 Received: by mail-wm1-f51.google.com with SMTP id 8so5745447wmo.0 for ; Fri, 08 Nov 2019 02:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mqAmKlKvyos3s3FytACODGPv7A2Gwjshw643MSV6yyc=; b=tzu2mrlA/lj35qzgWPeL6BoZSaS//Y0SJoORxHcfw96+4jd9JFseHYkjcQuzVNaWEi EU2NAU71YqOrimjppTgEDWsLV0ubL5EK7DfTFWb7P5+yGS1QKHwlRpjDhBYk92nUFBt/ KtTQ8du93Q3HFmgy6j9v1a2+9TPt1stxx5upip1EIE94axMVGlWh+weut8zdQYTQISjk tIEWPvQzLtdfifoOvnFnR+M6v5Q31dDO3qbLcG+JGvv4soyZvKa0aVNENFPnvGDQgzq+ ttOcpVF67bow2H0togdAdX/KOrUcfxcu1UelKmJebSG0jvfWuyCq39CXOeVVoMLhg4rL Lh3Q== Return-Path: Received: from localhost.localdomain (212.red-213-99-162.dynamicip.rima-tde.net. [213.99.162.212]) by smtp.gmail.com with ESMTPSA id 19sm8046565wrc.47.2019.11.08.02.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 02:54:31 -0800 (PST) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, james.greenhalgh@arm.com, richard.sandiford@arm.com, marcus.shawcroft@arm.com, kyrylo.tkachov@arm.com Subject: [PATCH 6/6] aarch64: Add testsuite checks for asm-flag Date: Fri, 8 Nov 2019 11:54:08 +0100 Message-Id: <20191108105408.27584-7-richard.henderson@linaro.org> In-Reply-To: <20191108105408.27584-1-richard.henderson@linaro.org> References: <20191108105408.27584-1-richard.henderson@linaro.org> Inspired by the tests in gcc.target/i386. Testing code generation, diagnostics, and execution. * gcc.target/aarch64/asm-flag-1.c: New test. * gcc.target/aarch64/asm-flag-3.c: New test. * gcc.target/aarch64/asm-flag-5.c: New test. * gcc.target/aarch64/asm-flag-6.c: New test. --- gcc/testsuite/gcc.target/aarch64/asm-flag-1.c | 34 +++++++++++++++ gcc/testsuite/gcc.target/aarch64/asm-flag-3.c | 36 ++++++++++++++++ gcc/testsuite/gcc.target/aarch64/asm-flag-5.c | 30 +++++++++++++ gcc/testsuite/gcc.target/aarch64/asm-flag-6.c | 43 +++++++++++++++++++ 4 files changed, 143 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/asm-flag-1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/asm-flag-3.c create mode 100644 gcc/testsuite/gcc.target/aarch64/asm-flag-5.c create mode 100644 gcc/testsuite/gcc.target/aarch64/asm-flag-6.c -- 2.17.1 diff --git a/gcc/testsuite/gcc.target/aarch64/asm-flag-1.c b/gcc/testsuite/gcc.target/aarch64/asm-flag-1.c new file mode 100644 index 00000000000..e3e79c29b8f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/asm-flag-1.c @@ -0,0 +1,34 @@ +/* Test the valid @cc asm flag outputs. */ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#ifndef __GCC_ASM_FLAG_OUTPUTS__ +#error "missing preprocessor define" +#endif + +void f(char *out) +{ + asm("" + : "=@ccne"(out[0]), "=@cceq"(out[1]), + "=@cccs"(out[2]), "=@cccc"(out[3]), + "=@ccmi"(out[4]), "=@ccpl"(out[5]), + "=@ccvs"(out[6]), "=@ccvc"(out[7]), + "=@cchi"(out[8]), "=@ccls"(out[9]), + "=@ccge"(out[10]), "=@cclt"(out[11]), + "=@ccgt"(out[12]), "=@ccle"(out[13])); +} + +/* { dg-final { scan-assembler "cset.*, ne" } } */ +/* { dg-final { scan-assembler "cset.*, eq" } } */ +/* { dg-final { scan-assembler "cset.*, cs" } } */ +/* { dg-final { scan-assembler "cset.*, cc" } } */ +/* { dg-final { scan-assembler "cset.*, mi" } } */ +/* { dg-final { scan-assembler "cset.*, pl" } } */ +/* { dg-final { scan-assembler "cset.*, vs" } } */ +/* { dg-final { scan-assembler "cset.*, vc" } } */ +/* { dg-final { scan-assembler "cset.*, hi" } } */ +/* { dg-final { scan-assembler "cset.*, ls" } } */ +/* { dg-final { scan-assembler "cset.*, ge" } } */ +/* { dg-final { scan-assembler "cset.*, ls" } } */ +/* { dg-final { scan-assembler "cset.*, gt" } } */ +/* { dg-final { scan-assembler "cset.*, le" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/asm-flag-3.c b/gcc/testsuite/gcc.target/aarch64/asm-flag-3.c new file mode 100644 index 00000000000..8b0bd8a00f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/asm-flag-3.c @@ -0,0 +1,36 @@ +/* Test some of the valid @cc asm flag outputs. */ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +#define DO(C) \ +void f##C(void) { char x; asm("" : "=@cc"#C(x)); if (!x) asm(""); asm(""); } + +DO(ne) +DO(eq) +DO(cs) +DO(cc) +DO(mi) +DO(pl) +DO(vs) +DO(vc) +DO(hi) +DO(ls) +DO(ge) +DO(lt) +DO(gt) +DO(le) + +/* { dg-final { scan-assembler "bne" } } */ +/* { dg-final { scan-assembler "beq" } } */ +/* { dg-final { scan-assembler "bcs" } } */ +/* { dg-final { scan-assembler "bcc" } } */ +/* { dg-final { scan-assembler "bmi" } } */ +/* { dg-final { scan-assembler "bpl" } } */ +/* { dg-final { scan-assembler "bvs" } } */ +/* { dg-final { scan-assembler "bvc" } } */ +/* { dg-final { scan-assembler "bhi" } } */ +/* { dg-final { scan-assembler "bls" } } */ +/* { dg-final { scan-assembler "bge" } } */ +/* { dg-final { scan-assembler "blt" } } */ +/* { dg-final { scan-assembler "bgt" } } */ +/* { dg-final { scan-assembler "ble" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/asm-flag-5.c b/gcc/testsuite/gcc.target/aarch64/asm-flag-5.c new file mode 100644 index 00000000000..4d4394e1478 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/asm-flag-5.c @@ -0,0 +1,30 @@ +/* Test error conditions of asm flag outputs. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +void f_B(void) { _Bool x; asm("" : "=@cccc"(x)); } +void f_c(void) { char x; asm("" : "=@cccc"(x)); } +void f_s(void) { short x; asm("" : "=@cccc"(x)); } +void f_i(void) { int x; asm("" : "=@cccc"(x)); } +void f_l(void) { long x; asm("" : "=@cccc"(x)); } +void f_ll(void) { long long x; asm("" : "=@cccc"(x)); } + +void f_f(void) +{ + float x; + asm("" : "=@cccc"(x)); /* { dg-error invalid type } */ +} + +void f_d(void) +{ + double x; + asm("" : "=@cccc"(x)); /* { dg-error invalid type } */ +} + +struct S { int x[3]; }; + +void f_S(void) +{ + struct S x; + asm("" : "=@cccc"(x)); /* { dg-error invalid type } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/asm-flag-6.c b/gcc/testsuite/gcc.target/aarch64/asm-flag-6.c new file mode 100644 index 00000000000..d9b90b8e517 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/asm-flag-6.c @@ -0,0 +1,43 @@ +/* Executable testcase for 'output flags.' */ +/* { dg-do run } */ + +int test_bits (long nzcv) +{ + long n, z, c, v; + + __asm__ ("msr nzcv, %[in]" + : "=@ccmi"(n), "=@cceq"(z), "=@cccs"(c), "=@ccvs"(v) + : [in] "r"(nzcv << 28)); + + return n * 8 + z * 4 + c * 2 + v == nzcv; +} + +int test_cmp (long x, long y) +{ + long gt, lt, ge, le; + + __asm__ ("cmp %[x], %[y]" + : "=@ccgt"(gt), "=@cclt"(lt), "=@ccge"(ge), "=@ccle"(le) + : [x] "r"(x), [y] "r"(y)); + + return (gt == (x > y) + && lt == (x < y) + && ge == (x >= y) + && le == (x <= y)); +} + +int main () +{ + long i, j; + + for (i = 0; i < 16; ++i) + if (!test_bits (i)) + __builtin_abort (); + + for (i = -1; i <= 1; ++i) + for (j = -1; j <= 1; ++j) + if (!test_cmp (i, j)) + __builtin_abort (); + + return 0; +}