summaryrefslogtreecommitdiffstats
path: root/qemu/tests/tcg/mips/mips64-dsp/absq_s_qh.c
blob: 9001a9e164214e521a9f719f6fe64bccaf136732 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "io.h"

int main(void)
{
    long long rd, rt, result, dspcontrol;
    rd = 0;
    rt = 0x7F7F7F7F7F7F7F7F;
    result = 0x7F7F7F7F7F7F7F7F;


    __asm
        ("absq_s.qh %0, %1\n\t"
         : "=r"(rd)
         : "r"(rt)
        );

    if (result != rd) {
        printf("absq_s.qh test 1 error\n");

        return -1;
    }

    rd = 0;
    rt = 0x8000FFFFFFFFFFFF;
    result = 0x7FFF000100000001;

    __asm
        ("absq_s.pw %0, %1\n\t"
         : "=r"(rd)
         : "r"(rt)
        );
    if (result != rd) {
        printf("absq_s.rw test 2 error\n");

        return -1;
    }

    return 0;
}