1 ;; Constraint definitions for the MN10300.
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
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)
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 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 "d" "DATA_REGS"
24 (define_register_constraint "a" "ADDRESS_REGS"
25 "An address register.")
27 (define_register_constraint "y" "SP_REGS"
28 "An SP register (if available).")
30 (define_register_constraint "x" "TARGET_AM33 ? EXTENDED_REGS : NO_REGS"
31 "An extended register.")
33 (define_register_constraint "f" "TARGET_AM33_2 ? FP_REGS : NO_REGS"
34 "A floating point register.")
36 (define_register_constraint "A" "TARGET_AM33_2 ? FP_ACC_REGS : NO_REGS"
37 "A floating point accumulator register.")
39 (define_memory_constraint "Q"
41 (and (match_code "mem")
42 (match_test "!CONSTANT_ADDRESS_P (XEXP (op, 0))")))
44 (define_memory_constraint "R"
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)))")))))
59 (define_memory_constraint "T"
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"))))
67 (define_constraint "S"
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")))
75 ;; Integer constraints
77 (define_constraint "I"
79 (and (match_code "const_int")
80 (match_test "ival == 0")))
82 (define_constraint "J"
84 (and (match_code "const_int")
85 (match_test "ival == 1")))
87 (define_constraint "K"
89 (and (match_code "const_int")
90 (match_test "ival == 2")))
92 (define_constraint "L"
94 (and (match_code "const_int")
95 (match_test "ival == 4")))
97 (define_constraint "M"
99 (and (match_code "const_int")
100 (match_test "ival == 3")))
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"))))
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)")))