qemu/tests/tcg/mips/mips64-dsp/cmp_eq_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 = 0x00;
  11    __asm
  12        ("cmp.eq.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.eq.ph wrong\n");
  21
  22        return -1;
  23    }
  24
  25    rs     = 0x11777066;
  26    rt     = 0x11777066;
  27    result = 0x03;
  28    __asm
  29        ("cmp.eq.ph %1, %2\n\t"
  30         "rddsp %0\n\t"
  31         : "=r"(rd)
  32         : "r"(rs), "r"(rt)
  33        );
  34    rd = (rd >> 24) & 0x03;
  35    if (rd != result) {
  36        printf("cmp.eq.ph wrong\n");
  37
  38        return -1;
  39    }
  40
  41    return 0;
  42}
  43