xref: /netbsd-src/external/gpl3/gcc/dist/gcc/config/pdp11/predicates.md (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1;;- Predicate definitions for the pdp11 for GNU C compiler
2;; Copyright (C) 1994-2013 Free Software Foundation, Inc.
3;; Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
4
5;; This file is part of GCC.
6
7;; GCC is free software; you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation; either version 3, or (at your option)
10;; any later version.
11
12;; GCC is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15;; GNU General Public License for more details.
16
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/>.
20
21;; Match CONST_DOUBLE zero for tstd/tstf.
22(define_predicate "register_or_const0_operand"
23  (ior (match_operand 0 "register_operand")
24       (match_test "op == CONST0_RTX (GET_MODE (op))")))
25
26;; Accept integer arguments in the range -4..-2 and 2..4, which are the
27;; shift counts for which we unroll a shift.  This matches the rule for
28;; the "O" constraint.
29(define_predicate "expand_shift_operand"
30  (match_code "const_int")
31{
32  int sh;
33
34  sh = INTVAL (op);
35  return (abs (sh) > 1 && abs (sh) <= 4);
36})
37
38;; Accept anything general_operand accepts, except that registers must
39;; be FPU registers.
40(define_predicate "float_operand"
41  (if_then_else (match_code "reg")
42		(ior
43		 (match_test "REGNO_REG_CLASS (REGNO (op)) == LOAD_FPU_REGS")
44		 (match_test "REGNO_REG_CLASS (REGNO (op)) == NO_LOAD_FPU_REGS"))
45		(match_test "general_operand (op, mode)")))
46
47;; Accept anything nonimmediate_operand accepts, except that registers must
48;; be FPU registers.
49(define_predicate "float_nonimm_operand"
50  (if_then_else (match_code "reg")
51		(ior
52		 (match_test "REGNO_REG_CLASS (REGNO (op)) == LOAD_FPU_REGS")
53		 (match_test "REGNO_REG_CLASS (REGNO (op)) == NO_LOAD_FPU_REGS"))
54		(match_test "nonimmediate_operand (op, mode)")))
55