summaryrefslogtreecommitdiff
path: root/gcc/config/v850/constraints.md
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/config/v850/constraints.md
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/config/v850/constraints.md')
-rw-r--r--gcc/config/v850/constraints.md108
1 files changed, 108 insertions, 0 deletions
diff --git a/gcc/config/v850/constraints.md b/gcc/config/v850/constraints.md
new file mode 100644
index 000000000..eecdab3d4
--- /dev/null
+++ b/gcc/config/v850/constraints.md
@@ -0,0 +1,108 @@
+;; Constraint definitions for V850.
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+;;
+;; 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/>.
+
+(define_register_constraint "e" "EVEN_REGS"
+ "@internal")
+
+;; Integer constraints.
+(define_constraint "I"
+ "Integer constant 0."
+ (and (match_code "const_int")
+ (match_test "ival == 0")))
+
+(define_constraint "J"
+ "A signed 5-bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -16 && ival <= 15")))
+
+(define_constraint "K"
+ "A signed 16-bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -32768 && ival <= 32767")))
+
+(define_constraint "L"
+ "A valid constant for a movhi instruction."
+ (and (match_code "const_int")
+ (ior (match_test "(ival | 0x7fff0000) == 0x7fff0000")
+ (match_test "(ival | 0x7fff0000) + 0x10000 == 0"))))
+
+(define_constraint "M"
+ "An unsigned 16-bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 65535")))
+
+(define_constraint "N"
+ "An unsigned 5-bit immediate in shift instructions."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 31")))
+
+(define_constraint "O"
+ "A signed 9-bit immediate for word multiply instructions."
+ (and (match_code "const_int")
+ (match_test "ival >= -255 && ival <= 255")))
+
+(define_constraint "P"
+ "@internal"
+ (and (match_code "const_int")
+ (match_test "0")))
+
+;; Floating-point constraints.
+(define_constraint "G"
+ "A zero of some form."
+ (and (match_code "const_double")
+ (ior (match_test "GET_MODE_CLASS (mode) == MODE_FLOAT")
+ (match_test "GET_MODE_CLASS (mode) == MODE_INT"))
+ (match_test "op == CONST0_RTX (mode)")))
+
+(define_constraint "H"
+ "@internal"
+ (and (match_code "const_double")
+ (match_test "0")))
+
+;;; Extra constraints.
+(define_constraint "Q"
+ "A memory address that does not contain a symbol address."
+ (and (match_code "mem")
+ (match_test "ep_memory_operand (op, mode, FALSE)")))
+
+(define_constraint "R"
+ "@internal"
+ (match_test "special_symbolref_operand (op, VOIDmode)"))
+
+(define_constraint "S"
+ "@internal"
+ (and (match_code "symbol_ref")
+ (match_test "!SYMBOL_REF_ZDA_P (op)")))
+
+(define_constraint "T"
+ "@internal"
+ (match_test "ep_memory_operand (op, mode, TRUE)"))
+
+(define_constraint "U"
+ "@internal"
+ (ior (and (match_code "symbol_ref")
+ (match_test "SYMBOL_REF_ZDA_P (op)"))
+ (and (match_code "const")
+ (match_test "GET_CODE (XEXP (op, 0)) == PLUS")
+ (match_test "GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF")
+ (match_test "SYMBOL_REF_ZDA_P (XEXP (XEXP (op, 0), 0))"))))
+
+(define_constraint "W"
+ "@internal"
+ (match_test "disp23_operand (op, VOIDmode)"))