qemu/tests/tcg/mips/mips64-dsp/dpau_h_obr.c
<<
>>
Prefs
   1
   2#include "io.h"
   3
   4int main(void)
   5{
   6    long long rs, rt;
   7    long long achi, acli;
   8    long long acho, aclo;
   9    long long resh, resl;
  10
  11    rs = 0x0000000100000001;
  12    rt = 0x0000000200000002;
  13    achi = 0x1;
  14    acli = 0x1;
  15    resh = 0x1;
  16    resl = 0x3;
  17
  18    __asm
  19        ("mthi        %2, $ac1\n\t"
  20         "mtlo        %3, $ac1\n\t"
  21         "dpau.h.obr $ac1, %4, %5\n\t"
  22         "mfhi        %0,   $ac1\n\t"
  23         "mflo        %1,   $ac1\n\t"
  24         : "=r"(acho), "=r"(aclo)
  25         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
  26        );
  27
  28    if ((acho != resh) || (aclo != resl)) {
  29        printf("1 dpau.h.obr error\n");
  30
  31        return -1;
  32    }
  33
  34    rs = 0xccccddddaaaabbbb;
  35    rt = 0x5555666633334444;
  36    achi = 0x88888888;
  37    acli = 0x66666666;
  38
  39    resh = 0xffffffff88888888;
  40    resl = 0x66670d7a;
  41
  42    __asm
  43        ("mthi        %2, $ac1\n\t"
  44         "mtlo        %3, $ac1\n\t"
  45         "dpau.h.obr $ac1, %4, %5\n\t"
  46         "mfhi        %0,   $ac1\n\t"
  47         "mflo        %1,   $ac1\n\t"
  48         : "=r"(acho), "=r"(aclo)
  49         : "r"(achi), "r"(acli), "r"(rs), "r"(rt)
  50        );
  51
  52    if ((acho != resh) || (aclo != resl)) {
  53        printf("1 dpau.h.obr error\n");
  54
  55        return -1;
  56    }
  57
  58    return 0;
  59}
  60