qemu/tests/tcg/mips/mips64-dsp/muleq_s_pw_qhl.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rd, rs, rt, result;
   6
   7    rd = 0;
   8    rs = 0x45BCFFFF12345678;
   9    rt = 0x98529AD287654321;
  10    result = 0x52fbec7035a2ca5c;
  11
  12    __asm
  13        ("muleq_s.pw.qhl %0, %1, %2\n\t"
  14         : "=r"(rd)
  15         : "r"(rs), "r"(rt)
  16        );
  17
  18    if (result != rd) {
  19        printf("1 muleq_s.pw.qhl error\n");
  20
  21        return -1;
  22    }
  23
  24    rd = 0;
  25    rs = 0x45BC800012345678;
  26    rt = 0x9852800087654321;
  27    result = 0x52fbec707FFFFFFF;
  28
  29    __asm
  30        ("muleq_s.pw.qhl %0, %1, %2\n\t"
  31         : "=r"(rd)
  32         : "r"(rs), "r"(rt)
  33        );
  34
  35    if (result != rd) {
  36        printf("2 muleq_s.pw.qhl error\n");
  37
  38        return -1;
  39    }
  40
  41    rd = 0;
  42    __asm
  43        ("rddsp %0\n\t"
  44         : "=r"(rd)
  45        );
  46    rd = rd >> 21;
  47    rd = rd & 0x1;
  48
  49    if (rd != 1) {
  50        printf("3 muleq_s.pw.qhl error\n");
  51
  52        return -1;
  53    }
  54
  55    return 0;
  56}
  57