2014-03-25 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / config / score / constraints.md
blob50b0ebfda7324b16f14fb453afd5b389fd97bf1c
1 ;; Constraint definitions for S+CORE
2 ;; Copyright (C) 2005-2014 Free Software Foundation, Inc.
3 ;; Contributed by Sunnorth.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published
9 ;; by the Free Software Foundation; either version 3, or (at your
10 ;; option) any later version.
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15 ;; License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3.  If not see
19 ;; <http://www.gnu.org/licenses/>.  */
21 ;; -------------------------------------------------------------------------
22 ;; Constraints
23 ;; -------------------------------------------------------------------------
25 ;; Register constraints.
26 (define_register_constraint "d" "G32_REGS"
27   "r0 to r31")
29 (define_register_constraint "e" "G16_REGS"
30   "r0 to r15")
32 (define_register_constraint "t" "T32_REGS"
33   "r8 to r11 | r22 to r27")
35 (define_register_constraint "h" "HI_REG"
36   "hi")
38 (define_register_constraint "l" "LO_REG"
39   "lo")
41 (define_register_constraint "x" "CE_REGS"
42   "hi + lo")
44 (define_register_constraint "q" "CN_REG"
45   "cnt")
47 (define_register_constraint "y" "LC_REG"
48   "lcb")
50 (define_register_constraint "z" "SC_REG"
51   "scb")
53 (define_register_constraint "a" "SP_REGS"
54   "cnt + lcb + scb")
56 (define_register_constraint "c" "CR_REGS"
57   "cr0 to cr15")
59 ;; Integer constant constraints.
60 (define_constraint "I"
61   "High 16-bit constant (32-bit constant with 16 LSBs zero)."
62   (and (match_code "const_int")
63        (match_test "(ival & 0xffff) == 0")))
65 (define_constraint "J"
66   "Unsigned 5 bit integer (in the range 0 to 31)."
67   (and (match_code "const_int")
68        (match_test "ival >= 0 && ival <= 31")))
70 (define_constraint "K"
71   "Unsigned 16 bit integer (in the range 0 to 65535)."
72   (and (match_code "const_int")
73        (match_test "ival >= 0 && ival <= 65535")))
75 (define_constraint "L"
76   "Signed 16 bit integer (in the range −32768 to 32767)."
77   (and (match_code "const_int")
78        (match_test "ival >= -32768 && ival <= 32767")))
80 (define_constraint "M"
81   "Unsigned 14 bit integer (in the range 0 to 16383)."
82   (and (match_code "const_int")
83        (match_test "ival >= 0 && ival <= 16383")))
85 (define_constraint "N"
86   "Signed 14 bit integer (in the range −8192 to 8191)."
87   (and (match_code "const_int")
88        (match_test "ival >= -8192 && ival <= 8191")))
90 (define_constraint "Z"
91   "Any SYMBOL_REF."
92   (and (match_code "symbol_ref")
93        (match_test "GET_CODE (op) == SYMBOL_REF")))