aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2018-10-16 17:28:56 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2018-10-16 17:28:56 +0000
commit21cebf90b6547434d1ccb3f09287d02c1e8d2004 (patch)
tree670b879f6905ab578eadac730317d86517e680b4 /gcc
parent436ea0e5d316be9867bb23db70a09e12107c0d7d (diff)
downloadgcc-21cebf90b6547434d1ccb3f09287d02c1e8d2004.zip
gcc-21cebf90b6547434d1ccb3f09287d02c1e8d2004.tar.gz
gcc-21cebf90b6547434d1ccb3f09287d02c1e8d2004.tar.bz2
[AArch64] Use @ pattern to eliminate switch statement in one more place
We can use the new '@' modifier to MD patterns to generate mode-parametrised gen_ functions for the despeculate_copy patterns and therefore remove the switch on modes in aarch64.c that is used to pick the right generator. This simplifies the code. * config/aarch64/aarch64.md (despeculate_copy<ALLI_TI:mode>): Rename to... (@despeculate_copy<ALLI_TI:mode>): ... This. * config/aarch64/aarch64.c (aarch64_speculation_safe_value): Remove switch statement. From-SVN: r265210
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/aarch64/aarch64.c21
-rw-r--r--gcc/config/aarch64/aarch64.md2
3 files changed, 10 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dfcc0d3..b398d1b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2018-10-16 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/aarch64/aarch64.md (despeculate_copy<ALLI_TI:mode>):
+ Rename to...
+ (@despeculate_copy<ALLI_TI:mode>): ... This.
+ * config/aarch64/aarch64.c (aarch64_speculation_safe_value): Remove
+ switch statement.
+
2018-10-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config.gcc: Obsolete *-*-solaris2.10*.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 4c77908..54f5746 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -17969,26 +17969,7 @@ aarch64_speculation_safe_value (machine_mode mode,
if (!aarch64_reg_or_zero (failval, mode))
failval = copy_to_mode_reg (mode, failval);
- switch (mode)
- {
- case E_QImode:
- emit_insn (gen_despeculate_copyqi (result, val, failval));
- break;
- case E_HImode:
- emit_insn (gen_despeculate_copyhi (result, val, failval));
- break;
- case E_SImode:
- emit_insn (gen_despeculate_copysi (result, val, failval));
- break;
- case E_DImode:
- emit_insn (gen_despeculate_copydi (result, val, failval));
- break;
- case E_TImode:
- emit_insn (gen_despeculate_copyti (result, val, failval));
- break;
- default:
- gcc_unreachable ();
- }
+ emit_insn (gen_despeculate_copy (mode, result, val, failval));
return result;
}
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 58e9962..d747341 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -6716,7 +6716,7 @@
;; Support for __builtin_speculation_safe_value when we have speculation
;; tracking enabled. Use the speculation tracker to decide whether to
;; copy operand 1 to the target, or to copy the fail value (operand 2).
-(define_expand "despeculate_copy<ALLI_TI:mode>"
+(define_expand "@despeculate_copy<ALLI_TI:mode>"
[(set (match_operand:ALLI_TI 0 "register_operand" "=r")
(unspec_volatile:ALLI_TI
[(match_operand:ALLI_TI 1 "register_operand" "r")