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