1 ;; Constraint definitions for m68k
2 ;; Copyright (C) 2007 Free Software Foundation, Inc.
4 ;; This file is part of GCC.
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
8 ;; by the Free Software Foundation; either version 2, or (at your
9 ;; option) any later version.
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.
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.
21 (define_register_constraint "a" "ADDR_REGS"
24 (define_register_constraint "d" "DATA_REGS"
27 (define_register_constraint "f" "TARGET_HARD_FLOAT ? FP_REGS : NO_REGS"
28 "Floating point register.")
30 (define_constraint "I"
31 "Integer constant in the range 1 @dots 8, for immediate shift counts and addq."
32 (and (match_code "const_int")
33 (match_test "ival > 0 && ival <= 8")))
35 (define_constraint "J"
36 "Signed 16-bit integer constant."
37 (and (match_code "const_int")
38 (match_test "ival >= -0x8000 && ival <= 0x7fff")))
40 (define_constraint "K"
41 "Integer constant that moveq can't handle."
42 (and (match_code "const_int")
43 (match_test "ival < -0x80 || ival >= 0x80")))
45 (define_constraint "L"
46 "Integer constant in the range -8 @dots -1, for subq."
47 (and (match_code "const_int")
48 (match_test "ival < 0 && ival >= -8")))
50 (define_constraint "M"
51 "Integer constant that moveq+notb can't handle."
52 (and (match_code "const_int")
53 (match_test "ival < -0x100 || ival >= 0x100")))
55 (define_constraint "N"
56 "Integer constant in the range 24 @dots 31, for rotatert:SI 8 to 1 expressed as rotate."
57 (and (match_code "const_int")
58 (match_test "ival >= 24 && ival <= 31")))
60 (define_constraint "O"
61 "Integer constant 16, for rotate using swap."
62 (and (match_code "const_int")
63 (match_test "ival == 16")))
65 (define_constraint "P"
66 "Integer constant in the range 8 @dots 15, for rotatert:HI 8 to 1 expressed as rotate."
67 (and (match_code "const_int")
68 (match_test "ival >= 8 && ival <= 15")))
70 (define_constraint "R"
71 "Integer constant that mov3q can handle."
72 (and (match_code "const_int")
73 (match_test "valid_mov3q_const (ival)")))
75 (define_constraint "G"
76 "Defines all of the floating constants that are *NOT* 68881
77 constants. This is so 68881 constants get reloaded and the fpmovecr
79 (and (match_code "const_double")
80 (match_test "!(TARGET_68881 && standard_68881_constant_p (op))")))
82 (define_constraint "S"
83 "Used for operands that satisfy 'm' when -mpcrel is in effect."
84 (and (match_code "mem")
85 (match_test "TARGET_PCREL
86 && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
87 || GET_CODE (XEXP (op, 0)) == LABEL_REF
88 || GET_CODE (XEXP (op, 0)) == CONST)")))
90 (define_constraint "T"
91 "Used for operands that satisfy 's' when -mpcrel is not in effect."
92 (and (match_code "symbol_ref,label_ref,const")
93 (match_test "!flag_pic")))
95 (define_memory_constraint "Q"
96 "Means address register indirect addressing mode."
97 (and (match_code "mem")
98 (match_test "m68k_matches_q_p (op)")))
100 (define_constraint "U"
101 "Used for register offset addressing."
102 (and (match_code "mem")
103 (match_test "m68k_matches_u_p (op)")))
105 (define_constraint "W"
106 "Used for const_call_operands."
107 (match_operand 0 "const_call_operand"))