1 /* src/vm/jit/schedule/schedule.h - architecture independent instruction
4 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
5 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
6 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
7 J. Wenninger, Institut f. Computersprachen - TU Wien
9 This file is part of CACAO.
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2, or (at
14 your option) any later version.
16 This program is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 Contact: cacao@cacaojvm.org
28 Authors: Christian Thalinger
40 #include "vm/jit/reg.h"
43 typedef struct scheduledata scheduledata;
44 typedef struct minstruction minstruction;
45 typedef struct edgenode edgenode;
46 typedef struct opcycles opcycles;
49 /* machine instruction flags **************************************************/
51 #define SCHEDULE_LEADER 0x01
52 #define SCHEDULE_SINK 0x02
54 #define SCHEDULE_UNIT_ALU 0x04
55 #define SCHEDULE_UNIT_MEM 0x08
56 #define SCHEDULE_UNIT_BRANCH 0x10
59 #define M_SCHEDULE_SET_EXCEPTION_POINT /* if (jd->exceptiontablelength > 0) { schedule_do_schedule(sd); schedule_reset(sd, rd); } */
68 /* scheduledata ****************************************************************
72 *******************************************************************************/
75 minstruction *mi; /* machine instruction array */
76 s4 micount; /* number of machine instructions */
77 edgenode *leaders; /* list containing leader nodes */
79 edgenode **intregs_define_dep;
80 edgenode **fltregs_define_dep;
81 edgenode **memory_define_dep;
83 edgenode **intregs_use_dep;
84 edgenode **fltregs_use_dep;
85 edgenode **memory_use_dep;
91 /* minstruction ****************************************************************
93 This structure contains all information for one machine instruction
94 required to schedule it.
96 *******************************************************************************/
99 u4 instr[2]; /* machine instruction word */
102 s1 startcycle; /* start pipeline cycle */
103 s1 endcycle; /* end pipeline cycle */
106 s4 priority; /* priority of this instruction node */
108 edgenode *deps; /* operand dependencies */
109 minstruction *next; /* link to next machine instruction */
113 /* edgenode ********************************************************************
117 *******************************************************************************/
119 /* TODO rename to edgenode */
121 s4 minum; /* machine instruction number */
122 s1 opnum; /* dependency operand number */
125 edgenode *next; /* link to next node */
129 /* function prototypes ********************************************************/
131 scheduledata *schedule_init(methodinfo *m, registerdata *rd);
132 void schedule_reset(scheduledata *sd, registerdata *rd);
133 void schedule_close(scheduledata *sd);
135 void schedule_calc_priority(minstruction *mi);
137 /* void schedule_add_define_dep(scheduledata *sd, s1 operand, s4 *define_dep, edgenode **use_dep); */
138 /* void schedule_add_use_dep(scheduledata *sd, s1 operand, s4 *define_dep, edgenode **use_dep); */
139 void schedule_add_define_dep(scheduledata *sd, s1 opnum, edgenode **define_dep, edgenode **use_dep);
140 void schedule_add_use_dep(scheduledata *sd, s1 opnum, edgenode **define_dep, edgenode **use_dep);
142 void schedule_do_schedule(scheduledata *sd);
144 #endif /* _SCHEDULE_H */
148 * These are local overrides for various environment variables in Emacs.
149 * Please do not remove this and leave it at the end of the file, where
150 * Emacs will automagically detect them.
151 * ---------------------------------------------------------------------
154 * indent-tabs-mode: t