OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [config/] [or32/] [predicates.md] - Blame information for rev 399

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 282 jeremybenn
;; Predicate definitions for OR32
2 399 jeremybenn
;;
3
;; Copyright (C) 2010 Embecosm Limited
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
;; .
20 282 jeremybenn
 
21
(define_predicate "cc_reg_operand"
22
  (match_code "subreg,reg")
23
{
24
  register_operand (op, mode);
25
 
26 399 jeremybenn
  if (GET_CODE (op) == REG && REGNO (op) == CC_REG)
27 282 jeremybenn
    return 1;
28
 
29
  return 0;
30
})
31
 
32
(define_predicate "sibcall_insn_operand"
33
  (match_code "subreg,reg,symbol_ref")
34
{
35
  /* Disallow indirect through a virtual register.  This leads to
36
     compiler aborts when trying to eliminate them.  */
37
  if (GET_CODE (op) == REG
38
      && (op == arg_pointer_rtx
39
          || op == frame_pointer_rtx
40
          || (REGNO (op) >= FIRST_PSEUDO_REGISTER
41
              && REGNO (op) <= LAST_VIRTUAL_REGISTER)))
42
    {
43
 
44
      fprintf (stderr, "0\n");
45
      return 0;
46
    }
47
 
48
  /* Explicitly allow SYMBOL_REF even if pic.  */
49
  if (GET_CODE (op) == SYMBOL_REF)
50
    return 1;
51
 
52
  /* Otherwise we can only allow register operands.  */
53
  return register_operand (op, Pmode);
54
})
55
 
56
(define_predicate "input_operand"
57
  (match_code "subreg,reg,const_int,mem,const")
58
{
59
  /* If both modes are non-void they must be the same.  */
60
  if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op))
61
    return 0;
62
 
63
  /* Allow any one instruction integer constant, and all CONST_INT
64
     variants when we are working in DImode and !arch64.  */
65
  if (GET_MODE_CLASS (mode) == MODE_INT
66
      && ((GET_CODE (op) == CONST_INT)
67 399 jeremybenn
          && (satisfies_constraint_K (op)
68
              || satisfies_constraint_M (op)
69
              || satisfies_constraint_I (op))))
70 282 jeremybenn
    return 1;
71
 
72
  if (register_operand (op, mode))
73
    return 1;
74
 
75
  /* If this is a SUBREG, look inside so that we handle
76
     paradoxical ones.  */
77
  if (GET_CODE (op) == SUBREG)
78
    op = SUBREG_REG (op);
79
 
80
 
81
  /* Check for valid MEM forms.  */
82
  if (GET_CODE (op) == MEM)
83
    return memory_address_p (mode, XEXP (op, 0));
84
 
85
  return 0;
86
})
87
 
88
(define_predicate "sym_ref_mem_operand"
89
  (match_code "mem")
90
{
91
  if (GET_CODE (op) == MEM)
92
    {
93
      rtx t1 = XEXP (op, 0);
94
      if (GET_CODE (t1) == SYMBOL_REF)
95
        return 1;
96
    }
97
  return 0;
98
})

powered by: WebSVN 2.1.0

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