rsp_regr_su_alu.c
3.47 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
#include <sys/types.h>
#ifdef __sgi__
#include <sys/sbd.h>
#endif
#include <sys/stat.h>
#include <sys/mman.h>
#ifdef __sgi__
#include <sys/sema.h>
#endif
#include <netinet/in.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <getopt.h>
#include <rcp.h>
#include <rsp.h>
/* From $ROOT/usr/include/ide, which is installed from PR/diags/include */
#include "diag.h"
#include "dbg_comm.h"
#define RSP_TEST_BASE 001
static int NumFailures = 0;
/* From rsp_regr_common.c: */
extern int generic_rsp_regression (const char *file_name);
extern void imem_init(FILE *file_p);
extern int rsp_regrInit();
extern int rsp_regrDo(TEST_REF *test_ref);
extern int rsp_regr(TEST_REF TestRefs[]);
int add1();
int add2();
int addi1();
int addi2();
int addiu1();
int addiu2();
int addu1();
int addu2();
int slt1();
int slt2();
int slti1();
int slti2();
int sltiu1();
int sltiu2();
int sltu1();
int sltu2();
int sub1();
int sub2();
int subu1();
int subu2();
/*
* An array of tests, each of which corresponds to a separate menu
* item callable from the master ide menu.
*/
static TEST_REF TestRefs[] = {
{"add1", RSP_TEST_BASE+0, add1},
{"add2", RSP_TEST_BASE+1, add2},
{"addi1", RSP_TEST_BASE+2, addi1},
{"addi2", RSP_TEST_BASE+3, addi2},
{"addiu1", RSP_TEST_BASE+4, addiu1},
{"addiu2", RSP_TEST_BASE+5, addiu2},
{"addu1", RSP_TEST_BASE+6, addu1},
{"addu2", RSP_TEST_BASE+7, addu2},
{"slt1", RSP_TEST_BASE+8, slt1},
{"slt2", RSP_TEST_BASE+9, slt2},
{"slti1", RSP_TEST_BASE+10, slti1},
{"slti2", RSP_TEST_BASE+11, slti2},
{"sltiu1", RSP_TEST_BASE+12, sltiu1},
{"sltiu2", RSP_TEST_BASE+13, sltiu2},
{"sltu1", RSP_TEST_BASE+14, sltu1},
{"sltu2", RSP_TEST_BASE+15, sltu2},
{"sub1", RSP_TEST_BASE+16, sub1},
{"sub2", RSP_TEST_BASE+17, sub2},
{"subu1", RSP_TEST_BASE+18, subu1},
{"subu2", RSP_TEST_BASE+19, subu2},
{"",0,0}
};
static int failed_tests[512];
/*
* diagnostic entry point:
*
* Each separately invokable ide diagnostic command corresponds to an
* independent ".c" module; the entry point herein must match
* the test name as specified in the rspcmd.awk script. These command
* names correspond to the names you see from the ide menu. For this
* module, there will be an ide command "rsp_regr".
*/
int rsp_regr_su_alu(void) {rsp_regr(TestRefs);}
/*
* Tests
*/
int add1() {return generic_rsp_regression("tests/add1");}
int add2() {return generic_rsp_regression("tests/add2");}
int addi1() {return generic_rsp_regression("tests/addi1");}
int addi2() {return generic_rsp_regression("tests/addi2");}
int addiu1() {return generic_rsp_regression("tests/addiu1");}
int addiu2() {return generic_rsp_regression("tests/addiu2");}
int addu1() {return generic_rsp_regression("tests/addu1");}
int addu2() {return generic_rsp_regression("tests/addu2");}
int slt1() {return generic_rsp_regression("tests/slt1");}
int slt2() {return generic_rsp_regression("tests/slt2");}
int slti1() {return generic_rsp_regression("tests/slti1");}
int slti2() {return generic_rsp_regression("tests/slti2");}
int sltiu1() {return generic_rsp_regression("tests/sltiu1");}
int sltiu2() {return generic_rsp_regression("tests/sltiu2");}
int sltu1() {return generic_rsp_regression("tests/sltu1");}
int sltu2() {return generic_rsp_regression("tests/sltu2");}
int sub1() {return generic_rsp_regression("tests/sub1");}
int sub2() {return generic_rsp_regression("tests/sub2");}
int subu1() {return generic_rsp_regression("tests/subu1");}
int subu2() {return generic_rsp_regression("tests/subu2");}