summaryrefslogtreecommitdiffstats
path: root/qemu/tests/tcg/mips/mips64-dsp/repl_qh.c
blob: 82afc371676ea12f838abe445b126f535e613cb0 (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
#include "io.h"

int main(void)
{
    long long rd, result;
    rd = 0;
    result = 0x01FF01FF01FF01FF;

    __asm
        ("repl.qh %0, 0x1FF\n\t"
         : "=r"(rd)
        );

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

        return -1;
    }

    rd = 0;
    result = 0xFE00FE00FE00FE00;
    __asm
        ("repl.qh %0, 0xFFFFFFFFFFFFFE00\n\t"
         : "=r"(rd)
        );

    if (result != rd) {
        printf("repl.qh error 2\n");

        return -1;
    }

    return 0;
}