qemu/tests/tcg/mips/mips64-dsp/shilov.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rs, ach, acl;
   6    long long resulth, resultl;
   7
   8    rs  = 0x0F;
   9    ach = 0xBBAACCFF;
  10    acl = 0x1C3B001D;
  11
  12    resulth = 0x17755;
  13    resultl = 0xFFFFFFFF99fe3876;
  14
  15    __asm
  16        ("mthi %0, $ac1\n\t"
  17         "mtlo %1, $ac1\n\t"
  18         "shilov $ac1, %2\n\t"
  19         "mfhi %0, $ac1\n\t"
  20         "mflo %1, $ac1\n\t"
  21         : "+r"(ach), "+r"(acl)
  22         : "r"(rs)
  23        );
  24    if ((ach != resulth) || (acl != resultl)) {
  25        printf("shilov wrong\n");
  26
  27        return -1;
  28    }
  29
  30    return 0;
  31}
  32