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