From patchwork Wed Aug 19 15:58:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 508773 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 2DCCD14076C for ; Thu, 20 Aug 2015 01:58:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=fAwFa16l; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=dQ/CmNwixC68R+UHypme9VSxJYn2OnoHTFt3JkDqUWMSSJ pLhhOAaxhZkwUvFbKhCU0ECH3+YqqXEDtVBR9ejYFrl3H/r24q+WQ1TgbkQPxqig RgiIt9w9DNbB4HCgWKlD1sYiSHmhfA2tUfoOlG/gSp7jGxXNXiD/iGetccxsA= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=OeV3DUysMMxIjalNsm+WqYlSOUk=; b=fAwFa16lFDrPUbkZMY9S cMOYAfeJ7mMiqnm9GgSROfTyRWatZqnmTuuGACwTEC7TyaCL0+MXH51y+CJPR9w7 3CIVi76HGEb1GVAi8n626ggU7nLo00BlFndg4FAGN+y7XunDbRG6simXX2b+GsNb GKP+2f1eFOBoucbJWhikXkE= Received: (qmail 35814 invoked by alias); 19 Aug 2015 15:58:37 -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 35804 invoked by uid 89); 19 Aug 2015 15:58:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f47.google.com Received: from mail-la0-f47.google.com (HELO mail-la0-f47.google.com) (209.85.215.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 19 Aug 2015 15:58:26 +0000 Received: by lalv9 with SMTP id v9so5923560lal.0 for ; Wed, 19 Aug 2015 08:58:22 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.153.8.137 with SMTP id dk9mr11918561lad.57.1439999902581; Wed, 19 Aug 2015 08:58:22 -0700 (PDT) Received: by 10.25.158.69 with HTTP; Wed, 19 Aug 2015 08:58:22 -0700 (PDT) Date: Wed, 19 Aug 2015 23:58:22 +0800 Message-ID: Subject: [PATCHv2/AARCH64] Remove index from AARCH64_FUSION_PAIR From: Andrew Pinski To: GCC Patches , James Greenhalgh X-IsSubscribed: yes Changes from v1: Also remove the hack AARCH64_FUSE_ALL. Instead of doing an explict index in aarch64-fusion-pairs.def, we should have an enum which does the index instead. This allows you to add/remove them without worrying about the order being correct and having holes or worry about merge conficts. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. ChangeLog: * aarch64-fusion-pairs.def: Remove all index to AARCH64_FUSION_PAIR. * config/aarch64/aarch64-protos.h (aarch64_fusion_pairs_index): New enum. (aarch64_fusion_pairs): Base the shifted value on the index instead Rewrite AARCH64_FUSE_ALL to be based on the end index. of the argument to AARCH64_FUSION_PAIR. * config/aarch64/aarch64.c: Remove the last argument to AARCH64_FUSION_PAIR. commit 8a02e03360852b9261d45528384fa8b87c673e53 Author: Andrew Pinski Date: Tue Aug 18 22:13:32 2015 -0700 Remove index from AARCH64_FUSION_PAIR Instead of doing an explict index in aarch64-fusion-pairs.def, we should have an enum which does the index instead. This allows you to add/remove them without worrying about the order being correct and having holes or worry about merge conficts. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. ChangeLog: * aarch64-fusion-pairs.def: Remove all index to AARCH64_FUSION_PAIR. * config/aarch64/aarch64-protos.h (aarch64_fusion_pairs_index): New enum. (aarch64_fusion_pairs): Base the shifted value on the index instead Rewrite AARCH64_FUSE_ALL to be based on the end index. of the argument to AARCH64_FUSION_PAIR. * config/aarch64/aarch64.c: Remove the last argument to AARCH64_FUSION_PAIR. diff --git a/gcc/config/aarch64/aarch64-fusion-pairs.def b/gcc/config/aarch64/aarch64-fusion-pairs.def index a7b00f6..53bbef4 100644 --- a/gcc/config/aarch64/aarch64-fusion-pairs.def +++ b/gcc/config/aarch64/aarch64-fusion-pairs.def @@ -20,19 +20,17 @@ /* Pairs of instructions which can be fused. before including this file, define a macro: - AARCH64_FUSION_PAIR (name, internal_name, index_bit) + AARCH64_FUSION_PAIR (name, internal_name) Where: NAME is a string giving a friendly name for the instructions to fuse. INTERNAL_NAME gives the internal name suitable for appending to - AARCH64_FUSE_ to give an enum name. - INDEX_BIT is the bit to set in the bitmask of supported fusion - operations. */ - -AARCH64_FUSION_PAIR ("mov+movk", MOV_MOVK, 0) -AARCH64_FUSION_PAIR ("adrp+add", ADRP_ADD, 1) -AARCH64_FUSION_PAIR ("movk+movk", MOVK_MOVK, 2) -AARCH64_FUSION_PAIR ("adrp+ldr", ADRP_LDR, 3) -AARCH64_FUSION_PAIR ("cmp+branch", CMP_BRANCH, 4) + AARCH64_FUSE_ to give an enum name. */ + +AARCH64_FUSION_PAIR ("mov+movk", MOV_MOVK) +AARCH64_FUSION_PAIR ("adrp+add", ADRP_ADD) +AARCH64_FUSION_PAIR ("movk+movk", MOVK_MOVK) +AARCH64_FUSION_PAIR ("adrp+ldr", ADRP_LDR) +AARCH64_FUSION_PAIR ("cmp+branch", CMP_BRANCH) diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 0b09d49..057d4fc 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -201,23 +201,24 @@ struct tune_params unsigned int extra_tuning_flags; }; -#define AARCH64_FUSION_PAIR(x, name, index) \ - AARCH64_FUSE_##name = (1 << index), +#define AARCH64_FUSION_PAIR(x, name) \ + AARCH64_FUSE_##name##_index, /* Supported fusion operations. */ -enum aarch64_fusion_pairs +enum aarch64_fusion_pairs_index { - AARCH64_FUSE_NOTHING = 0, #include "aarch64-fusion-pairs.def" - -/* Hacky macro to build AARCH64_FUSE_ALL. The sequence below expands - to: - AARCH64_FUSE_ALL = 0 | AARCH64_FUSE_index1 | AARCH64_FUSE_index2 ... */ + AARCH64_FUSE_index_END +}; #undef AARCH64_FUSION_PAIR -#define AARCH64_FUSION_PAIR(x, name, y) \ - | AARCH64_FUSE_##name - AARCH64_FUSE_ALL = 0 +#define AARCH64_FUSION_PAIR(x, name) \ + AARCH64_FUSE_##name = (1u << AARCH64_FUSE_##name##_index), +/* Supported fusion operations. */ +enum aarch64_fusion_pairs +{ + AARCH64_FUSE_NOTHING = 0, #include "aarch64-fusion-pairs.def" + AARCH64_FUSE_ALL = (1u << AARCH64_FUSE_index_END) - 1 }; #undef AARCH64_FUSION_PAIR diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index aa268ae..162e25e 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -172,7 +172,7 @@ struct aarch64_flag_desc unsigned int flag; }; -#define AARCH64_FUSION_PAIR(name, internal_name, y) \ +#define AARCH64_FUSION_PAIR(name, internal_name) \ { name, AARCH64_FUSE_##internal_name }, static const struct aarch64_flag_desc aarch64_fusible_pairs[] = {