1 ;; Predicate definitions of Andes NDS32 cpu for GNU compiler
2 ;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
3 ;; Contributed by Andes Technology Corporation.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published
9 ;; by the Free Software Foundation; either version 3, or (at your
10 ;; option) any later version.
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 ;; License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3. If not see
19 ;; <http://www.gnu.org/licenses/>.
21 (define_predicate "nds32_equality_comparison_operator"
24 (define_predicate "nds32_greater_less_comparison_operator"
25 (match_code "gt,ge,lt,le"))
27 (define_special_predicate "nds32_logical_binary_operator"
28 (match_code "and,ior,xor"))
30 (define_predicate "nds32_symbolic_operand"
31 (match_code "const,symbol_ref,label_ref"))
33 (define_predicate "nds32_reg_constant_operand"
34 (ior (match_operand 0 "register_operand")
35 (match_operand 0 "const_int_operand")))
37 (define_predicate "nds32_rimm15s_operand"
38 (ior (match_operand 0 "register_operand")
39 (and (match_operand 0 "const_int_operand")
40 (match_test "satisfies_constraint_Is15 (op)"))))
42 (define_predicate "nds32_imm5u_operand"
43 (and (match_operand 0 "const_int_operand")
44 (match_test "satisfies_constraint_Iu05 (op)")))
46 (define_predicate "nds32_move_operand"
47 (and (match_operand 0 "general_operand")
48 (not (match_code "high,const,symbol_ref,label_ref")))
50 /* If the constant op does NOT satisfy Is20 nor Ihig,
51 we can not perform move behavior by a single instruction. */
53 && !satisfies_constraint_Is20 (op)
54 && !satisfies_constraint_Ihig (op))
60 (define_special_predicate "nds32_load_multiple_operation"
61 (match_code "parallel")
63 /* To verify 'load' operation, pass 'true' for the second argument.
64 See the implementation in nds32.c for details. */
65 return nds32_valid_multiple_load_store (op, true);
68 (define_special_predicate "nds32_store_multiple_operation"
69 (match_code "parallel")
71 /* To verify 'store' operation, pass 'false' for the second argument.
72 See the implementation in nds32.c for details. */
73 return nds32_valid_multiple_load_store (op, false);
76 (define_special_predicate "nds32_stack_push_operation"
77 (match_code "parallel")
79 /* To verify 'push' operation, pass 'true' for the second argument.
80 See the implementation in nds32-predicates.c for details. */
81 return nds32_valid_stack_push_pop_p (op, true);
84 (define_special_predicate "nds32_stack_pop_operation"
85 (match_code "parallel")
87 /* To verify 'pop' operation, pass 'false' for the second argument.
88 See the implementation in nds32-predicates.c for details. */
89 return nds32_valid_stack_push_pop_p (op, false);
92 ;; ------------------------------------------------------------------------