aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/config/cr16/constraints.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/config/cr16/constraints.md')
-rw-r--r--gcc-4.9/gcc/config/cr16/constraints.md81
1 files changed, 81 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/config/cr16/constraints.md b/gcc-4.9/gcc/config/cr16/constraints.md
new file mode 100644
index 000000000..9d9789bce
--- /dev/null
+++ b/gcc-4.9/gcc/config/cr16/constraints.md
@@ -0,0 +1,81 @@
+;; Predicates of machine description for CR16.
+;; Copyright (C) 2012-2014 Free Software Foundation, Inc.
+;; Contributed by KPIT Cummins Infosystems Limited.
+;;
+;; This file is part of GCC.
+;;
+;; GCC is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published
+;; by the Free Software Foundation; either version 3, or (at your
+;; option) any later version.
+;;
+;; GCC is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+;; License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;; Constraints
+;; Register constraints
+(define_register_constraint "b" "NOSP_REGS"
+ "@no sp registers")
+
+(define_register_constraint "c" "SHORT_REGS"
+ "@short registers")
+
+(define_register_constraint "d" "LONG_REGS"
+ "@long registers")
+
+;; Integer constraints.
+(define_constraint "I"
+ "A signed 4-bit immediate."
+ (and (match_code "const_int")
+ (match_test "SIGNED_INT_FITS_N_BITS (ival, 4)")))
+
+(define_constraint "J"
+ "A signed 5-bit immediate."
+ (and (match_code "const_int")
+ (match_test "SIGNED_INT_FITS_N_BITS (ival, 5)")))
+
+(define_constraint "K"
+ "A signed 6-bit immediate."
+ (and (match_code "const_int")
+ (match_test "SIGNED_INT_FITS_N_BITS (ival, 6)")))
+
+(define_constraint "L"
+ "A unsigned 4-bit immediate."
+ (and (match_code "const_int")
+ (match_test "UNSIGNED_INT_FITS_N_BITS (ival, 4)")))
+
+(define_constraint "M"
+ "A unsigned and customized 4-bit immediate."
+ (and (match_code "const_int")
+ (match_test "(IN_RANGE_P (ival, 0, 15) && ((ival != 9) && (ival != 11)))")))
+
+(define_constraint "N"
+ "A signed 16-bit immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE_P (ival, -32768, 32767)")))
+
+(define_constraint "O"
+ "A unsigned 20-bit immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE_P (ival, 0, 1048575)")))
+
+(define_constraint "Q"
+ "A shift QI immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE_P (ival, 0, 7)")))
+
+(define_constraint "R"
+ "A shift HI immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE_P (ival, 0, 15)")))
+
+(define_constraint "S"
+ "A shift SI immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE_P (ival, 0, 31)")))