3 #define TEST1(instruction, offset, mem) \
6 __asm__ __volatile__( \
7 "move $t0, %1" "\n\t" \
8 "move $t1, %2" "\n\t" \
9 "daddu $t0, $t0, $t1" "\n\t" \
10 "move $t1, $zero" "\n\t" \
11 instruction" $t1, 0($t0)" "\n\t" \
12 "move %0, $t1" "\n\t" \
14 : "r" (mem), "r" (offset) \
17 printf("%s :: offset: 0x%x, out: 0x%" \
18 FMT_REGWORD "x\n", instruction, \
22 #define TEST2(instruction, offset) \
26 __asm__ __volatile__( \
27 "move $t0, %2" "\n\t" \
28 "move $t1, %4" "\n\t" \
29 "daddu $t0, $t0, $t1" "\n\t" \
30 "ld $t3, 0($t0)" "\n\t" \
31 "move $t1, %3" "\n\t" \
32 "move $t2, %4" "\n\t" \
33 "daddu $t1, $t1, $t2" "\n\t" \
34 instruction" $t3, 0($t1)" "\n\t" \
36 "nor $t2, $t2, $zero" "\n\t" \
37 "and $t1, $t1, $t2" "\n\t" \
38 "ld %0, 0($t1)" "\n\t" \
39 "ld %1, 8($t1)" "\n\t" \
40 : "=r" (out), "=r" (outHI) \
41 : "r" (reg_val2) , "r" (reg_val_zero), "r" (offset) \
42 : "t0", "t1", "t2", "t3" \
44 printf("%s :: offset: 0x%x, out: 0x%" FMT_REGWORD "x, " \
45 "outHI: 0x%" FMT_REGWORD "x\n", instruction, \
46 offset, out, outHI); \
49 #define TEST3(instruction, offset, mem) \
52 __asm__ __volatile__( \
53 "move $t0, %1" "\n\t" \
54 "move $t1, %2" "\n\t" \
55 "daddu $t0, $t0, $t1" "\n\t" \
56 "dmtc1 $zero, $f0" "\n\t" \
57 instruction" $f0, 0($t0)" "\n\t" \
58 "dmfc1 %0, $f0" "\n\t" \
60 : "r" (mem) , "r" (offset) \
63 printf("%s :: offset: 0x%x, out: 0x%" \
64 FMT_REGWORD "x\n", instruction, \
68 #define TEST3w(instruction, offset, mem) \
70 unsigned int out = 0; \
71 __asm__ __volatile__( \
72 "move $t0, %1" "\n\t" \
73 "move $t1, %2" "\n\t" \
74 "daddu $t0, $t0, $t1" "\n\t" \
75 "dmtc1 $zero, $f0" "\n\t" \
76 instruction" $f0, 0($t0)" "\n\t" \
77 "mfc1 %0, $f0" "\n\t" \
79 : "r" (mem) , "r" (offset) \
82 printf("%s :: offset: 0x%x, out: 0x%x\n", \
83 instruction, offset, out); \
86 #define TEST4(instruction, offset) \
89 __asm__ __volatile__( \
90 "move $t0, %1" "\n\t" \
91 "move $t1, %3" "\n\t" \
92 "daddu $t0, $t0, $t1" "\n\t" \
93 "ld $t2, 0($t0)" "\n\t" \
94 "move $t0, %2" "\n\t" \
95 "daddu $t0, $t0, $t1" "\n\t" \
96 "dmtc1 $t2, $f0" "\n\t" \
97 instruction" $f0, 0($t0)" "\n\t" \
98 "ld %0, 0($t0)" "\n\t" \
100 : "r" (reg_val1) , "r" (reg_val_zero), "r" (offset) \
101 : "t0", "t1", "t2", "$f0" \
103 printf("%s :: offset: 0x%x, out: 0x%" FMT_REGWORD "x\n",\
104 instruction, offset, out); \
107 #define TEST5(instruction, offset, mem) \
110 __asm__ __volatile__( \
111 "move $t0, %1" "\n\t" \
112 "move $t1, %2" "\n\t" \
113 "dmtc1 $zero, $f0" "\n\t" \
114 instruction" $f0, $t1($t0)" "\n\t" \
115 "dmfc1 %0, $f0" "\n\t" \
117 : "r" (mem) , "r" (offset) \
118 : "t0", "t1", "$f0" \
120 printf("%s :: offset: 0x%x, out: 0x%" \
121 FMT_REGWORD "x\n", instruction, \
125 #define TEST5w(instruction, offset, mem) \
127 unsigned int out = 0; \
128 __asm__ __volatile__( \
129 "move $t0, %1" "\n\t" \
130 "move $t1, %2" "\n\t" \
131 "dmtc1 $zero, $f0" "\n\t" \
132 instruction" $f0, $t1($t0)" "\n\t" \
133 "mfc1 %0, $f0" "\n\t" \
135 : "r" (mem) , "r" (offset) \
136 : "t0", "t1", "$f0" \
138 printf("%s :: offset: 0x%x, out: 0x%x\n", \
139 instruction, offset, out); \
142 #define TEST6(instruction, offset) \
145 __asm__ __volatile__( \
146 "move $t0, %1" "\n\t" \
147 "move $t1, %3" "\n\t" \
148 "daddu $t0, $t0, $t1" "\n\t" \
149 "ld $t3, 0($t0)" "\n\t" \
150 "move $t1, %2" "\n\t" \
151 "move $t2, %3" "\n\t" \
152 "daddu $t1, $t1, $t2" "\n\t" \
153 "dmtc1 $t3, $f3" "\n\t" \
154 "move $t0, %3" "\n\t" \
155 instruction" $f3, $t0($t1)" "\n\t" \
156 "ld %0, 0($t1)" "\n\t" \
158 : "r" (reg_val2) , "r" (reg_val_zero), "r" (offset) \
159 : "t0", "t1", "t2", "t3" \
161 printf("%s :: offset: 0x%x, out: 0x%" FMT_REGWORD "x\n",\
162 instruction, offset, out); \