1#include <stdio.h>
2
3int main(void)
4{
5 int a, result;
6 float b, c;
7
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)
21 );
22 if (a != result) {
23 printf("lf.sfeq.s error\n");
24 return -1;
25 }
26
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)
38 );
39 if (a != result) {
40 printf("lf.sfeq.s error\n");
41 return -1;
42 }
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87 return 0;
88}
89