This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 2/4] Add a branch cost for SPARC T4.
- From: Sheldon Lobo <sheldon dot lobo at oracle dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 17 May 2017 15:36:16 -0400
- Subject: [PATCH 2/4] Add a branch cost for SPARC T4.
- Authentication-results: sourceware.org; auth=none
- References: <1495049778-20262-1-git-send-email-sheldon.lobo@oracle.com>
* config/sparc/sparc.h (BRANCH_COST): Set the SPARC T4 branch
latency to 2.
---
gcc/config/sparc/sparc.h | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 590a5f4..6277738 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1566,7 +1566,9 @@ do { \
and annulled branches insert 4 bubbles.
On Niagara-2 and Niagara-3, a not-taken branch costs 1 cycle whereas
- a taken branch costs 6 cycles. */
+ a taken branch costs 6 cycles.
+
+ The T4 Supplement specifies the branch latency at 2 cycles. */
#define BRANCH_COST(speed_p, predictable_p) \
((sparc_cpu == PROCESSOR_V9 \
@@ -1579,7 +1581,9 @@ do { \
: ((sparc_cpu == PROCESSOR_NIAGARA2 \
|| sparc_cpu == PROCESSOR_NIAGARA3) \
? 5 \
- : 3))))
+ : (sparc_cpu == PROCESSOR_NIAGARA4 \
+ ? 2 \
+ : 3)))))
/* Control the assembler format that we output. */
--
1.7.1