qemu/tests/tcg/mips/mips64-dsp/addsc.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     = 0x0000000F;
  10    rt     = 0x00000001;
  11    result = 0x00000010;
  12    __asm
  13        ("addsc %0, %1, %2\n\t"
  14         : "=r"(rd)
  15         : "r"(rs), "r"(rt)
  16        );
  17    if (rd != result) {
  18        printf("1 addsc wrong\n");
  19
  20        return -1;
  21    }
  22
  23    rs     = 0xFFFF0FFF;
  24    rt     = 0x00010111;
  25    result = 0x00001110;
  26    __asm
  27        ("addsc %0, %2, %3\n\t"
  28         "rddsp %1\n\t"
  29         : "=r"(rd), "=r"(dsp)
  30         : "r"(rs), "r"(rt)
  31        );
  32    if ((rd != result) || (((dsp >> 13) & 0x01) != 1)) {
  33        printf("2 addsc wrong\n");
  34
  35        return -1;
  36    }
  37
  38    return 0;
  39}
  40