qemu/tests/tcg/mips/mips64-dsp/bposge64.c
Jia Liu d70080c4e3 target-mips: Add ASE DSP testcases
Add MIPS ASE DSP testcases.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-10-31 21:37:21 +01:00

51 lines
846 B
C

#include "io.h"
int main(void)
{
long long dsp, sum;
long long result;
dsp = 0x40;
sum = 0x01;
result = 0x02;
__asm
("wrdsp %1\n\t"
"bposge64 test1\n\t"
"nop\n\t"
"addi %0, 0xA2\n\t"
"nop\n\t"
"test1:\n\t"
"addi %0, 0x01\n\t"
: "+r"(sum)
: "r"(dsp)
);
if (sum != result) {
printf("bposge64 wrong\n");
return -1;
}
dsp = 0x10;
sum = 0x01;
result = 0xA4;
__asm
("wrdsp %1\n\t"
"bposge64 test2\n\t"
"nop\n\t"
"addi %0, 0xA2\n\t"
"nop\n\t"
"test2:\n\t"
"addi %0, 0x01\n\t"
: "+r"(sum)
: "r"(dsp)
);
if (sum != result) {
printf("bposge64 wrong\n");
return -1;
}
return 0;
}