qemu/tests/tcg/mips/mips64-dsp/insv.c
<<
>>
Prefs
   1#include "io.h"
   2
   3int main(void)
   4{
   5    long long rt, rs, dsp;
   6    long long result;
   7
   8    /* msb = 10, lsb = 5 */
   9    dsp    = 0x305;
  10    rt     = 0x12345678;
  11    rs     = 0xffffffff87654321;
  12    result = 0x12345338;
  13    __asm
  14        ("wrdsp %2, 0x03\n\t"
  15         "insv  %0, %1\n\t"
  16         : "+r"(rt)
  17         : "r"(rs), "r"(dsp)
  18        );
  19    if (rt != result) {
  20        printf("insv wrong\n");
  21
  22        return -1;
  23    }
  24
  25    return 0;
  26}
  27