cc2.c
1.65 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
/****************************************************************
WHAT: RSP SCALAR UNIT TEST GENERATOR FOR CC2 FORMAT
SCCS: %W% %G%
PTLS: $Id: cc2.c,v 1.1.1.1 2002/10/29 08:07:09 blythe Exp $
FILE: cc2 - To and from control register of coprocessor 2
ENGR: Evan Y. Wang
PROJ: Project Reality
(CR): 1994 Silicon Graphics, Inc.
****************************************************************/
#include <stdio.h>
#include "software.h"
#include "gen.h"
#include "suregre.h"
#define MAX_TCS MAX_CC2_TCS
#define GenCase() \
fprintf(outp,Templ,CurTcNo,ip->name, \
rA, rB, rR, rT, vT, \
HHW(OpA), LHW(OpA), HHW(OpB), LHW(OpB), \
HHW(Res), LHW(Res), HHW(Imm), LHW(Imm))
PRIVATE char *Templ =
/* ChkCc2( n,Op, rA, rB, rR, rT, vT, AH, AL, BH, BL, RH, RL, TH, TL); */
"\tChkCc2(%2d,%s,r%-2d,r%-2d,r%-2d,r%-2d,v%d,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X,0x%4.4X)\n";
int Cc2Gen(outp, ip)
FILE *outp; /* output file handle */
I_TABLE *ip; /* instruction table entry ptr */
{
int i;
/* Test VCO */
vT = 0;
for (i=0; i<32; i++) {
OpA = (4<<i) | (2<<(i&0xF)) | (1<<(i&7));
OpB = (0x80000000>>i) | (0x10000>>(i&0xF)) | (0x80>>(i&7));
FILE_SPLIT {
Res = ip->proc(OpA,OpB,vT);
GenCase();
UpdRegTABR();
}
CurTcNo++;
UpdRegID();
}
/* Test VCC */
vT = 1;
for (i=0; i<32; i++) {
OpA = (4<<i) | (2<<(i&0xF)) | (1<<(i&7));
OpB = (0x80000000>>i) | (0x10000>>(i&0xF)) | (0x80>>(i&7));
FILE_SPLIT {
Res = ip->proc(OpA,OpB,vT);
GenCase();
UpdRegTABR();
}
CurTcNo++;
UpdRegID();
}
return 0;
} /* Cc2Gen */