brl_w.c
1.19 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
/****************************************************************
WHAT: RSP TEST GENERATOR
SCCS: @(#)brl_w.c 1.1 03 Aug 1994
FILE: brl_w.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_BRL_W_TCS
#define GenCase(tmpl) \
fprintf(outp,tmpl,CurTcNo,ip->name,rA,HHW(OpA),LHW(OpA),rT)
/* Macro for condition true */
PRIVATE char *TemplT =
/* ChkBrlWT( n,Op, rA, OpAH, OpAL, rT); */
"\tChkBrlWT(%2d,%s,r%-2d,0x%4.4X,0x%4.4X,r%-2d)\n";
/* Macro for condition false */
PRIVATE char *TemplF =
/* ChkBrlWF( n,Op, rA, OpAH, OpAL, rT); */
"\tChkBrlWF(%2d,%s,r%-2d,0x%4.4X,0x%4.4X,r%-2d)\n";
int BrlWGen(outp, ip)
FILE *outp;
I_TABLE *ip;
{
int i = 0;
while (1) {
FILE_SPLIT {
if (ip->proc(OpA)) { GenCase(TemplT); }
else { GenCase(TemplF); }
}
if (OpA == 0xFFFFFFFF) break;
else if (OpA & 0x80000000) { OpA = (OpA<<1) | 0x80000001; }
else { OpA = 1 << i; }
UpdRegID(); i++; CurTcNo++;
}
return CurTcNo = 0;
} /* BrlWGen */