summaryrefslogtreecommitdiff
path: root/gcc/config/arm/predicates.md
diff options
context:
space:
mode:
authorMihail Ionescu <mihail.ionescu@arm.com>2020-01-17 18:14:54 +0000
committerMihail Ionescu <mihail.ionescu@arm.com>2020-01-17 18:50:38 +0000
commita968a40c4ee34ff4ca69018c7ad91002b347e3df (patch)
treeef6476f8d856e0398616c1ebaa92c4ef85d478f3 /gcc/config/arm/predicates.md
parent60d616b1f6deffcc57a4114f1a31559a17a3923c (diff)
downloadgcc-a968a40c4ee34ff4ca69018c7ad91002b347e3df.tar.gz
[GCC/ARM, 2/2] Add support for ASRL(imm), LSLL(imm) and LSRL(imm) instructions for Armv8.1-M Mainline
This patch is adding the following instructions: ASRL (imm) LSLL (imm) LSRL (imm) *** gcc/ChangeLog *** 2020-01-17 Mihail-Calin Ionescu <mihail.ionescu@arm.com> Sudakshina Das <sudi.das@arm.com> * config/arm/arm.md (ashldi3): Generate thumb2_lsll for both reg and valid immediate. (ashrdi3): Generate thumb2_asrl for both reg and valid immediate. (lshrdi3): Generate thumb2_lsrl for valid immediates. * config/arm/constraints.md (Pg): New. * config/arm/predicates.md (long_shift_imm): New. (arm_reg_or_long_shift_imm): Likewise. * config/arm/thumb2.md (thumb2_asrl): New immediate alternative. (thumb2_lsll): Likewise. (thumb2_lsrl): New. *** gcc/testsuite/ChangeLog *** 2020-01-17 Mihail-Calin Ionescu <mihail.ionescu@arm.com> Sudakshina Das <sudi.das@arm.com> * gcc.target/arm/armv8_1m-shift-imm_1.c: New test.
Diffstat (limited to 'gcc/config/arm/predicates.md')
-rw-r--r--gcc/config/arm/predicates.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md
index 8df99e64bbb..3a3941e2246 100644
--- a/gcc/config/arm/predicates.md
+++ b/gcc/config/arm/predicates.md
@@ -336,6 +336,15 @@
&& (UINTVAL (XEXP (op, 1)) < 32)")))
(match_test "mode == GET_MODE (op)")))
+;; True for Armv8.1-M Mainline long shift instructions.
+(define_predicate "long_shift_imm"
+ (match_test "satisfies_constraint_Pg (op)"))
+
+(define_predicate "arm_reg_or_long_shift_imm"
+ (ior (match_test "TARGET_THUMB2
+ && arm_general_register_operand (op, GET_MODE (op))")
+ (match_test "satisfies_constraint_Pg (op)")))
+
;; True for MULT, to identify which variant of shift_operator is in use.
(define_special_predicate "mult_operator"
(match_code "mult"))