1 ;; Machine Description for TI MSP43* processors
2 ;; Copyright (C) 2013 Free Software Foundation, Inc.
3 ;; Contributed by Red Hat.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3, or (at your option)
12 ;; GCC is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public 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 (define_register_constraint "R12" "R12_REGS"
24 (define_register_constraint "R13" "R13_REGS"
27 (define_constraint "K"
29 (and (match_code "const_int")
30 (match_test "IN_RANGE (ival, 1, 1)")))
32 (define_constraint "L"
33 "Integer constant -1^20..1^19."
34 (and (match_code "const_int")
35 (match_test "IN_RANGE (ival, -1 << 20, 1 << 19)")))
37 (define_constraint "M"
38 "Integer constant 1-4."
39 (and (match_code "const_int")
40 (match_test "IN_RANGE (ival, 1, 4)")))
42 ;; We do not allow arbitrary constants, eg symbols or labels,
43 ;; because their address may be above the 16-bit address limit
44 ;; supported by the offset used in the MOVA instruction.
45 (define_constraint "Ya"
46 "Memory reference, any type, but restricted range of constants"
47 (and (match_code "mem")
48 (ior (match_code "reg" "0")
49 (and (match_code "plus" "0")
50 (match_code "reg" "00")
51 (match_test ("CONST_INT_P (XEXP (XEXP (op, 0), 1))")))
52 (match_test "CONSTANT_P (XEXP (op, 0))")
55 (define_constraint "Yl"
56 "Memory reference, labels only."
57 (and (match_code "mem")
58 (match_code "label_ref" "0")))
61 ;; These are memory references that are safe to use with the X suffix,
62 ;; because we know/assume they need not index across the 64k boundary.
63 (define_constraint "Ys"
64 "Memory reference, stack only."
65 (and (match_code "mem")
67 (and (match_code "plus" "0")
68 (and (match_code "reg" "00")
69 (match_test ("CONST_INT_P (XEXP (XEXP (op, 0), 1))"))
70 (match_test ("IN_RANGE (INTVAL (XEXP (XEXP (op, 0), 1)), -1 << 15, (1 << 15)-1)"))))
71 (match_code "reg" "0")