1 ;; Constraint definitions for V850.
2 ;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
4 ;; This file is part of GCC.
6 ;; GCC is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 3, or (at your option)
11 ;; GCC is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GCC; see the file COPYING3. If not see
18 ;; <http://www.gnu.org/licenses/>.
20 (define_register_constraint "e" "EVEN_REGS"
23 ;; Integer constraints.
24 (define_constraint "I"
26 (and (match_code "const_int")
27 (match_test "ival == 0")))
29 (define_constraint "J"
30 "A signed 5-bit immediate."
31 (and (match_code "const_int")
32 (match_test "ival >= -16 && ival <= 15")))
34 (define_constraint "K"
35 "A signed 16-bit immediate."
36 (and (match_code "const_int")
37 (match_test "ival >= -32768 && ival <= 32767")))
39 (define_constraint "L"
40 "A valid constant for a movhi instruction."
41 (and (match_code "const_int")
42 (ior (match_test "(ival | 0x7fff0000) == 0x7fff0000")
43 (match_test "(ival | 0x7fff0000) + 0x10000 == 0"))))
45 (define_constraint "M"
46 "An unsigned 16-bit immediate."
47 (and (match_code "const_int")
48 (match_test "ival >= 0 && ival <= 65535")))
50 (define_constraint "N"
51 "An unsigned 5-bit immediate in shift instructions."
52 (and (match_code "const_int")
53 (match_test "ival >= 0 && ival <= 31")))
55 (define_constraint "O"
56 "A signed 9-bit immediate for word multiply instructions."
57 (and (match_code "const_int")
58 (match_test "ival >= -255 && ival <= 255")))
60 (define_constraint "P"
62 (and (match_code "const_int")
65 ;; Floating-point constraints.
66 (define_constraint "G"
67 "A zero of some form."
68 (and (match_code "const_double")
69 (ior (match_test "GET_MODE_CLASS (mode) == MODE_FLOAT")
70 (match_test "GET_MODE_CLASS (mode) == MODE_INT"))
71 (match_test "op == CONST0_RTX (mode)")))
73 (define_constraint "H"
75 (and (match_code "const_double")
78 ;;; Extra constraints.
79 (define_memory_constraint "Q"
80 "A memory address that does not contain a symbol address."
81 (and (match_code "mem")
82 (match_test "ep_memory_operand (op, mode, FALSE)")))
84 (define_constraint "R"
86 (match_test "special_symbolref_operand (op, VOIDmode)"))
88 (define_constraint "S"
90 (and (match_code "symbol_ref")
91 (match_test "!SYMBOL_REF_ZDA_P (op)")))
93 (define_constraint "T"
95 (match_test "ep_memory_operand (op, mode, TRUE)"))
97 (define_constraint "U"
99 (ior (and (match_code "symbol_ref")
100 (match_test "SYMBOL_REF_ZDA_P (op)"))
101 (and (match_code "const")
102 (match_test "GET_CODE (XEXP (op, 0)) == PLUS")
103 (match_test "GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF")
104 (match_test "SYMBOL_REF_ZDA_P (XEXP (XEXP (op, 0), 0))"))))
106 (define_constraint "W"
108 (match_test "disp23_operand (op, VOIDmode)"))