qemu/tests/tcg/mips/mips32-dspr2/mulsa_w_ph.c
<<
>>
Prefs
   1#include<stdio.h>
   2#include<assert.h>
   3
   4int main()
   5{
   6    int rs, rt, ach, acl;
   7    int resulth, resultl;
   8
   9    ach = 0x05;
  10    acl = 0x00BBDDCC;
  11    rs = 0x80001234;
  12    rt = 0x80004321;
  13    resulth = 0x05;
  14    resultl = 0x3BF5E918;
  15
  16    __asm
  17        ("mthi %0, $ac1\n\t"
  18         "mtlo %1, $ac1\n\t"
  19         "mulsa.w.ph $ac1, %2, %3\n\t"
  20         "mfhi %0, $ac1\n\t"
  21         "mflo %1, $ac1\n\t"
  22         : "+r"(ach), "+r"(acl)
  23         : "r"(rs), "r"(rt)
  24        );
  25    assert(ach == resulth);
  26    assert(acl == resultl);
  27
  28    return 0;
  29}
  30