From patchwork Mon Feb 12 23:56:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 872531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-473127-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="OueKLACh"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zgMzr1r98z9sPk for ; Tue, 13 Feb 2018 10:57:42 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=W8leVdDHR8eyYFb9Ot8LiJG1CucmiRvbG9IFfdTVWsYxaQ y51X9/HVS8HNyExJ0GaOhoBcTS9g4U+PisjR8aWo1dC86YJQ/dYx8FBlsdGV8c3N opqdORqAQNh8U5fm59p2Xvd9WTtwASyipVZMecUOOUGwDeN0WOiCHjWjKFRvk= 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:from:date:message-id:subject:to:content-type; s= default; bh=f8N7UDy58yDX9lqOGmEuqNPyUNs=; b=OueKLAChTulGu0FDPykJ EoZGraLYhhUfvTt9uYppKBDawcw9spbDaKBHzzIwPAMyKUnO+fF2a3VPx2xLKapk J9av7llpk6w4e+lVAO9bXx51MUVTwZ8/19ARFntRnaiI5Gk6Nr+WrrsSMalkYFgC IhfbprELvztBwTH08PgLfM0= Received: (qmail 19445 invoked by alias); 12 Feb 2018 23:57: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 19434 invoked by uid 89); 12 Feb 2018 23:57:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.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.2 spammy=5578 X-HELO: mail-qt0-f172.google.com Received: from mail-qt0-f172.google.com (HELO mail-qt0-f172.google.com) (209.85.216.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Feb 2018 23:57:33 +0000 Received: by mail-qt0-f172.google.com with SMTP id d14so1722377qtg.1 for ; Mon, 12 Feb 2018 15:57:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=P19l+PGwPqAdPk4hCIidQDPpBk1R43Dr9YxJjvcsRMk=; b=m9lrNjEmr17tdbwgCHK6u0RRd9FM204TK2vy2vshlCJhR/WWBHf++yAWCAaIWcXLEv OpAlcJVjyl6JkNcdgqWbAXJvceTTZSD6TBPX7inDAvI/LSS1JTdq74ar/tZcVdL31uNo OrdYyfJG7xBFvEXldFWfEsSvnfMuWY4Bl2qodpxcHgHvTzOboliooEwqasf44nCM/gky zPNtAXEnZUHC2+6IYU27AAYMWlXriBankfkL3JM2Em7BcAUI4sacsxIMVvlUVEQwEeAX 4ooiGpid/3m6rRu7EWbbqdeH0AkLTUjpxvuJZ5o7XYc+J82uZr6eIIeVCyB7/ffRwafW utqw== X-Gm-Message-State: APf1xPD1oqASKFFJdSM8C0hrCzwmORxhpPsStW6WGMhPcrn9P4Bjc254 vXQySH6HgrKleA9ks93oiuG5yWchnGM3hyTFf3FIfm98gLo= X-Google-Smtp-Source: AH8x224NoYIEHXj6swIf5Jqv9NeuJ8Q2HSa/n459Ftv58SJEEHySxLH7VllVoJCo4MNJFS7xIDxGeehpIqBD2xBQGOo= X-Received: by 10.200.50.75 with SMTP id y11mr10130833qta.153.1518479851659; Mon, 12 Feb 2018 15:57:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.36.185 with HTTP; Mon, 12 Feb 2018 15:56:51 -0800 (PST) From: Kugan Vivekanandarajah Date: Tue, 13 Feb 2018 10:56:51 +1100 Message-ID: Subject: [RFC][AARCH64] Implements target hook To: GCC Patches X-IsSubscribed: yes Implements target hook TARGET_HW_MAX_MEM_READ_STREAMS for aarch64 gcc/ChangeLog: 2018-02-12 Kugan Vivekanandarajah * config/aarch64/aarch64-protos.h (struct cpu_prefetch_tune): Add new entry hw_prefetchers_avail. * config/aarch64/aarch64.c (aarch64_hw_max_mem_read_streams): Implement new target hook. (TARGET_HW_MAX_MEM_READ_STREAMS): Likewise. From 3529cf5b85d7282b1829d53652f03d0945359ad6 Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah Date: Mon, 12 Feb 2018 10:44:26 +1100 Subject: [PATCH 3/4] add-prefetchers-availabl Change-Id: I68af62d7be56255574a9c3f636b2d338f918b4e1 --- gcc/config/aarch64/aarch64-protos.h | 1 + gcc/config/aarch64/aarch64.c | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 2d705d2..2e3b2a1 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -231,6 +231,7 @@ struct cpu_prefetch_tune const int l1_cache_line_size; const int l2_cache_size; const int default_opt_level; + const int hw_prefetchers_avail; }; struct tune_params diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 2e70f3a..1ce2a0c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -547,7 +547,8 @@ static const cpu_prefetch_tune generic_prefetch_tune = -1, /* l1_cache_size */ -1, /* l1_cache_line_size */ -1, /* l2_cache_size */ - -1 /* default_opt_level */ + -1, /* default_opt_level */ + -1 /* default hw_prefetchers_avail */ }; static const cpu_prefetch_tune exynosm1_prefetch_tune = @@ -556,7 +557,8 @@ static const cpu_prefetch_tune exynosm1_prefetch_tune = -1, /* l1_cache_size */ 64, /* l1_cache_line_size */ -1, /* l2_cache_size */ - -1 /* default_opt_level */ + -1, /* default_opt_level */ + -1 /* default hw_prefetchers_avail */ }; static const cpu_prefetch_tune qdf24xx_prefetch_tune = @@ -565,7 +567,8 @@ static const cpu_prefetch_tune qdf24xx_prefetch_tune = 32, /* l1_cache_size */ 64, /* l1_cache_line_size */ 1024, /* l2_cache_size */ - -1 /* default_opt_level */ + -1, /* default_opt_level */ + 7 /* hw_prefetchers_avail */ }; static const cpu_prefetch_tune thunderxt88_prefetch_tune = @@ -574,7 +577,8 @@ static const cpu_prefetch_tune thunderxt88_prefetch_tune = 32, /* l1_cache_size */ 128, /* l1_cache_line_size */ 16*1024, /* l2_cache_size */ - 3 /* default_opt_level */ + 3, /* default_opt_level */ + -1 /* default hw_prefetchers_avail */ }; static const cpu_prefetch_tune thunderx_prefetch_tune = @@ -583,7 +587,8 @@ static const cpu_prefetch_tune thunderx_prefetch_tune = 32, /* l1_cache_size */ 128, /* l1_cache_line_size */ -1, /* l2_cache_size */ - -1 /* default_opt_level */ + -1, /* default_opt_level */ + -1 /* default hw_prefetchers_avail */ }; static const cpu_prefetch_tune thunderx2t99_prefetch_tune = @@ -592,7 +597,8 @@ static const cpu_prefetch_tune thunderx2t99_prefetch_tune = 32, /* l1_cache_size */ 64, /* l1_cache_line_size */ 256, /* l2_cache_size */ - -1 /* default_opt_level */ + -1, /* default_opt_level */ + -1 /* default hw_prefetchers_avail */ }; static const struct tune_params generic_tunings = @@ -17143,6 +17149,11 @@ aarch64_sched_can_speculate_insn (rtx_insn *insn) return true; } } +static int +aarch64_hw_max_mem_read_streams () +{ + return aarch64_tune_params.prefetch->hw_prefetchers_avail; +} /* Implement TARGET_COMPUTE_PRESSURE_CLASSES. */ @@ -17661,6 +17672,9 @@ aarch64_libgcc_floating_mode_supported_p #undef TARGET_SELECT_EARLY_REMAT_MODES #define TARGET_SELECT_EARLY_REMAT_MODES aarch64_select_early_remat_modes +#undef TARGET_HW_MAX_MEM_READ_STREAMS +#define TARGET_HW_MAX_MEM_READ_STREAMS aarch64_hw_max_mem_read_streams + #if CHECKING_P #undef TARGET_RUN_TARGET_SELFTESTS #define TARGET_RUN_TARGET_SELFTESTS selftest::aarch64_run_selftests -- 2.7.4