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