source: mainline/uspace/app/pcc/arch/sparc64/order.c@ 423e5e87

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 423e5e87 was a7de7182, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 14 years ago

Added pcc source tree (contents of pcc-1.0.0.tgz)

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