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