~ubuntu-branches/ubuntu/vivid/qemu-linaro/vivid

« back to all changes in this revision

Viewing changes to tests/tcg/openrisc/test_lf_ges.c

  • Committer: Ricardo Salveti de Araujo
  • Date: 2012-09-20 18:39:31 UTC
  • mfrom: (12922.1.2 qemu-linaro)
  • Revision ID: ricardo.salveti@linaro.org-20120920183931-sp3cg6kpdl8dmwo9
* New upstream release.
  - support emulated systems with more than 2G of memory. (LP: #1030588)
* Drop powerpc-missing-include.patch - merged upstream.
* Update debian/control:
  - drop perl build dependency.
  - add libfdt-dev build dependency.
* Update debian/qemu-keymaps.install file.
* Update debian/rules:
  - update QEMU_CPU for ARM architecture: armv4l -> armv7l.
  - update conf_audio_drv: default to PulseAudio since PA is the default on
    Ubuntu.
  - enable KVM on ARM architecture.
  - enable flat device tree support (--enable-fdt). (LP: #1030594)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
 
 
3
int main(void)
 
4
{
 
5
    int a, result;
 
6
    float b, c;
 
7
 
 
8
    a = 0;
 
9
    b = 122.5;
 
10
    c = 123.5;
 
11
    result = 0x1;
 
12
    __asm
 
13
    ("lfges:\n\t"
 
14
     "l.addi    %0, %0, 0x1\n\t"
 
15
     "lf.sfge.s %1, %2\n\t"
 
16
     "l.bf      lfges\n\t"
 
17
     "l.nop\n\t"
 
18
     : "+r"(a)
 
19
     : "r"(b), "r"(c)
 
20
    );
 
21
    if (a != result) {
 
22
        printf("lf.sfge.s error\n");
 
23
        return -1;
 
24
    }
 
25
 
 
26
    b = 133.5;
 
27
    c = 13.5;
 
28
    result = 0x3;
 
29
    __asm
 
30
    ("l.addi    %0, %0, 0x1\n\t"
 
31
     "l.addi    %0, %0, 0x1\n\t"
 
32
     "lf.sfge.s %1, %2\n\t"
 
33
     "l.bf      1f\n\t"
 
34
     "l.nop\n\t"
 
35
     "l.addi    %0, %0, 0x1\n\t"
 
36
     "l.addi    %0, %0, 0x1\n\t"
 
37
     "1:\n\t"
 
38
     : "+r"(a)
 
39
     : "r"(b), "r"(c)
 
40
    );
 
41
    if (a != result) {
 
42
        printf("lf.sfge.s error\n");
 
43
        return -1;
 
44
    }
 
45
 
 
46
/*    int a, result;
 
47
    double b, c;
 
48
 
 
49
    a = 0x1;
 
50
    b = 122.5;
 
51
    c = 123.5;
 
52
    result = 0x2;
 
53
    __asm
 
54
    ("lfged:\n\t"
 
55
     "l.addi    %0, %0, 0x1\n\t"
 
56
     "lf.sfge.d %1, %2\n\t"
 
57
     "l.bf      lfged\n\t"
 
58
     "l.nop\n\t"
 
59
     : "+r"(a)
 
60
     : "r"(b), "r"(c)
 
61
    );
 
62
    if (a != result) {
 
63
        printf("lf.sfge.d error\n");
 
64
        return -1;
 
65
    }
 
66
 
 
67
    b = 133.5;
 
68
    c = 13.5;
 
69
    result = 0x4;
 
70
    __asm
 
71
    ("lf.sfge.d %1, %2\n\t"
 
72
     "l.bf      1f\n\t"
 
73
     "l.nop\n\t"
 
74
     "l.addi    %0, %0, 0x1\n\t"
 
75
     "l.addi    %0, %0, 0x1\n\t"
 
76
     "1:\n\t"
 
77
     "l.addi    %0, %0, 0x1\n\t"
 
78
     "l.addi    %0, %0, 0x1\n\t"
 
79
     : "+r"(a)
 
80
     : "r"(b), "r"(c)
 
81
    );
 
82
    if (a != result) {
 
83
        printf("lf.sfge.d error\n");
 
84
        return -1;
 
85
    }*/
 
86
 
 
87
    return 0;
 
88
}