~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to tests/tcg/mips/mips64-dspr2/precr_sra_r_ph_w.c

  • Committer: Phil Dennis-Jordan
  • Author(s): Michael Tokarev
  • Date: 2017-05-23 06:58:03 UTC
  • Revision ID: phil@philjordan.eu-20170523065803-3subwvf3y8kzkjry
Tags: upstream-2.8+dfsg
ImportĀ upstreamĀ versionĀ 2.8+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include"io.h"
 
2
 
 
3
int main(void)
 
4
{
 
5
    long long rs, rt;
 
6
    long long result;
 
7
 
 
8
    rs = 0x12345678;
 
9
    rt = 0x87654321;
 
10
    result = 0x43215678;
 
11
 
 
12
    __asm
 
13
        ("precr_sra_r.ph.w %0, %1, 0x00\n\t"
 
14
         : "+r"(rt)
 
15
         : "r"(rs)
 
16
        );
 
17
    if (result != rt) {
 
18
        printf("precr_sra_r.ph.w error\n");
 
19
        return -1;
 
20
    }
 
21
 
 
22
    rs = 0x12345678;
 
23
    rt = 0x87654321;
 
24
    result = 0xFFFFFFFFFFFF0000;
 
25
 
 
26
    __asm
 
27
        ("precr_sra_r.ph.w %0, %1, 0x1F\n\t"
 
28
         : "+r"(rt)
 
29
         : "r"(rs)
 
30
        );
 
31
    if (result != rt) {
 
32
        printf("precr_sra_r.ph.w error\n");
 
33
        return -1;
 
34
    }
 
35
 
 
36
    return 0;
 
37
}