alu_wi.c
1.15 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
/****************************************************************
WHAT: RSP SCALAR UNIT TEST GENERATOR FOR ALU_WWI FORMAT
SCCS: @(#)alu_wi.c 1.1 03 Aug 1994
FILE: lui.c
WHO: Project Reality - Evan Y. Wang
(C): 1994 Silicon Graphics, Inc.
****************************************************************/
#include <stdio.h>
#include "software.h"
#include "gen.h"
#include "suregre.h"
#define MAX_TCS MAX_ALU_WI_TCS
#define GenCase() \
fprintf(outp,Templ,CurTcNo,ip->name,rR, \
HHW(Reg[rR]),LHW(Reg[rR]),HHW(Imm),rT)
PRIVATE char *Templ =
/* ChkAluWI( n,Op, rR, RValH, RValL, Imm, rT); */
"\tChkAluWI(%2d,%s,r%-2d,0x%4.4X,0x%4.4X,0x%4.4X,r%-2d)\n";
PRIVATE int LuiWI(outp, ip)
FILE *outp;
I_TABLE *ip;
{
for (CntI=0; CntI<16; CntI++, CurTcNo++) {
Imm = 0x00010000 << CntI;
FILE_SPLIT {
Res = Imm;
GenCase();
UpdRegTR();
}
UpdRegID();
}
return 0;
} /* LuiWI */
int AluWIGen(outp, ip)
FILE *outp;
I_TABLE *ip;
{
switch (ip->vec) {
case LUI_VEC: return LuiWI(outp,ip); break;
default: fprintf(stderr,
"ERROR: AluWIGen\n"); break;
}
} /* AluWIGen */