qemu/tests/tcg/mips/mips64-dsp/cmp_le_qh.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rs, rt, dspreg, dspresult;
   6
   7    rs = 0x123456789ABCDEF0;
   8    rt = 0x123456789ABCDEFF;
   9    dspresult = 0x0F;
  10
  11    __asm
  12        ("cmp.le.qh %1, %2\n\t"
  13         "rddsp %0\n\t"
  14         : "=r"(dspreg)
  15         : "r"(rs), "r"(rt)
  16        );
  17
  18    dspreg = ((dspreg >> 24) & 0x0F);
  19
  20    if (dspreg != dspresult) {
  21        printf("cmp.le.qh error\n");
  22
  23        return -1;
  24    }
  25
  26    rs = 0x823456789ABCDEF0;
  27    rt = 0x123456789ABCDEFF;
  28    dspresult = 0x0f;
  29
  30    __asm
  31        ("cmp.le.qh %1, %2\n\t"
  32         "rddsp %0\n\t"
  33         : "=r"(dspreg)
  34         : "r"(rs), "r"(rt)
  35        );
  36
  37    dspreg = ((dspreg >> 24) & 0x0F);
  38
  39    if (dspreg != dspresult) {
  40        printf("cmp.le.qh error\n");
  41
  42        return -1;
  43    }
  44
  45    return 0;
  46}
  47