qemu/tests/tcg/mips/mips64-dspr2/addu_s_ph.c
<<
>>
Prefs
   1#include"io.h"
   2
   3int main(void)
   4{
   5    long long rd, rs, rt;
   6    long long dsp;
   7    long long result;
   8
   9    rs     = 0x00FE00FE;
  10    rt     = 0x00020001;
  11    result = 0x010000FF;
  12    __asm
  13        ("addu_s.ph %0, %1, %2\n\t"
  14         : "=r"(rd)
  15         : "r"(rs), "r"(rt)
  16        );
  17    if (rd != result) {
  18        printf("addu_s.ph error\n");
  19        return -1;
  20    }
  21
  22    rs     = 0xFFFF1111;
  23    rt     = 0x00020001;
  24    result = 0xFFFFFFFFFFFF1112;
  25    __asm
  26        ("addu_s.ph %0, %2, %3\n\t"
  27         "rddsp %1\n\t"
  28         : "=r"(rd), "=r"(dsp)
  29         : "r"(rs), "r"(rt)
  30        );
  31    if ((rd != result) || (((dsp >> 20) & 0x01) != 1)) {
  32        printf("addu_s.ph error\n");
  33        return -1;
  34    }
  35
  36    return 0;
  37}
  38