]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/m68k/constraints.md
host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public...
[thirdparty/gcc.git] / gcc / config / m68k / constraints.md
CommitLineData
b38bab94
KH
1;; Constraint definitions for m68k
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 it
7;; under the terms of the GNU General Public License as published
2f83c7d6 8;; by the Free Software Foundation; either version 3, or (at your
b38bab94
KH
9;; option) any later version.
10
11;; GCC is distributed in the hope that it will be useful, but WITHOUT
12;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14;; License for more details.
15
16;; You should have received a copy of the GNU General Public License
2f83c7d6
NC
17;; along with GCC; see the file COPYING3. If not see
18;; <http://www.gnu.org/licenses/>.
b38bab94
KH
19
20(define_register_constraint "a" "ADDR_REGS"
21 "Address register.")
22
23(define_register_constraint "d" "DATA_REGS"
24 "Data register.")
25
26(define_register_constraint "f" "TARGET_HARD_FLOAT ? FP_REGS : NO_REGS"
27 "Floating point register.")
28
29(define_constraint "I"
30 "Integer constant in the range 1 @dots 8, for immediate shift counts and addq."
31 (and (match_code "const_int")
32 (match_test "ival > 0 && ival <= 8")))
33
34(define_constraint "J"
35 "Signed 16-bit integer constant."
36 (and (match_code "const_int")
37 (match_test "ival >= -0x8000 && ival <= 0x7fff")))
38
39(define_constraint "K"
40 "Integer constant that moveq can't handle."
41 (and (match_code "const_int")
42 (match_test "ival < -0x80 || ival >= 0x80")))
43
44(define_constraint "L"
45 "Integer constant in the range -8 @dots -1, for subq."
46 (and (match_code "const_int")
47 (match_test "ival < 0 && ival >= -8")))
48
49(define_constraint "M"
50 "Integer constant that moveq+notb can't handle."
51 (and (match_code "const_int")
52 (match_test "ival < -0x100 || ival >= 0x100")))
53
54(define_constraint "N"
55 "Integer constant in the range 24 @dots 31, for rotatert:SI 8 to 1 expressed as rotate."
56 (and (match_code "const_int")
57 (match_test "ival >= 24 && ival <= 31")))
58
59(define_constraint "O"
60 "Integer constant 16, for rotate using swap."
61 (and (match_code "const_int")
62 (match_test "ival == 16")))
63
64(define_constraint "P"
65 "Integer constant in the range 8 @dots 15, for rotatert:HI 8 to 1 expressed as rotate."
66 (and (match_code "const_int")
67 (match_test "ival >= 8 && ival <= 15")))
68
69(define_constraint "R"
70 "Integer constant that mov3q can handle."
71 (and (match_code "const_int")
72 (match_test "valid_mov3q_const (ival)")))
73
74(define_constraint "G"
75 "Defines all of the floating constants that are *NOT* 68881
76 constants. This is so 68881 constants get reloaded and the fpmovecr
77 is used."
78 (and (match_code "const_double")
79 (match_test "!(TARGET_68881 && standard_68881_constant_p (op))")))
80
81(define_constraint "S"
82 "Used for operands that satisfy 'm' when -mpcrel is in effect."
83 (and (match_code "mem")
84 (match_test "TARGET_PCREL
85 && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
86 || GET_CODE (XEXP (op, 0)) == LABEL_REF
87 || GET_CODE (XEXP (op, 0)) == CONST)")))
88
89(define_constraint "T"
90 "Used for operands that satisfy 's' when -mpcrel is not in effect."
91 (and (match_code "symbol_ref,label_ref,const")
92 (match_test "!flag_pic")))
93
94(define_memory_constraint "Q"
95 "Means address register indirect addressing mode."
96 (and (match_code "mem")
97 (match_test "m68k_matches_q_p (op)")))
98
99(define_constraint "U"
100 "Used for register offset addressing."
101 (and (match_code "mem")
102 (match_test "m68k_matches_u_p (op)")))
103
104(define_constraint "W"
105 "Used for const_call_operands."
106 (match_operand 0 "const_call_operand"))