OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [config/] [fr30/] [predicates.md] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
;; Predicate definitions for FR30.
2
;; Copyright (C) 2005 Free Software Foundation, Inc.
3
;;
4
;; This file is part of GCC.
5
;;
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)
9
;; any later version.
10
;;
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.
15
;;
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.
20
 
21
;; Returns true if OP is an integer value suitable for use in an
22
;; ADDSP instruction.
23
 
24
(define_predicate "stack_add_operand"
25
  (match_code "const_int")
26
{
27
  return
28
    (GET_CODE (op) == CONST_INT
29
     && INTVAL (op) >= -512
30
     && INTVAL (op) <=  508
31
     && ((INTVAL (op) & 3) == 0));
32
})
33
 
34
;; Returns true if OP is hard register in the range 8 - 15.
35
 
36
(define_predicate "high_register_operand"
37
  (match_code "reg")
38
{
39
  return
40
    (GET_CODE (op) == REG
41
     && REGNO (op) <= 15
42
     && REGNO (op) >= 8);
43
})
44
 
45
;; Returns true if OP is hard register in the range 0 - 7.
46
 
47
(define_predicate "low_register_operand"
48
  (match_code "reg")
49
{
50
  return
51
    (GET_CODE (op) == REG
52
     && REGNO (op) <= 7);
53
})
54
 
55
;; Returns true if OP is suitable for use in a CALL insn.
56
 
57
(define_predicate "call_operand"
58
  (match_code "mem")
59
{
60
  return (GET_CODE (op) == MEM
61
          && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
62
              || GET_CODE (XEXP (op, 0)) == REG));
63
})
64
 
65
;; Returns TRUE if OP is a valid operand of a DImode operation.
66
 
67
(define_predicate "di_operand"
68
  (match_code "const_int,const_double,reg,mem")
69
{
70
  if (register_operand (op, mode))
71
    return TRUE;
72
 
73
  if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode)
74
    return FALSE;
75
 
76
  if (GET_CODE (op) == SUBREG)
77
    op = SUBREG_REG (op);
78
 
79
  switch (GET_CODE (op))
80
    {
81
    case CONST_DOUBLE:
82
    case CONST_INT:
83
      return TRUE;
84
 
85
    case MEM:
86
      return memory_address_p (DImode, XEXP (op, 0));
87
 
88
    default:
89
      return FALSE;
90
    }
91
})
92
 
93
;; Returns TRUE if OP is a DImode register or MEM.
94
 
95
(define_predicate "nonimmediate_di_operand"
96
  (match_code "reg,mem")
97
{
98
  if (register_operand (op, mode))
99
    return TRUE;
100
 
101
  if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode)
102
    return FALSE;
103
 
104
  if (GET_CODE (op) == SUBREG)
105
    op = SUBREG_REG (op);
106
 
107
  if (GET_CODE (op) == MEM)
108
    return memory_address_p (DImode, XEXP (op, 0));
109
 
110
  return FALSE;
111
})
112
 
113
;; Returns true if OP is an integer value suitable for use in an ADD
114
;; or ADD2 instruction, or if it is a register.
115
 
116
(define_predicate "add_immediate_operand"
117
  (match_code "reg,const_int")
118
{
119
  return
120
    (GET_CODE (op) == REG
121
     || (GET_CODE (op) == CONST_INT
122
         && INTVAL (op) >= -16
123
         && INTVAL (op) <=  15));
124
})

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.