Debian Codegraph @

arch/sparc64/order.c

raw symbols SCIP
1 /* $Id: order.c,v 1.7 2011/06/05 08:54:42 plunky Exp $ */
2
3 /*
4 * Copyright (c) 2008 David Crawshaw <[email protected]>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #include "pass2.h"
20
21 /* is it legal to make an OREG or NAME entry which has an
22 * offset of off, (from a register of r), if the
23 * resulting thing had type t */
24 int
25 notoff(TWORD t, int r, CONSZ off, char *cp)
26 {
27 return !SIMM13(off);
28 }
29
30 /*
31 * Turn a UMUL-referenced node into OREG.
32 */
33 void
34 offstar(NODE *p, int shape)
35 {
36 if (x2debug)
37 printf("offstar(%p)\n", p);
38
39 if (p->n_op == PLUS || p->n_op == MINUS) {
40 if (p->n_right->n_op == ICON && SIMM13(p->n_right->n_lval)) {
41 if (isreg(p->n_left) == 0)
42 (void)geninsn(p->n_left, INAREG);
43 /* Converted in ormake() */
44 return;
45 }
46 }
47 (void)geninsn(p, INAREG);
48 }
49
50 void
51 myormake(NODE *q)
52 {
53 }
54
55 int
56 shumul(NODE *p, int shape)
57 {
58 if (shape & SOREG)
59 return SROREG;
60 return SRNOPE;
61 }
62
63 int
64 setbin(NODE *p)
65 {
66 return 0;
67 }
68
69 int
70 setasg(NODE *p, int cookie)
71 {
72 return 0;
73 }
74
75 int
76 setuni(NODE *p, int cookie)
77 {
78 return 0;
79 }
80
81 struct rspecial *
82 nspecial(struct optab *q)
83 {
84 switch (q->op) {
85 case STASG: {
86 static struct rspecial s[] = {
87 { NEVER, O0 },
88 { NRIGHT, O1 },
89 { NEVER, O2 },
90 { 0 }
91 };
92 return s;
93 }
94 }
95
96 comperr("unknown nspecial %d: %s", q - table, q->cstring);
97 return 0; /* XXX */
98 }
99
100 int
101 setorder(NODE *p)
102 {
103 return 0;
104 }
105
106 int *
107 livecall(NODE *p)
108 {
109 static int ret[] = { O0, O1, O2, O3, O4, O5, O6, O7, -1 };
110 return ret;
111 }
112
113 int
114 acceptable(struct optab *op)
115 {
116 return 1;
117 }