qemu/tests/tcg/mips/mips64-dspr2/subuh_r_qb.c
<<
>>
Prefs
   1#include"io.h"
   2
   3int main(void)
   4{
   5    long long rd, rs, rt;
   6    long long result;
   7
   8    rs = 0x12345678;
   9    rt = 0x87654321;
  10    result = 0xC6E80A2C;
  11
  12    __asm
  13        ("subuh_r.qb %0, %1, %2\n\t"
  14         : "=r"(rd)
  15         : "r"(rs), "r"(rt)
  16        );
  17    if (rd != result) {
  18        printf("1 subuh_r.qb wrong\n");
  19        return -1;
  20    }
  21
  22    rs = 0xBEFC292A;
  23    rt = 0x9205C1B4;
  24    result = 0x167cb4bb;
  25
  26    __asm
  27        ("subuh_r.qb %0, %1, %2\n\t"
  28         : "=r"(rd)
  29         : "r"(rs), "r"(rt)
  30        );
  31    if (rd != result) {
  32        printf("2 subuh_r.qb wrong\n");
  33        return -1;
  34    }
  35
  36    return 0;
  37}
  38