1 ;; Constraint definitions for Lattice Mico32 architecture.
2 ;; Contributed by Jon Beniston <jon@beniston.com>
4 ;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
6 ;; This file is part of GCC.
8 ;; GCC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 3, or (at your option)
13 ;; GCC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GCC; see the file COPYING3. If not see
20 ;; <http://www.gnu.org/licenses/>.
22 (define_constraint "J"
24 (and (match_code "const_int")
25 (match_test "ival == 0")))
27 (define_constraint "K"
28 "A signed 16-bit immediate in the range -32768 to 32767."
29 (and (match_code "const_int")
30 (match_test "IN_RANGE (ival, -32768, 32767)")))
32 (define_constraint "L"
33 "An unsigned 16-bit immediate in the range 0 to 65535."
34 (and (match_code "const_int")
35 (match_test "IN_RANGE (ival, 0, 65535)")))
37 (define_constraint "M"
39 (and (match_code "const_int")
40 (match_test "ival == 1")))
42 (define_constraint "U"
43 "A shifted signed 16-bit constant appropriate for orhi."
44 (and (match_code "const_int")
45 (match_test "(ival & 0xffff) == 0
46 && (ival >> 31 == -1 || ival >> 31 == 0)")))
48 (define_constraint "S"
49 "A symbol in the small data section."
50 (match_operand 0 "no_pic_small_symbol"))
52 (define_constraint "Y"
53 "A high part of a symbol."
54 (and (match_code "high")
55 (ior (ior (match_code "symbol_ref" "0")
56 (match_code "label_ref" "0"))
57 (match_code "const" "0"))))