Merge tag 'v9.1.0'
[qemu/ar7.git] / tests / tcg / openrisc / test_lf_eqs.c
bloba176bd6fe0aae661bce74a1ef11f72d6699931ca
1 #include <stdio.h>
3 int main(void)
5 int a, result;
6 float b, c;
8 a = 0x1;
9 b = 122.5;
10 c = 123.5;
11 result = 0x3;
12 __asm
13 ("lfeqd:\n\t"
14 "l.addi %0, %0, 0x1\n\t"
15 "lf.sfeq.s %1, %2\n\t"
16 "l.bf lfeqd\n\t"
17 "l.nop\n\t"
18 "l.addi %0, %0, 0x1\n\t"
19 : "+r"(a)
20 : "r"(b), "r"(c)
22 if (a != result) {
23 printf("lf.sfeq.s error\n");
24 return -1;
27 b = 13.5;
28 c = 13.5;
29 result = 0x3;
30 __asm
31 ("lf.sfeq.s %1, %2\n\t"
32 "l.bf 1f\n\t"
33 "l.nop\n\t"
34 "l.addi r4, r4, 0x1\n\t"
35 "1:\n\t"
36 : "+r"(a)
37 : "r"(b), "r"(c)
39 if (a != result) {
40 printf("lf.sfeq.s error\n");
41 return -1;
44 /* double b, c;
45 double result;
46 int a;
48 a = 0x1;
49 b = 122.5;
50 c = 133.5;
51 result = 0x3;
53 __asm
54 ("lfeqd:\n\t"
55 "l.addi %0, %0, 0x1\n\t"
56 "lf.sfeq.d %1, %2\n\t"
57 "l.bf lfeqd\n\t"
58 "l.nop\n\t"
59 "l.addi %0, %0, 0x1\n\t"
60 : "+r"(a)
61 : "r"(b), "r"(c)
63 if (a != result) {
64 printf("lf.sfeq.d error\n");
65 return -1;
68 double c, d, res;
69 int e = 0;
70 c = 11.5;
71 d = 11.5;
72 res = 1;
73 __asm
74 ("lf.sfeq.d %1, %2\n\t"
75 "l.bf 1f\n\t"
76 "l.nop\n\t"
77 "l.addi %0, %0, 0x1\n\t"
78 "1:\n\t"
79 : "+r"(e)
80 : "r"(c), "r"(d)
82 if (e != res) {
83 printf("lf.sfeq.d error\n");
84 return -1;
85 }*/
87 return 0;