1 #include <stdio.h> 2 3 const float fs_f[] = { 4 0, 456.2489562, 3, -1, 5 1384.6, -7.2945676, 1000000000, -5786.47, 6 1752, 0.0024575, 0.00000001, -248562.76, 7 -45786.476, 456.2489562, 34.00046, 45786.476, 8 1752065, 107, -45667.24, -7.2945676, 9 -347856.475, 356047.56, -1.0, 23.04 10 }; 11 12 unsigned int mem[] = { 13 0x4095A266, 0x66666666, 14 0xBFF00000, 0x00000000, 15 0x3FF00000, 0x00000000, 16 0x252a2e2b, 0x262d2d2a, 17 0xFFFFFFFF, 0xFFFFFFFF, 18 0x41D26580, 0xB487E5C9, 19 0x42026580, 0xB750E388, 20 0x3E45798E, 0xE2308C3A, 21 0x3FBF9ADD, 0x3746F65F 22 }; 23 24 // mfc1 rt, fs 25 #define TESTINSNMOVE(instruction, offset, FS, RT) \ 26 { \ 27 float out; \ 28 int out1; \ 29 __asm__ volatile( \ 30 "move $t0, %2\n\t" \ 31 "lwc1 $" #FS ", "#offset"($t0)\n\t" \ 32 instruction "\n\t" \ 33 "mov.s %0, $" #FS"\n\t" \ 34 "move %1, $" #RT "\n\t" \ 35 : "=&f" (out), "=&r" (out1) \ 36 : "r" (mem) \ 37 : #RT, "cc", "memory" \ 38 ); \ 39 printf("%s :: fs %f, rt 0x%x\n", \ 40 instruction, out, out1); \ 41 } 42 43 // mfhc1 rt, fs 44 #define TESTINSNMOVEd(instruction, offset, FS, RT) \ 45 { \ 46 double out; \ 47 int out1; \ 48 __asm__ volatile( \ 49 "move $t0, %2\n\t" \ 50 "ldc1 $" #FS ", "#offset"($t0)\n\t" \ 51 instruction "\n\t" \ 52 "mov.d %0, $" #FS"\n\t" \ 53 "move %1, $" #RT "\n\t" \ 54 : "=&f" (out), "=&r" (out1) \ 55 : "r" (mem) \ 56 : #RT, "cc", "memory" \ 57 ); \ 58 printf("%s :: fs %lf, rt 0x%x\n", \ 59 instruction, out, out1); \ 60 } 61 62 // mtc1 rt, fs 63 #define TESTINSNMOVEt(instruction, offset, FS, RT) \ 64 { \ 65 float out; \ 66 int out1; \ 67 __asm__ volatile( \ 68 "move $t0, %2\n\t" \ 69 "lw $" #RT ", "#offset"($t0)\n\t" \ 70 instruction "\n\t" \ 71 "mov.s %0, $" #FS"\n\t" \ 72 "move %1, $" #RT "\n\t" \ 73 : "=&f" (out), "=&r" (out1) \ 74 : "r" (mem) \ 75 : #RT, "cc", "memory" \ 76 ); \ 77 printf("%s :: fs %f, rt 0x%x\n", \ 78 instruction, out, out1); \ 79 } 80 81 // mthc1 rt, fs 82 #define TESTINSNMOVEtd(instruction, offset, FS, RT) \ 83 { \ 84 double out; \ 85 int out1; \ 86 __asm__ volatile( \ 87 "move $t0, %2\n\t" \ 88 "lw $" #RT ", "#offset"($t0)\n\t" \ 89 instruction "\n\t" \ 90 "mov.d %0, $" #FS"\n\t" \ 91 "move %1, $" #RT "\n\t" \ 92 : "=&f" (out), "=&r" (out1) \ 93 : "r" (mem) \ 94 : #RT, "cc", "memory" \ 95 ); \ 96 printf("%s :: fs %lf, rt 0x%x\n", \ 97 instruction, out, out1); \ 98 } 99 100 // mov.s fd, fs 101 #define TESTINSNMOVE1s(instruction, offset, FD, FS) \ 102 { \ 103 float out; \ 104 int out1; \ 105 __asm__ volatile( \ 106 "move $t0, %2\n\t" \ 107 "lwc1 $" #FS ", "#offset"($t0)\n\t" \ 108 instruction "\n\t" \ 109 "mov.s %0, $" #FD"\n\t" \ 110 "mfc1 %1, $" #FD"\n\t" \ 111 : "=&f" (out), "=&r" (out1) \ 112 : "r" (fs_f) \ 113 : "cc", "memory" \ 114 ); \ 115 printf("%s :: fs %f, rt 0x%x\n", \ 116 instruction, out, out1); \ 117 } 118 119 // mov.d fd, fs 120 #define TESTINSNMOVE1d(instruction, offset, FD, FS) \ 121 { \ 122 double out; \ 123 int out1; \ 124 __asm__ volatile( \ 125 "move $t0, %2\n\t" \ 126 "ldc1 $" #FS ", "#offset"($t0)\n\t" \ 127 instruction "\n\t" \ 128 "mov.d %0, $" #FD"\n\t" \ 129 "mfc1 %1, $" #FD"\n\t" \ 130 : "=&f" (out), "=&r" (out1) \ 131 : "r" (fs_f) \ 132 : "cc", "memory" \ 133 ); \ 134 printf("%s ::fs %f, rt 0x%x\n", \ 135 instruction, out, out1); \ 136 } 137 138 // movf rd, rs 139 #define TESTINSNMOVE2(instruction, RDval, RSval, RD, RS, cc) \ 140 { \ 141 int out; \ 142 __asm__ volatile( \ 143 "li $t0, 1\n\t" \ 144 "move $t1, %3\n\t" \ 145 "mtc1 $t0, $f0\n\t" \ 146 "mtc1 $t1, $f2\n\t" \ 147 "c.eq.s $f0, $f2\n\t" \ 148 "move $" #RS ", %1\n\t" \ 149 "move $" #RD ", %2\n\t" \ 150 instruction "\n\t" \ 151 "move %0, $" #RD "\n\t" \ 152 : "=&r" (out) \ 153 : "r" (RSval), "r" (RDval), "r" (cc) \ 154 : "t0", "t1", #RD, #RS, "cc", "memory" \ 155 ); \ 156 printf("%s :: out: 0x%x, RDval: 0x%x, RSval: 0x%x, cc: %d\n", \ 157 instruction, out, RDval, RSval, cc); \ 158 } 159 160 // movf.s fd, fs 161 #define TESTINSNMOVE2s(instruction, FD, FS, cc, offset) \ 162 { \ 163 float out; \ 164 __asm__ volatile( \ 165 "li $t0, 1\n\t" \ 166 "move $t1, %1\n\t" \ 167 "mtc1 $t0, $f0\n\t" \ 168 "mtc1 $t1, $f2\n\t" \ 169 "c.eq.s $f0, $f2\n\t" \ 170 "move $t0, %2\n\t" \ 171 "lwc1 $" #FS ", "#offset"($t0)\n\t" \ 172 instruction "\n\t" \ 173 "mov.s %0, $" #FD"\n\t" \ 174 : "=&f" (out) \ 175 : "r" (cc), "r" (fs_f) \ 176 : "t0", "t1", "cc", "memory" \ 177 ); \ 178 printf("%s :: out: %f, cc: %d\n", \ 179 instruction, out, cc); \ 180 } 181 182 // movf.d fd, fs 183 #define TESTINSNMOVE2d(instruction, FD, FS, cc, offset) \ 184 { \ 185 double out; \ 186 int out1; \ 187 int out2; \ 188 __asm__ volatile( \ 189 "li $t0, 1\n\t" \ 190 "move $t1, %3\n\t" \ 191 "mtc1 $t0, $f0\n\t" \ 192 "mtc1 $t1, $f2\n\t" \ 193 "c.eq.s $f0, $f2\n\t" \ 194 "move $t0, %4\n\t" \ 195 "ldc1 $" #FS ", "#offset"($t0)\n\t" \ 196 instruction "\n\t" \ 197 "mov.d %0, $" #FD"\n\t" \ 198 "mfc1 %1, $f4\n\t" \ 199 "mfc1 %2, $f5\n\t" \ 200 : "=&f" (out), "=&r" (out1), "=&r" (out2) \ 201 : "r" (cc), "r" (mem) \ 202 : "t0", "t1", "cc", "memory" \ 203 ); \ 204 printf("%s :: out: 0x%x 0x%x, cc: %d\n", \ 205 instruction, out1, out2, cc); \ 206 } 207 208 // movn.s fd, fs, rt 209 #define TESTINSNMOVEN1s(instruction, offset, RTval, FD, FS, RT) \ 210 { \ 211 float out; \ 212 int out1; \ 213 __asm__ volatile( \ 214 "move $" #RT ", %3\n\t" \ 215 "move $t0, %2\n\t" \ 216 "lwc1 $" #FS ", "#offset"($t0)\n\t" \ 217 "mtc1 $0, $" #FD "\n\t" \ 218 instruction "\n\t" \ 219 "mov.s %0, $" #FD"\n\t" \ 220 "mfc1 %1, $" #FD"\n\t" \ 221 : "=&f" (out), "=&r" (out1) \ 222 : "r" (fs_f), "r" (RTval) \ 223 : #RT, "cc", "memory" \ 224 ); \ 225 printf("%s :: fs rt 0x%x\n", \ 226 instruction, out1); \ 227 } 228 229 // movn.d fd, fs, rt 230 #define TESTINSNMOVEN1d(instruction, offset, RTval, FD, FS, RT) \ 231 { \ 232 double out; \ 233 int out1; \ 234 __asm__ volatile( \ 235 "move $" #RT ", %3\n\t" \ 236 "move $t0, %2\n\t" \ 237 "ldc1 $" #FS ", "#offset"($t0)\n\t" \ 238 "mtc1 $0, $" #FD "\n\t" \ 239 "mtc1 $0, $" #FD + 1"\n\t" \ 240 instruction "\n\t" \ 241 "mov.d %0, $" #FD"\n\t" \ 242 "mfc1 %1, $" #FD"\n\t" \ 243 : "=&f" (out), "=&r" (out1) \ 244 : "r" (fs_f), "r" (RTval) \ 245 : #RT, "cc", "memory" \ 246 ); \ 247 printf("%s :: fs %lf, rt 0x%x\n", \ 248 instruction, out, out1); \ 249 } 250 251 int main() 252 { 253 printf("MFC1\n"); 254 TESTINSNMOVE("mfc1 $t1, $f0", 0, f0, t1); 255 TESTINSNMOVE("mfc1 $t2, $f1", 4, f1, t2); 256 TESTINSNMOVE("mfc1 $t3, $f2", 8, f2, t3); 257 TESTINSNMOVE("mfc1 $t4, $f3", 12, f3, t4); 258 TESTINSNMOVE("mfc1 $t5, $f4", 16, f4, t5); 259 TESTINSNMOVE("mfc1 $t6, $f5", 20, f5, t6); 260 TESTINSNMOVE("mfc1 $t7, $f6", 24, f6, t7); 261 TESTINSNMOVE("mfc1 $v0, $f7", 28, f7, v0); 262 TESTINSNMOVE("mfc1 $v1, $f8", 32, f8, v1); 263 TESTINSNMOVE("mfc1 $s0, $f9", 36, f9, s0); 264 TESTINSNMOVE("mfc1 $s1, $f10", 40, f10, s1); 265 TESTINSNMOVE("mfc1 $s2, $f11", 44, f11, s2); 266 TESTINSNMOVE("mfc1 $s3, $f12", 48, f12, s3); 267 TESTINSNMOVE("mfc1 $s4, $f13", 52, f13, s4); 268 TESTINSNMOVE("mfc1 $s5, $f14", 56, f14, s5); 269 TESTINSNMOVE("mfc1 $s6, $f15", 60, f15, s6); 270 TESTINSNMOVE("mfc1 $s7, $f16", 64, f16, s7); 271 TESTINSNMOVE("mfc1 $a0, $f17", 0, f17, a0); 272 TESTINSNMOVE("mfc1 $a1, $f18", 4, f18, a1); 273 TESTINSNMOVE("mfc1 $a2, $f19", 8, f19, a2); 274 TESTINSNMOVE("mfc1 $a3, $f20", 12, f20, a3); 275 TESTINSNMOVE("mfc1 $v0, $f21", 16, f21, v0); 276 TESTINSNMOVE("mfc1 $v1, $f22", 20, f22, v1); 277 TESTINSNMOVE("mfc1 $t8, $f23", 24, f23, t8); 278 TESTINSNMOVE("mfc1 $t9, $f24", 28, f24, t9); 279 TESTINSNMOVE("mfc1 $t1, $f25", 32, f25, t1); 280 TESTINSNMOVE("mfc1 $t2, $f26", 36, f26, t2); 281 282 printf("MTC1\n"); 283 TESTINSNMOVEt("mtc1 $t1, $f0", 0, f0, t1); 284 TESTINSNMOVEt("mtc1 $t2, $f1", 4, f1, t2); 285 TESTINSNMOVEt("mtc1 $t3, $f2", 8, f2, t3); 286 TESTINSNMOVEt("mtc1 $t4, $f3", 12, f3, t4); 287 TESTINSNMOVEt("mtc1 $t5, $f4", 16, f4, t5); 288 TESTINSNMOVEt("mtc1 $t6, $f5", 20, f5, t6); 289 TESTINSNMOVEt("mtc1 $t7, $f6", 24, f6, t7); 290 TESTINSNMOVEt("mtc1 $v0, $f7", 28, f7, v0); 291 TESTINSNMOVEt("mtc1 $v1, $f8", 32, f8, v1); 292 TESTINSNMOVEt("mtc1 $s0, $f9", 36, f9, s0); 293 TESTINSNMOVEt("mtc1 $s1, $f10", 40, f10, s1); 294 TESTINSNMOVEt("mtc1 $s2, $f11", 44, f11, s2); 295 TESTINSNMOVEt("mtc1 $s3, $f12", 48, f12, s3); 296 TESTINSNMOVEt("mtc1 $s4, $f13", 52, f13, s4); 297 TESTINSNMOVEt("mtc1 $s5, $f14", 56, f14, s5); 298 TESTINSNMOVEt("mtc1 $s6, $f15", 60, f15, s6); 299 TESTINSNMOVEt("mtc1 $s7, $f16", 64, f16, s7); 300 TESTINSNMOVEt("mtc1 $a0, $f17", 2, f17, a0); 301 TESTINSNMOVEt("mtc1 $a1, $f18", 6, f18, a1); 302 TESTINSNMOVEt("mtc1 $a2, $f19", 10, f19, a2); 303 TESTINSNMOVEt("mtc1 $a3, $f20", 14, f20, a3); 304 TESTINSNMOVEt("mtc1 $v0, $f21", 18, f21, v0); 305 TESTINSNMOVEt("mtc1 $v1, $f22", 22, f22, v1); 306 TESTINSNMOVEt("mtc1 $t8, $f23", 26, f23, t8); 307 TESTINSNMOVEt("mtc1 $t9, $f24", 30, f24, t9); 308 TESTINSNMOVEt("mtc1 $t1, $f25", 34, f25, t1); 309 TESTINSNMOVEt("mtc1 $t2, $f26", 38, f26, t2); 310 311 printf("MOV.S\n"); 312 TESTINSNMOVE1s("mov.s $f0, $f0", 0, f0, f0); 313 TESTINSNMOVE1s("mov.s $f0, $f1", 4, f0, f1); 314 TESTINSNMOVE1s("mov.s $f1, $f2", 8, f1, f2); 315 TESTINSNMOVE1s("mov.s $f2, $f3", 12, f2, f3); 316 TESTINSNMOVE1s("mov.s $f3, $f4", 16, f3, f4); 317 TESTINSNMOVE1s("mov.s $f4, $f5", 20, f4, f5); 318 TESTINSNMOVE1s("mov.s $f5, $f6", 24, f5, f6); 319 TESTINSNMOVE1s("mov.s $f6, $f7", 28, f6, f7); 320 TESTINSNMOVE1s("mov.s $f7, $f8", 32, f7, f8); 321 TESTINSNMOVE1s("mov.s $f8, $f9", 36, f8, f9); 322 TESTINSNMOVE1s("mov.s $f9, $f10", 40, f9, f10); 323 TESTINSNMOVE1s("mov.s $f10, $f11", 44, f10, f11); 324 TESTINSNMOVE1s("mov.s $f11, $f12", 48, f11, f12); 325 TESTINSNMOVE1s("mov.s $f12, $f13", 52, f12, f13); 326 TESTINSNMOVE1s("mov.s $f13, $f14", 56, f13, f14); 327 TESTINSNMOVE1s("mov.s $f14, $f15", 60, f14, f15); 328 TESTINSNMOVE1s("mov.s $f15, $f16", 64, f15, f16); 329 TESTINSNMOVE1s("mov.s $f16, $f17", 0, f16, f17); 330 TESTINSNMOVE1s("mov.s $f17, $f18", 4, f17, f18); 331 TESTINSNMOVE1s("mov.s $f18, $f19", 8, f18, f19); 332 TESTINSNMOVE1s("mov.s $f19, $f20", 12, f19, f20); 333 TESTINSNMOVE1s("mov.s $f20, $f21", 16, f20, f21); 334 TESTINSNMOVE1s("mov.s $f21, $f22", 20, f21, f22); 335 TESTINSNMOVE1s("mov.s $f22, $f23", 24, f22, f23); 336 TESTINSNMOVE1s("mov.s $f23, $f24", 28, f23, f24); 337 TESTINSNMOVE1s("mov.s $f24, $f25", 32, f24, f25); 338 TESTINSNMOVE1s("mov.s $f25, $f26", 36, f25, f26); 339 340 printf("MOV.D\n"); 341 TESTINSNMOVE1d("mov.d $f0, $f0", 0, f0, f0); 342 TESTINSNMOVE1d("mov.d $f0, $f0", 8, f0, f0); 343 TESTINSNMOVE1d("mov.d $f0, $f2", 16, f0, f2); 344 TESTINSNMOVE1d("mov.d $f2, $f4", 24, f2, f4); 345 TESTINSNMOVE1d("mov.d $f2, $f4", 32, f2, f4); 346 TESTINSNMOVE1d("mov.d $f4, $f6", 40, f4, f6); 347 TESTINSNMOVE1d("mov.d $f4, $f6", 48, f4, f6); 348 TESTINSNMOVE1d("mov.d $f6, $f8", 56, f6, f8); 349 TESTINSNMOVE1d("mov.d $f6, $f8", 64, f6, f8); 350 TESTINSNMOVE1d("mov.d $f8, $f10", 0, f8, f10); 351 TESTINSNMOVE1d("mov.d $f8, $f10", 8, f8, f10); 352 TESTINSNMOVE1d("mov.d $f10, $f12", 16, f10, f12); 353 TESTINSNMOVE1d("mov.d $f10, $f12", 24, f10, f12); 354 TESTINSNMOVE1d("mov.d $f12, $f14", 32, f12, f14); 355 TESTINSNMOVE1d("mov.d $f12, $f14", 40, f12, f14); 356 TESTINSNMOVE1d("mov.d $f14, $f16", 48, f14, f16); 357 TESTINSNMOVE1d("mov.d $f14, $f16", 56, f14, f16); 358 TESTINSNMOVE1d("mov.d $f16, $f18", 64, f16, f18); 359 TESTINSNMOVE1d("mov.d $f16, $f18", 0, f16, f18); 360 TESTINSNMOVE1d("mov.d $f18, $f20", 8, f18, f20); 361 TESTINSNMOVE1d("mov.d $f18, $f20", 16, f18, f20); 362 TESTINSNMOVE1d("mov.d $f20, $f22", 24, f20, f22); 363 TESTINSNMOVE1d("mov.d $f20, $f22", 32, f20, f22); 364 TESTINSNMOVE1d("mov.d $f22, $f24", 40, f22, f24); 365 TESTINSNMOVE1d("mov.d $f22, $f24", 48, f22, f24); 366 TESTINSNMOVE1d("mov.d $f24, $f26", 56, f24, f26); 367 TESTINSNMOVE1d("mov.d $f24, $f26", 64, f24, f26); 368 369 printf("MOVF\n"); 370 TESTINSNMOVE2("movf $t0, $t1, $fcc0", 0, 0xffffffff, t0, t1, 1); 371 TESTINSNMOVE2("movf $t0, $t1, $fcc0", 0xffffffff, 0xffffffff, t0, t1, 0); 372 TESTINSNMOVE2("movf $t0, $t1, $fcc0", 555, 0xffffffff, t0, t1, 1); 373 TESTINSNMOVE2("movf $t0, $t1, $fcc0", 0, 5, t0, t1, 0); 374 TESTINSNMOVE2("movf $t0, $t1, $fcc0", 0, -1, t0, t1, 1); 375 TESTINSNMOVE2("movf $t0, $t1, $fcc0", 0xffffffff, 25, t0, t1, 0); 376 TESTINSNMOVE2("movf $t0, $t1, $fcc0", 0xffffffff, 0, t0, t1, 1); 377 TESTINSNMOVE2("movf $t0, $t1, $fcc0", 0xffffffff, 66, t0, t1, 0); 378 TESTINSNMOVE2("movf $t0, $t1, $fcc4", 0, 0xffffffff, t0, t1, 1); 379 TESTINSNMOVE2("movf $t0, $t1, $fcc4", 0xffffffff, 0xffffffff, t0, t1, 0); 380 TESTINSNMOVE2("movf $t0, $t1, $fcc4", 555, 0xffffffff, t0, t1, 1); 381 TESTINSNMOVE2("movf $t0, $t1, $fcc4", 0, 5, t0, t1, 0); 382 TESTINSNMOVE2("movf $t0, $t1, $fcc4", 0, -1, t0, t1, 1); 383 TESTINSNMOVE2("movf $t0, $t1, $fcc4", 0xffffffff, 25, t0, t1, 0); 384 TESTINSNMOVE2("movf $t0, $t1, $fcc4", 0xffffffff, 0, t0, t1, 1); 385 TESTINSNMOVE2("movf $t0, $t1, $fcc4", 0xffffffff, 66, t0, t1, 0); 386 387 printf("MOVF.S\n"); 388 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 0); 389 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 4); 390 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 8); 391 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 12); 392 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 16); 393 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 20); 394 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 24); 395 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 28); 396 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 32); 397 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 36) 398 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 40) 399 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 44) 400 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 48) 401 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 52) 402 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 1, 56) 403 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 0); 404 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 4); 405 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 8); 406 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 12); 407 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 16); 408 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 20); 409 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 24); 410 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 28); 411 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 32); 412 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 36); 413 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 40); 414 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 44); 415 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 48); 416 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 52); 417 TESTINSNMOVE2s("movf.s $f4, $f6, $fcc0", f4, f6, 0, 56); 418 419 printf("MOVF.D\n"); 420 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 0); 421 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 8); 422 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 16); 423 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 24); 424 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 32); 425 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 40); 426 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 48); 427 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 56); 428 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 64); 429 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 0) 430 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 8) 431 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 16) 432 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 24) 433 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 32) 434 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 1, 40) 435 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 48); 436 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 56); 437 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 64); 438 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 0); 439 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 8); 440 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 16); 441 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 24); 442 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 32); 443 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 40); 444 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 48); 445 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 56); 446 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 64); 447 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 0); 448 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 8); 449 TESTINSNMOVE2d("movf.d $f4, $f6, $fcc0", f4, f6, 0, 16); 450 451 printf("MOVN.S\n"); 452 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 0, 0, f0, f2, t3); 453 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 4, 1, f0, f2, t3); 454 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 8, 0xffff, f0, f2, t3); 455 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 12, -1, f0, f2, t3); 456 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 16, 5, f0, f2, t3); 457 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 20, 0, f0, f2, t3); 458 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 24, 0, f0, f2, t3); 459 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 28, 5, f0, f2, t3); 460 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 32, 125487, f0, f2, t3); 461 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 36, 68, f0, f2, t3); 462 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 40, -122544, f0, f2, t3); 463 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 44, 0, f0, f2, t3); 464 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 48, 0, f0, f2, t3); 465 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 52, 0xffffffff, f0, f2, t3); 466 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 56, 0x80000000, f0, f2, t3); 467 TESTINSNMOVEN1s("movn.s $f0, $f2, $t3", 60, 0x7fffffff, f0, f2, t3); 468 469 printf("MOVN.D\n"); 470 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 0, 0, f0, f2, t3); 471 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 4, 1, f0, f2, t3); 472 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 8, 0xffff, f0, f2, t3); 473 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 12, -1, f0, f2, t3); 474 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 16, 5, f0, f2, t3); 475 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 20, 0, f0, f2, t3); 476 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 24, 0, f0, f2, t3); 477 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 28, 5, f0, f2, t3); 478 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 32, 125487, f0, f2, t3); 479 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 36, 68, f0, f2, t3); 480 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 40, -122544, f0, f2, t3); 481 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 44, 0, f0, f2, t3); 482 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 48, 0, f0, f2, t3); 483 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 52, 0xffffffff, f0, f2, t3); 484 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 56, 0x80000000, f0, f2, t3); 485 TESTINSNMOVEN1s("movn.d $f0, $f2, $t3", 60, 0x7fffffff, f0, f2, t3); 486 487 printf("MOVT\n"); 488 TESTINSNMOVE2("movt $t0, $t1, $fcc0", 0, 0xffffffff, t0, t1, 1); 489 TESTINSNMOVE2("movt $t0, $t1, $fcc0", 0xffffffff, 0xffffffff, t0, t1, 0); 490 TESTINSNMOVE2("movt $t0, $t1, $fcc0", 555, 0xffffffff, t0, t1, 1); 491 TESTINSNMOVE2("movt $t0, $t1, $fcc0", 0, 5, t0, t1, 0); 492 TESTINSNMOVE2("movt $t0, $t1, $fcc0", 0, -1, t0, t1, 1); 493 TESTINSNMOVE2("movt $t0, $t1, $fcc0", 0xffffffff, 25, t0, t1, 0); 494 TESTINSNMOVE2("movt $t0, $t1, $fcc0", 0xffffffff, 0, t0, t1, 1); 495 TESTINSNMOVE2("movt $t0, $t1, $fcc0", 0xffffffff, 66, t0, t1, 0); 496 TESTINSNMOVE2("movt $t0, $t1, $fcc4", 0, 0xffffffff, t0, t1, 1); 497 TESTINSNMOVE2("movt $t0, $t1, $fcc4", 0xffffffff, 0xffffffff, t0, t1, 0); 498 TESTINSNMOVE2("movt $t0, $t1, $fcc4", 555, 0xffffffff, t0, t1, 1); 499 TESTINSNMOVE2("movt $t0, $t1, $fcc4", 0, 5, t0, t1, 0); 500 TESTINSNMOVE2("movt $t0, $t1, $fcc4", 0, -1, t0, t1, 1); 501 TESTINSNMOVE2("movt $t0, $t1, $fcc4", 0xffffffff, 25, t0, t1, 0); 502 TESTINSNMOVE2("movt $t0, $t1, $fcc4", 0xffffffff, 0, t0, t1, 1); 503 TESTINSNMOVE2("movt $t0, $t1, $fcc4", 0xffffffff, 66, t0, t1, 0); 504 505 printf("MOVT.S\n"); 506 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 0); 507 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 4); 508 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 8); 509 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 12); 510 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 16); 511 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 20); 512 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 24); 513 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 28); 514 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 32); 515 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 36) 516 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 40) 517 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 44) 518 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 48) 519 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 52) 520 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 1, 56) 521 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 0); 522 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 4); 523 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 8); 524 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 12); 525 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 16); 526 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 20); 527 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 24); 528 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 28); 529 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 32); 530 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 36); 531 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 40); 532 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 44); 533 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 48); 534 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 52); 535 TESTINSNMOVE2s("movt.s $f4, $f6, $fcc0", f4, f6, 0, 56); 536 537 printf("MOVT.D\n"); 538 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 0); 539 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 8); 540 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 16); 541 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 24); 542 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 32); 543 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 40); 544 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 48); 545 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 56); 546 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 64); 547 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 0) 548 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 8) 549 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 16) 550 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 24) 551 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 32) 552 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 1, 40) 553 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 48); 554 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 56); 555 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 64); 556 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 0); 557 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 8); 558 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 16); 559 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 24); 560 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 32); 561 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 40); 562 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 48); 563 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 56); 564 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 64); 565 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 0); 566 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 8); 567 TESTINSNMOVE2d("movt.d $f4, $f6, $fcc0", f4, f6, 0, 16); 568 569 printf("MOVZ.S\n"); 570 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 0, 0, f0, f2, t3); 571 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 4, 1, f0, f2, t3); 572 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 8, 0xffff, f0, f2, t3); 573 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 12, -1, f0, f2, t3); 574 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 16, 5, f0, f2, t3); 575 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 20, 0, f0, f2, t3); 576 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 24, 0, f0, f2, t3); 577 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 24, 0, f0, f2, t3); 578 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 28, 5, f0, f2, t3); 579 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 32, 125487, f0, f2, t3); 580 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 36, 68, f0, f2, t3); 581 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 40, -122544, f0, f2, t3); 582 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 44, 0, f0, f2, t3); 583 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 48, 0, f0, f2, t3); 584 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 52, 0xffffffff, f0, f2, t3); 585 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 56, 0x80000000, f0, f2, t3); 586 TESTINSNMOVEN1s("movz.s $f0, $f2, $t3", 60, 0x7fffffff, f0, f2, t3); 587 588 printf("MOVZ.D\n"); 589 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 0, 0, f0, f2, t3); 590 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 4, 1, f0, f2, t3); 591 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 8, 0xffff, f0, f2, t3); 592 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 12, -1, f0, f2, t3); 593 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 16, 5, f0, f2, t3); 594 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 20, 0, f0, f2, t3); 595 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 24, 0, f0, f2, t3); 596 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 28, 5, f0, f2, t3); 597 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 32, 125487, f0, f2, t3); 598 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 36, 68, f0, f2, t3); 599 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 40, -122544, f0, f2, t3); 600 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 44, 0, f0, f2, t3); 601 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 48, 0, f0, f2, t3); 602 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 52, 0xffffffff, f0, f2, t3); 603 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 56, 0x80000000, f0, f2, t3); 604 TESTINSNMOVEN1s("movz.d $f0, $f2, $t3", 60, 0x7fffffff, f0, f2, t3); 605 return 0; 606 } 607