mirror of
https://github.com/qemu/qemu.git
synced 2024-12-02 00:03:35 +08:00
d70080c4e3
Add MIPS ASE DSP testcases. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
45 lines
732 B
C
45 lines
732 B
C
#include<stdio.h>
|
|
#include<assert.h>
|
|
|
|
int main()
|
|
{
|
|
int dsp, sum;
|
|
int result;
|
|
|
|
dsp = 0x20;
|
|
sum = 0x01;
|
|
result = 0x02;
|
|
|
|
__asm
|
|
("wrdsp %1\n\t"
|
|
"bposge32 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)
|
|
);
|
|
assert(sum == result);
|
|
|
|
dsp = 0x10;
|
|
sum = 0x01;
|
|
result = 0xA4;
|
|
|
|
__asm
|
|
("wrdsp %1\n\t"
|
|
"bposge32 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)
|
|
);
|
|
assert(sum == result);
|
|
|
|
return 0;
|
|
}
|