vu.h
3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
/*
* File: vu.h
* Creator: hsa@sgi.com
* Create Date: Wed Feb 9 13:40:43 PST 1994
*
* Include file for the vector unit module.
*
*/
#ifndef _rsp_vu_h_
#define _rsp_vu_h_ 1
/*
* The vu pipe depth is really 5. But, the fetch happens
* in the rspctl module, and doesn't get passed to the vu
* until the RD stage, really.
*/
#define rsp_VUPIPEDEPTH 5-1
#define rsp_VUPIPE_STAGE_IF 4
#define rsp_VUPIPE_STAGE_RD 3 /* these are atomic */
#define rsp_VUPIPE_STAGE_EX 3
#define rsp_VUPIPE_STAGE_DF 3
#define rsp_VUPIPE_STAGE_WB 0
typedef struct {
u32 flags;
i16 delay;
boolean stalled;
u32 inst;
u32 pc;
i16 rs;
i16 rt;
i16 rd;
i16 format;
i128 result;
i128 result8[8];
u32 addr; /* used for loads/stores */
char opString[12];
u16 res16;
u16 res16_element;
boolean inhibit_wb;
} rsp_vuPipe_t;
extern int VUZeroPipe;
/* VU registers: */
extern i128 rsp_VUR[32]; /* 64-bit VU GPR */
extern i64 rsp_ACC[8]; /* 48-bit accumulator(s) */
extern u16 rsp_VCO; /* carry in/out */
extern u16 rsp_VCC; /* vector compare code */
extern u8 rsp_VCE; /* control used by double precision vch/vcl*/
#define VU_ACC_MASK ((1LL<<48)-1)
/* tables for fancy element encoding (see sketch): */
extern int cmask_tab[];
extern int emask_tab[];
extern boolean rsp_VUStalled; /* VU pipeline is stalled or not */
extern void rsp_VuInit(int init_regs);
extern boolean rsp_VUIsStalled(void);
extern void rsp_VUExec(u32 inst, u32 pc);
/* register locking for stall support: */
extern void rsp_VURegLock(int reg, u32 pc);
extern void rsp_VURegUnLock(int reg, u32 pc);
extern boolean rsp_VURegIsLocked(int reg, u32 pc);
/* load/store */
extern boolean rsp_VULoadStoreCheckStall(void);
extern void rsp_VULoadInstall(u32 inst, u32 pc);
extern void rsp_VUStoreInstall(u32 inst, u32 pc);
extern boolean rsp_VULoadStorePipeStep(void);
/* cp2 moves */
extern boolean rsp_VUMoveCheckStall(void);
extern void rsp_VUMoveToInstall(u32 inst, u32 pc);
extern void rsp_VUMoveFromInstall(u32 inst, u32 pc);
extern boolean rsp_VUMovePipeStep(void);
/* mult */
extern boolean rsp_VUMultCheckStall(void);
extern void rsp_VUMultInstall(u32 inst, u32 pc);
extern boolean rsp_VUMultPipeStep(void);
/* add */
extern boolean rsp_VUAddCheckStall(void);
extern void rsp_VUAddInstall(u32 inst, u32 pc);
extern boolean rsp_VUAddPipeStep(void);
/* select */
extern boolean rsp_VUSelectCheckStall(void);
extern void rsp_VUSelectInstall(u32 inst, u32 pc);
extern boolean rsp_VUSelectPipeStep(void);
/* add */
extern boolean rsp_VULogicalCheckStall(void);
extern void rsp_VULogicalInstall(u32 inst, u32 pc);
extern boolean rsp_VULogicalPipeStep(void);
/* div */
extern boolean rsp_VUDivCheckStall(void);
extern void rsp_VUDivInstall(u32 inst, u32 pc);
extern boolean rsp_VUDivPipeStep(void);
/* pack */
extern boolean rsp_VUPackCheckStall(void);
extern void rsp_VUPackInstall(u32 inst, u32 pc);
extern boolean rsp_VUPackPipeStep(void);
/*
* Debugging operations.
*/
extern i128 rsp_VURGet(i16 reg);
extern void rsp_VURSet(i16 reg, i128 value);
/*
* Debugging print controls
*/
extern int rsp_VUSpacing;
#endif