qemu/tests/tcg/mips/mips64-dsp/dextrv_r_l.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rt, dsp, rs;
   6    long long achi, acli;
   7    long long res, resdsp;
   8
   9    achi = 0x87654321;
  10    acli = 0x12345678;
  11    rs = 0x8;
  12
  13    res = 0x2100000000123456;
  14    resdsp = 0x01;
  15
  16    __asm
  17        ("mthi %2, $ac1\n\t"
  18         "mtlo %3, $ac1\n\t"
  19         "dextrv_r.l %0, $ac1, %4\n\t"
  20         "rddsp %1\n\t"
  21         : "=r"(rt), "=r"(dsp)
  22         : "r"(achi), "r"(acli), "r"(rs)
  23        );
  24
  25    dsp = (dsp >> 23) & 0x1;
  26
  27    if ((dsp != resdsp) || (rt != res)) {
  28        printf("dextrv_r.l error\n");
  29        return -1;
  30    }
  31
  32    achi = 0x87654321;
  33    acli = 0x12345678;
  34    rs = 0x0;
  35
  36    res = 0x12345678;
  37    resdsp = 0x01;
  38
  39    __asm
  40        ("mthi %2, $ac1\n\t"
  41         "mtlo %3, $ac1\n\t"
  42         "dextrv_r.l %0, $ac1, %4\n\t"
  43         "rddsp %1\n\t"
  44         : "=r"(rt), "=r"(dsp)
  45         : "r"(achi), "r"(acli), "r"(rs)
  46        );
  47
  48    dsp = (dsp >> 23) & 0x1;
  49
  50    if ((dsp != resdsp) || (rt != res)) {
  51        printf("dextrv_r.l error\n");
  52        return -1;
  53    }
  54
  55    return 0;
  56}
  57