aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2016-02-10 12:36:03 +0000
committerWilco Dijkstra <wdijkstr@arm.com>2016-02-10 12:36:03 +0000
commit1a65eb20f453885fb37025a3a08c30930a4d8219 (patch)
tree74b8569185463e940cd1fc92a94d03971f734c04
parent7a347f6b18eaa398f48836abbfd006c29baf1b6e (diff)
Enable instruction fusion of AES instructions on ARM for Cortex-A53 and
Cortex-A57. gcc/ * config/arm/arm.c (arm_cortex_a53_tune): Enable AES fusion. (arm_cortex_a57_tune): Likewise. (aarch_macro_fusion_pair_p): Add support for AES fusion. * config/arm/arm-protos.h (fuse_ops): Add FUSE_AES_AESMC git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@233266 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/arm/arm-protos.h5
-rw-r--r--gcc/config/arm/arm.c8
3 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 70290d9aabb..42e89c7dc22 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2016-02-10 Wilco Dijkstra <wdijkstr@arm.com>
+
+ * config/arm/arm.c (arm_cortex_a53_tune): Enable AES fusion.
+ (arm_cortex_a57_tune): Likewise.
+ (aarch_macro_fusion_pair_p): Add support for AES fusion.
+ * config/arm/arm-protos.h (fuse_ops): Add FUSE_AES_AESMC.
+
2016-02-10 Eric Botcazou <ebotcazou@adacore.com>
* timevar.def (TV_PHASE_DBGINFO): Delete.
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index e051d3b03ec..0083673b161 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -300,8 +300,9 @@ struct tune_params
enum fuse_ops
{
FUSE_NOTHING = 0,
- FUSE_MOVW_MOVT = 1 << 0
- } fusible_ops: 1;
+ FUSE_MOVW_MOVT = 1 << 0,
+ FUSE_AES_AESMC = 1 << 1
+ } fusible_ops: 2;
/* Depth of scheduling queue to check for L2 autoprefetcher. */
enum {SCHED_AUTOPREF_OFF, SCHED_AUTOPREF_RANK, SCHED_AUTOPREF_FULL}
sched_autopref: 2;
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 27aecf7d1a4..82becef2230 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1982,7 +1982,7 @@ const struct tune_params arm_cortex_a53_tune =
tune_params::DISPARAGE_FLAGS_NEITHER,
tune_params::PREF_NEON_64_FALSE,
tune_params::PREF_NEON_STRINGOPS_TRUE,
- FUSE_OPS (tune_params::FUSE_MOVW_MOVT),
+ FUSE_OPS (tune_params::FUSE_MOVW_MOVT | tune_params::FUSE_AES_AESMC),
tune_params::SCHED_AUTOPREF_OFF
};
@@ -2005,7 +2005,7 @@ const struct tune_params arm_cortex_a57_tune =
tune_params::DISPARAGE_FLAGS_ALL,
tune_params::PREF_NEON_64_FALSE,
tune_params::PREF_NEON_STRINGOPS_TRUE,
- FUSE_OPS (tune_params::FUSE_MOVW_MOVT),
+ FUSE_OPS (tune_params::FUSE_MOVW_MOVT | tune_params::FUSE_AES_AESMC),
tune_params::SCHED_AUTOPREF_FULL
};
@@ -29683,6 +29683,10 @@ aarch_macro_fusion_pair_p (rtx_insn* prev, rtx_insn* curr)
if (!arm_macro_fusion_p ())
return false;
+ if (current_tune->fusible_ops & tune_params::FUSE_AES_AESMC
+ && aarch_crypto_can_dual_issue (prev, curr))
+ return true;
+
if (current_tune->fusible_ops & tune_params::FUSE_MOVW_MOVT)
{
/* We are trying to fuse