1 ;; Predicate definitions for FR30.
2 ;; Copyright (C) 2005-2024 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 3, 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 COPYING3. If not see
18 ;; <http://www.gnu.org/licenses/>.
20 ;; Returns true if OP is an integer value suitable for use in an
23 (define_predicate "stack_add_operand"
24 (match_code "const_int")
27 (GET_CODE (op) == CONST_INT
28 && INTVAL (op) >= -512
30 && ((INTVAL (op) & 3) == 0));
33 ;; Returns true if OP is hard register in the range 8 - 15.
35 (define_predicate "high_register_operand"
44 ;; Returns true if OP is hard register in the range 0 - 7.
46 (define_predicate "low_register_operand"
54 ;; Returns TRUE if OP is a valid operand of a DImode operation.
56 (define_predicate "di_operand"
57 (match_code "const_int,const_double,reg,subreg,mem")
59 if (register_operand (op, mode))
62 if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode)
65 if (GET_CODE (op) == SUBREG)
68 switch (GET_CODE (op))
75 return memory_address_p (DImode, XEXP (op, 0));
82 ;; Returns TRUE if OP is a DImode register or MEM.
84 (define_predicate "nonimmediate_di_operand"
85 (match_code "reg,subreg,mem")
87 if (register_operand (op, mode))
90 if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode)
93 if (GET_CODE (op) == SUBREG)
96 if (GET_CODE (op) == MEM)
97 return memory_address_p (DImode, XEXP (op, 0));
102 ;; Returns true if OP is an integer value suitable for use in an ADD
103 ;; or ADD2 instruction, or if it is a register.
105 (define_predicate "add_immediate_operand"
106 (match_code "reg,const_int")
109 (GET_CODE (op) == REG
110 || (GET_CODE (op) == CONST_INT
111 && INTVAL (op) >= -16
112 && INTVAL (op) <= 15));