qemu/tests/tcg/mips/mips64-dsp/extpdpv.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rt, rs, ach, acl, dsp, pos, efi;
   6    long long result;
   7
   8    ach = 0x05;
   9    acl = 0xB4CB;
  10    dsp = 0x07;
  11    rs  = 0x03;
  12    result = 0x000C;
  13
  14    __asm
  15        ("wrdsp %1, 0x01\n\t"
  16         "mthi %2, $ac1\n\t"
  17         "mtlo %3, $ac1\n\t"
  18         "extpdpv %0, $ac1, %4\n\t"
  19         "rddsp %1\n\t"
  20         : "=r"(rt), "+r"(dsp)
  21         : "r"(ach), "r"(acl), "r"(rs)
  22        );
  23    pos =  dsp & 0x3F;
  24    efi = (dsp >> 14) & 0x01;
  25    if ((pos != 3) || (efi != 0) || (result != rt)) {
  26        printf("extpdpv wrong\n");
  27
  28        return -1;
  29    }
  30
  31    ach = 0x05;
  32    acl = 0xB4CB;
  33    dsp = 0x01;
  34
  35    __asm
  36        ("wrdsp %1, 0x01\n\t"
  37         "mthi %2, $ac1\n\t"
  38         "mtlo %3, $ac1\n\t"
  39         "extpdpv %0, $ac1, %4\n\t"
  40         "rddsp %1\n\t"
  41         : "=r"(rt), "+r"(dsp)
  42         : "r"(ach), "r"(acl), "r"(rs)
  43        );
  44    efi = (dsp >> 14) & 0x01;
  45    if (efi != 1) {
  46        printf("extpdpv wrong\n");
  47
  48        return -1;
  49    }
  50
  51    return 0;
  52}
  53