]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/mn10300/constraints.md
genrecog.c: Include regs.h in generated file.
[thirdparty/gcc.git] / gcc / config / mn10300 / constraints.md
1 ;; Constraint definitions for the MN10300.
2 ;; Copyright (C) 2007 Free Software Foundation, Inc.
3 ;;
4 ;; This file is part of GCC.
5 ;;
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 2, or (at your option)
9 ;; any later version.
10 ;;
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.
15 ;;
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GCC; see the file COPYING. If not, write to
18 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19 ;; Boston, MA 02110-1301, USA.
20
21 (define_register_constraint "d" "DATA_REGS"
22 "A data register.")
23
24 (define_register_constraint "a" "ADDRESS_REGS"
25 "An address register.")
26
27 (define_register_constraint "y" "SP_REGS"
28 "An SP register (if available).")
29
30 (define_register_constraint "x" "TARGET_AM33 ? EXTENDED_REGS : NO_REGS"
31 "An extended register.")
32
33 (define_register_constraint "f" "TARGET_AM33_2 ? FP_REGS : NO_REGS"
34 "A floating point register.")
35
36 (define_register_constraint "A" "TARGET_AM33_2 ? FP_ACC_REGS : NO_REGS"
37 "A floating point accumulator register.")
38
39 (define_memory_constraint "Q"
40 "@internal"
41 (and (match_code "mem")
42 (match_test "!CONSTANT_ADDRESS_P (XEXP (op, 0))")))
43
44 (define_memory_constraint "R"
45 "@internal"
46 (and (match_code "mem")
47 (match_test "mode == QImode")
48 (ior (match_test "CONSTANT_ADDRESS_P (XEXP (op, 0))")
49 (and (match_test "GET_CODE (XEXP (op, 0)) == REG")
50 (match_test "REG_OK_FOR_BIT_BASE_P (XEXP (op, 0))")
51 (match_test "XEXP (op, 0) != stack_pointer_rtx"))
52 (and (match_test "GET_CODE (XEXP (op, 0)) == PLUS")
53 (match_test "GET_CODE (XEXP (XEXP (op, 0), 0)) == REG")
54 (match_test "REG_OK_FOR_BIT_BASE_P (XEXP (XEXP (op, 0), 0))")
55 (match_test "XEXP (XEXP (op, 0), 0) != stack_pointer_rtx")
56 (match_test "GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT")
57 (match_test "INT_8_BITS (INTVAL (XEXP (XEXP (op, 0), 1)))")))))
58
59 (define_memory_constraint "T"
60 "@internal"
61 (and (match_code "mem")
62 (match_test "mode == QImode")
63 (and (match_test "GET_CODE (XEXP (op, 0)) == REG")
64 (match_test "REG_OK_FOR_BIT_BASE_P (XEXP (op, 0))")
65 (match_test "XEXP (op, 0) != stack_pointer_rtx"))))
66
67 (define_constraint "S"
68 "@internal"
69 (if_then_else (match_test "flag_pic")
70 (and (match_test "GET_CODE (op) == UNSPEC")
71 (ior (match_test "XINT (op, 1) == UNSPEC_PLT")
72 (match_test "XINT (op, 1) == UNSPEC_PIC")))
73 (match_test "GET_CODE (op) == SYMBOL_REF")))
74
75 ;; Integer constraints
76
77 (define_constraint "I"
78 "An integer zero."
79 (and (match_code "const_int")
80 (match_test "ival == 0")))
81
82 (define_constraint "J"
83 "An integer one."
84 (and (match_code "const_int")
85 (match_test "ival == 1")))
86
87 (define_constraint "K"
88 "An integer two."
89 (and (match_code "const_int")
90 (match_test "ival == 2")))
91
92 (define_constraint "L"
93 "An integer four."
94 (and (match_code "const_int")
95 (match_test "ival == 4")))
96
97 (define_constraint "M"
98 "An integer three."
99 (and (match_code "const_int")
100 (match_test "ival == 3")))
101
102 (define_constraint "N"
103 "An integer of either 255 or 65535."
104 (and (match_code "const_int")
105 (ior (match_test "ival == 255")
106 (match_test "ival == 65535"))))
107
108 ;; Floating-point constraints
109 (define_constraint "G"
110 "Floating-point zero."
111 (and (match_code "const_double")
112 (match_test "op == CONST0_RTX (mode)")))