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
32 $Id: schedule.h 5785 2006-10-15 22:25:54Z edwin $
42 #include "vm/jit/reg.h"
45 typedef struct scheduledata scheduledata;
46 typedef struct minstruction minstruction;
47 typedef struct edgenode edgenode;
48 typedef struct opcycles opcycles;
51 /* machine instruction flags **************************************************/
53 #define SCHEDULE_LEADER 0x01
54 #define SCHEDULE_SINK 0x02
56 #define SCHEDULE_UNIT_ALU 0x04
57 #define SCHEDULE_UNIT_MEM 0x08
58 #define SCHEDULE_UNIT_BRANCH 0x10
61 #define M_SCHEDULE_SET_EXCEPTION_POINT /* if (jd->exceptiontablelength > 0) { schedule_do_schedule(sd); schedule_reset(sd, rd); } */
70 /* scheduledata ****************************************************************
74 *******************************************************************************/
77 minstruction *mi; /* machine instruction array */
78 s4 micount; /* number of machine instructions */
79 edgenode *leaders; /* list containing leader nodes */
81 edgenode **intregs_define_dep;
82 edgenode **fltregs_define_dep;
83 edgenode **memory_define_dep;
85 edgenode **intregs_use_dep;
86 edgenode **fltregs_use_dep;
87 edgenode **memory_use_dep;
93 /* minstruction ****************************************************************
95 This structure contains all information for one machine instruction
96 required to schedule it.
98 *******************************************************************************/
100 struct minstruction {
101 u4 instr[2]; /* machine instruction word */
104 s1 startcycle; /* start pipeline cycle */
105 s1 endcycle; /* end pipeline cycle */
108 s4 priority; /* priority of this instruction node */
110 edgenode *deps; /* operand dependencies */
111 minstruction *next; /* link to next machine instruction */
115 /* edgenode ********************************************************************
119 *******************************************************************************/
121 /* TODO rename to edgenode */
123 s4 minum; /* machine instruction number */
124 s1 opnum; /* dependency operand number */
127 edgenode *next; /* link to next node */
131 /* function prototypes ********************************************************/
133 scheduledata *schedule_init(methodinfo *m, registerdata *rd);
134 void schedule_reset(scheduledata *sd, registerdata *rd);
135 void schedule_close(scheduledata *sd);
137 void schedule_calc_priority(minstruction *mi);
139 /* void schedule_add_define_dep(scheduledata *sd, s1 operand, s4 *define_dep, edgenode **use_dep); */
140 /* void schedule_add_use_dep(scheduledata *sd, s1 operand, s4 *define_dep, edgenode **use_dep); */
141 void schedule_add_define_dep(scheduledata *sd, s1 opnum, edgenode **define_dep, edgenode **use_dep);
142 void schedule_add_use_dep(scheduledata *sd, s1 opnum, edgenode **define_dep, edgenode **use_dep);
144 void schedule_do_schedule(scheduledata *sd);
146 #endif /* _SCHEDULE_H */
150 * These are local overrides for various environment variables in Emacs.
151 * Please do not remove this and leave it at the end of the file, where
152 * Emacs will automagically detect them.
153 * ---------------------------------------------------------------------
156 * indent-tabs-mode: t