From patchwork Wed Aug 19 11:15:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 508709 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 2036C14078B for ; Wed, 19 Aug 2015 21:15:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=c/Vv9Xob; 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=UC/5yxlB6pjKp9mqIHvGLzsF0h5oPaLusQfoG9emVEa0kk FNl6HCZBJZAsXaHfFShKDDBepl7BdIbPqKdOGbnHT5mPcKvN4QDNXlmbaz26EIjR QTw5mXVf84sLD65OjJD/yNxQl+d3ct2GbOXYDJw8VoNmRj7PjgM3AI4REd8vk= 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=jG1URqNIn53TuzS4oF6NYSn2U4c=; b=c/Vv9XobY2ZLR7EKK2xp MUdlK+sXagve203Q6QHkMCoE8mcNSDqWVAXjhYipTKClQZEqpGkZ8uHyb6P5fcT3 9HOljB27omt+cE3WF2qp5TFhxKtqL+Jdy/lmLvbfVpElJfzexLFwrYiAuTKhJiSL uwEMHVtRJE90prEoem2C23Q= Received: (qmail 43344 invoked by alias); 19 Aug 2015 11:15:41 -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 43333 invoked by uid 89); 19 Aug 2015 11:15:40 -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-lb0-f171.google.com Received: from mail-lb0-f171.google.com (HELO mail-lb0-f171.google.com) (209.85.217.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 19 Aug 2015 11:15:39 +0000 Received: by lbbsx3 with SMTP id sx3so880666lbb.0 for ; Wed, 19 Aug 2015 04:15:36 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.146.106 with SMTP id tb10mr10654236lbb.22.1439982936013; Wed, 19 Aug 2015 04:15:36 -0700 (PDT) Received: by 10.25.158.69 with HTTP; Wed, 19 Aug 2015 04:15:35 -0700 (PDT) Date: Wed, 19 Aug 2015 19:15:35 +0800 Message-ID: Subject: [PATCH/AARCH64] Remove index from AARCH64_EXTRA_TUNING_OPTION From: Andrew Pinski To: GCC Patches X-IsSubscribed: yes Just like the patch for AARCH64_FUSION_PAIR, this is a patch for AARCH64_EXTRA_TUNING_OPTION. Note I tested this patch on top of the patch for AARCH64_EXTRA_TUNING_OPTION. 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 of the argument to AARCH64_FUSION_PAIR. * config/aarch64/aarch64.c: Remove the last argument to AARCH64_FUSION_PAIR. commit 61a89a2f6939fbc97e18d2137daba7f450ef76b2 Author: Andrew Pinski Date: Wed Aug 19 01:15:00 2015 -0700 Remove index from AARCH64_EXTRA_TUNING_OPTION Instead of doing an explict index in aarch64-tuning-flags.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: ChangeLog: * config/aarch64/aarch64-tuning-flags.def: Remove all index to AARCH64_EXTRA_TUNING_OPTION. * config/aarch64/aarch64-protos.h (extra_tuning_flags_index): New enum. (aarch64_extra_tuning_flags): Base the shifted value on the index instead of the argument to AARCH64_EXTRA_TUNING_OPTION. * config/aarch64/aarch64.c: Remove the last argument to AARCH64_EXTRA_TUNING_OPTION.. diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index c4c1817..2abee03 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -231,8 +231,19 @@ enum aarch64_fusion_pairs }; #undef AARCH64_FUSION_PAIR -#define AARCH64_EXTRA_TUNING_OPTION(x, name, index) \ - AARCH64_EXTRA_TUNE_##name = (1 << index), +#define AARCH64_EXTRA_TUNING_OPTION(x, name) \ + AARCH64_EXTRA_TUNE_##name##_index, +/* Supported tuning flags indexes. */ +enum aarch64_extra_tuning_flags_index +{ +#include "aarch64-tuning-flags.def" + AARCH64_EXTRA_TUNE_index_END +}; +#undef AARCH64_EXTRA_TUNING_OPTION + + +#define AARCH64_EXTRA_TUNING_OPTION(x, name) \ + AARCH64_EXTRA_TUNE_##name = (1 << AARCH64_EXTRA_TUNE_##name##_index), /* Supported tuning flags. */ enum aarch64_extra_tuning_flags { @@ -242,7 +253,7 @@ enum aarch64_extra_tuning_flags /* Hacky macro to build the "all" flag mask. Expands to 0 | AARCH64_TUNE_index0 | AARCH64_TUNE_index1 , etc. */ #undef AARCH64_EXTRA_TUNING_OPTION -#define AARCH64_EXTRA_TUNING_OPTION(x, name, y) \ +#define AARCH64_EXTRA_TUNING_OPTION(x, name) \ | AARCH64_EXTRA_TUNE_##name AARCH64_EXTRA_TUNE_ALL = 0 #include "aarch64-tuning-flags.def" diff --git a/gcc/config/aarch64/aarch64-tuning-flags.def b/gcc/config/aarch64/aarch64-tuning-flags.def index 01aaca8..628386b 100644 --- a/gcc/config/aarch64/aarch64-tuning-flags.def +++ b/gcc/config/aarch64/aarch64-tuning-flags.def @@ -20,15 +20,13 @@ /* Additional control over certain tuning parameters. Before including this file, define a macro: - AARCH64_EXTRA_TUNING_OPTION (name, internal_name, index_bit) + AARCH64_EXTRA_TUNING_OPTION (name, internal_name) Where: NAME is a string giving a friendly name for the tuning flag. INTERNAL_NAME gives the internal name suitable for appending to - AARCH64_TUNE_ to give an enum name. - INDEX_BIT is the bit to set in the bitmask of supported tuning - flags. */ + AARCH64_TUNE_ to give an enum name. */ -AARCH64_EXTRA_TUNING_OPTION ("rename_fma_regs", RENAME_FMA_REGS, 0) +AARCH64_EXTRA_TUNING_OPTION ("rename_fma_regs", RENAME_FMA_REGS) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 162e25e..ad144fe 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -183,7 +183,7 @@ static const struct aarch64_flag_desc aarch64_fusible_pairs[] = }; #undef AARCH64_FUION_PAIR -#define AARCH64_EXTRA_TUNING_OPTION(name, internal_name, y) \ +#define AARCH64_EXTRA_TUNING_OPTION(name, internal_name) \ { name, AARCH64_EXTRA_TUNE_##internal_name }, static const struct aarch64_flag_desc aarch64_tuning_flags[] = {