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