• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <stdio.h>
2 
3 #define N 16
4 #define SOLL 8 /* size of unsigned long long */
5 
6 unsigned long long memSrc[] = {
7    0x12345658121f1e1f, 0,
8    3,                  -1,
9    0x232f2e2f56568441, 0x242c2b2b1236548c,
10    0xffffffff252a2e2b, 0x262d2d2a4521dddd,
11    0x3f343f3e22222222, 0x3e353d3c41231548,
12    0x363a3c3b45421212, 0x3b373b3a4545afcb,
13    0x454f4e4556984525, 0xfffffffffffffffc,
14    0x474d474c55aaaaaa, 0x4a484a4c65665659
15 };
16 
17 unsigned long long memDst[] = {
18    0, 0, 0, 0,
19    0, 0, 0, 0,
20    0, 0, 0, 0,
21    0, 0, 0, 0,
22 };
23 
main()24 int main()
25 {
26 #if defined(__mips_hard_float)
27    int i, index;
28    unsigned long long outLoad;
29    for (i = 0; i < N * SOLL; i++) {
30       outLoad = 0;
31       __asm__ __volatile__(
32          "move  $t0, %1"        "\n\t"
33          "move  $t1, %2"        "\n\t"
34          "luxc1 $f0, $t1($t0)"  "\n\t"
35          "dmfc1 %0,  $f0"       "\n\t"
36          "move  $t0, %3"        "\n\t"
37          "suxc1 $f0, $t1($t0)"  "\n\t"
38          : "=r" (outLoad)
39          : "r" (memSrc), "r" (i), "r" (memDst)
40          : "t0", "t1", "$f0"
41       );
42       index = (i / SOLL) % N;
43       printf("i: %d, memSrc[%d]: 0x%llx, memDst[%d]: 0x%llx, outLoad: 0x%llx\n",
44               i, index, memSrc[index], index, memDst[index], outLoad);
45    }
46 #endif
47    return 0;
48 }
49