qemu/tests/tcg/mips/mips64-dsp/prependw.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rt, rs;
   6    long long res;
   7    rt = 0x1234567887654321;
   8    rs = 0xabcd1234abcd8765;
   9
  10    res = 0x1234567887654321;
  11    __asm
  12        ("prependw %0, %1, 0x0\n\t"
  13         : "=r"(rt)
  14         : "r"(rs)
  15        );
  16
  17    if (rt != res) {
  18        printf("prependw error\n");
  19        return -1;
  20    }
  21
  22    rt = 0x1234567887654321;
  23    rs = 0xabcd1234abcd8765;
  24
  25    res = 0x5123456788765432;
  26    __asm
  27        ("prependw %0, %1, 0x4\n\t"
  28         : "=r"(rt)
  29         : "r"(rs)
  30        );
  31
  32    if (rt != res) {
  33        printf("prependw error\n");
  34        return -1;
  35    }
  36    return 0;
  37}
  38