xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/microblaze/constraints.md (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1;; Constraint definitions for Xilinx MicroBlaze processors.
2;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
3
4;; Contributed by Michael Eager <eager@eagercon.com>.
5
6;; This file is part of GCC.
7
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)
11;; any later version.
12
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.
17
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/>.
21
22(define_register_constraint "d" "GR_REGS"
23  "A general register.")
24
25(define_register_constraint "z" "ST_REGS"
26  "A status register.")
27
28;; Define integer constraints
29
30(define_constraint "I"
31  "A signed 16-bit constant."
32  (and (match_code "const_int")
33       (match_test "SMALL_OPERAND (ival)")))
34
35(define_constraint "J"
36  "Integer zero."
37  (and (match_code "const_int")
38       (match_test "ival == 0")))
39
40(define_constraint "M"
41  "A constant which needs two instructions to load."
42  (and (match_code "const_int")
43       (match_test "LARGE_OPERAND (ival)")))
44
45(define_constraint "N"
46  "A constant in the range -65535 to -1 (inclusive)."
47  (and (match_code "const_int")
48       (match_test "(unsigned HOST_WIDE_INT) (ival + 0xffff) < 0xffff")))
49
50(define_constraint "P"
51  "A constant in the range 1 to 65535 (inclusive)."
52  (and (match_code "const_int")
53       (match_test "ival > 0 && ival < 0x10000")))
54
55;; Define floating point constraints
56
57(define_constraint "G"
58  "Floating-point zero."
59  (and (match_code "const_double")
60       (match_test "op == CONST0_RTX (mode)")))
61
62;; Define memory constraints
63
64(define_memory_constraint "R"
65  "Memory operand which fits in single instruction."
66  (and (match_code "mem")
67       (match_test "simple_memory_operand (op, GET_MODE (op))")))
68
69(define_memory_constraint "T"
70  "Double word operand."
71  (and (match_code "mem")
72       (match_test "double_memory_operand (op, GET_MODE (op))")))
73
74(define_memory_constraint "Q"
75  "Memory operand which is a single register."
76  (and (match_code "mem")
77       (match_test "GET_CODE ( XEXP (op, 0)) == REG")))
78