qemu/tests/tcg/mips/mips64-dsp/shll_s_pw.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rd, rt, dsp;
   6    long long result, resultdsp;
   7
   8    rt        = 0x8765432112345678;
   9    result    = 0x8765432112345678;
  10    resultdsp = 0;
  11
  12    __asm
  13        ("shll_s.pw %0, %2, 0x0\n\t"
  14         "rddsp %1\n\t"
  15         : "=r"(rd), "=r"(dsp)
  16         : "r"(rt)
  17        );
  18
  19    dsp = (dsp >> 22) & 0x01;
  20    if ((dsp != resultdsp) || (rd  != result)) {
  21        printf("shll_s.pw wrong\n");
  22        return -1;
  23    }
  24
  25    rt        = 0x8765432112345678;
  26    result    = 0x800000007fffffff;
  27    resultdsp = 1;
  28
  29    __asm
  30        ("shll_s.pw %0, %2, 0x8\n\t"
  31         "rddsp %1\n\t"
  32         : "=r"(rd), "=r"(dsp)
  33         : "r"(rt)
  34        );
  35
  36    dsp = (dsp >> 22) & 0x01;
  37    if ((dsp != resultdsp) || (rd  != result)) {
  38        printf("shll_s.pw wrong\n");
  39        return -1;
  40    }
  41
  42    return 0;
  43}
  44