br_ww.c
1.98 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
/****************************************************************
WHAT: RSP TEST GENERATOR
SCCS: @(#)br_ww.c 1.1 03 Aug 1994
FILE: br_ww.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_BR_WW_TCS
#define GenCase(tmpl) \
fprintf(outp,tmpl,CurTcNo,ip->name,rA,rB, \
HHW(OpA),LHW(OpA),HHW(OpB),LHW(OpB),rT);
PRIVATE char *TemplT =
/* ChkBrWWT( n,Op, rA, rB, OpAH, OpAL, OpBH, OpBL, rT); */
"\tChkBrWWT(%2d,%s,r%-2d,r%-2d,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,r%-2d)\n";
PRIVATE char *TemplF =
/* ChkBrWWF( n,Op, rA, rB, OpAH, OpAL, OpBH, OpBL, rT); */
"\tChkBrWWF(%2d,%s,r%-2d,r%-2d,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,r%-2d)\n";
int BrWWGen(outp, ip)
FILE *outp;
I_TABLE *ip;
{
int i = 0;
FILE_SPLIT { /* default case - both operands zero */
if (ip->proc(OpA,OpB)) { GenCase(TemplT); }
else { GenCase(TemplF); }
}
CurTcNo++;
OpA = 2;
OpB = 2;
do {
FILE_SPLIT {
if (ip->proc(OpA,OpB)) { GenCase(TemplT); }
else { GenCase(TemplF); }
}
switch (i++&3) {
case 0: OpA <<= 2; break;
case 1: OpB <<= 2; break;
case 2: OpB <<= 2; break;
case 3: OpA <<= 2; break;
}
UpdRegID();
} while (CurTcNo++, OpA <= 0x40000000 && OpB <= 0x40000000);
i = 0;
OpA = 3;
OpB = 3;
do {
FILE_SPLIT {
if (ip->proc(OpA,OpB)) { GenCase(TemplT); }
else { GenCase(TemplF); }
}
switch (i++&3) {
case 0: OpA <<= 2; OpA |= 0x80000003; break;
case 1: OpB <<= 2; OpB |= 0x80000003; break;
case 2: OpB <<= 2; OpB |= 0x80000003; break;
case 3: OpA <<= 2; OpA |= 0x80000003; break;
}
UpdRegID();
} while (CurTcNo++, (OpA & OpB) != 0xFFFFFFFF);
FILE_SPLIT {
if (ip->proc(OpA,OpB)) { GenCase(TemplT); }
else { GenCase(TemplF); }
}
return CurTcNo = 0;
} /* BrWWGen */