| 1 |
;;- Predicate definitions for the pdp11 for GNU C compiler |
| 2 |
;; Copyright (C) 1994-2025 Free Software Foundation, Inc. |
| 3 |
;; Contributed by Michael K. Gschwind ([email protected]). |
| 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 1..3, 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 |
(and (match_code "const_int") |
| 31 |
(match_test "(unsigned) INTVAL (op) < 4"))) |
| 32 |
|
| 33 |
;; Accept integer arguments +1 and -1, for which add and sub can be |
| 34 |
;; done as inc or dec instructions. This matches the rule for the |
| 35 |
;; L and M constraints. |
| 36 |
(define_predicate "incdec_operand" |
| 37 |
(and (match_code "const_int") |
| 38 |
(ior (match_test "INTVAL (op) == -1") |
| 39 |
(match_test "INTVAL (op) == 1")))) |
| 40 |
|
| 41 |
;; Accept anything general_operand accepts, except that registers must |
| 42 |
;; be FPU registers. |
| 43 |
(define_predicate "float_operand" |
| 44 |
(if_then_else (match_code "reg") |
| 45 |
(ior |
| 46 |
(match_test "REGNO_REG_CLASS (REGNO (op)) == LOAD_FPU_REGS") |
| 47 |
(match_test "REGNO_REG_CLASS (REGNO (op)) == NO_LOAD_FPU_REGS")) |
| 48 |
(match_operand 0 "general_operand"))) |
| 49 |
|
| 50 |
;; Accept anything nonimmediate_operand accepts, except that registers must |
| 51 |
;; be FPU registers. |
| 52 |
(define_predicate "float_nonimm_operand" |
| 53 |
(if_then_else (match_code "reg") |
| 54 |
(ior |
| 55 |
(match_test "REGNO_REG_CLASS (REGNO (op)) == LOAD_FPU_REGS") |
| 56 |
(match_test "REGNO_REG_CLASS (REGNO (op)) == NO_LOAD_FPU_REGS")) |
| 57 |
(match_operand 0 "nonimmediate_operand"))) |
| 58 |
|
| 59 |
;; Accept any comparison valid for CCNZmode |
| 60 |
(define_predicate "ccnz_operator" |
| 61 |
(match_code "eq,ne,ge,lt")) |