qemu/tests/tcg/mips/mips64-dsp/pick_pw.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rd, rs, rt, dsp;
   6    long long res;
   7    dsp = 0xff000000;
   8
   9    rs = 0x1234567812345678;
  10    rt = 0x8765432187654321;
  11
  12    res = 0x1234567812345678;
  13
  14    __asm
  15        ("wrdsp %1, 0x10\n\t"
  16         "wrdsp %1\n\t"
  17         "pick.pw %0, %2, %3\n\t"
  18         : "=r"(rd), "+r"(dsp)
  19         : "r"(rs), "r"(rt)
  20        );
  21
  22    if (rd != res) {
  23        printf("pick.pw error\n");
  24        return -1;
  25    }
  26
  27    dsp = 0x00000000;
  28
  29    rs = 0x1234567812345678;
  30    rt = 0x8765432187654321;
  31
  32    res = 0x8765432187654321;
  33
  34    __asm
  35        ("wrdsp %1, 0x10\n\t"
  36         "wrdsp %1\n\t"
  37         "pick.pw %0, %2, %3\n\t"
  38         : "=r"(rd), "+r"(dsp)
  39         : "r"(rs), "r"(rt)
  40        );
  41
  42    if (rd != res) {
  43        printf("pick.pw error\n");
  44        return -1;
  45    }
  46
  47    return 0;
  48}
  49