qemu/tests/tcg/mips/mips64-dsp/addq_qh.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rd, rs, rt, result, dspreg, dspresult;
   6
   7    rs = 0x123456787FFF8010;
   8    rt = 0x1111111100018000;
   9    result = 0x2345678980000010;
  10    dspresult = 0x1;
  11
  12    __asm
  13        ("addq.qh %0, %2, %3\n\t"
  14         "rddsp %1\n\t"
  15         : "=r"(rd), "=r"(dspreg)
  16         : "r"(rs), "r"(rt)
  17        );
  18
  19    dspreg = ((dspreg >> 20) & 0x01);
  20
  21    if ((rd != result) || (dspreg != dspresult)) {
  22        printf("addq.qh error\n");
  23
  24        return -1;
  25    }
  26
  27    return 0;
  28}
  29