1#include <stdio.h>
2
3int main(void)
4{
5 int a;
6 float b, c;
7 int result;
8
9 a = 0;
10 b = 1234.2;
11 c = 12.4;
12 result = 0x1;
13 __asm
14 ("lfles:\n\t"
15 "l.addi %0, %0, 0x1\n\t"
16 "lf.sfle.s %1, %2\n\t"
17 "l.bf lfles\n\t"
18 "l.nop\n\t"
19 : "+r"(a)
20 : "r"(b), "r"(c)
21 );
22 if (a != result) {
23 printf("lf.sfle.s error\n");
24 return -1;
25 }
26
27 b = 1.1;
28 c = 19.4;
29 result = 0x3;
30 __asm
31 ("l.addi %0, %0, 0x1\n\t"
32 "l.addi %0, %0, 0x1\n\t"
33 "lf.sfle.s %1, %2\n\t"
34 "l.bf 1f\n\t"
35 "l.nop\n\t"
36 "l.addi %0, %0, 0x1\n\t"
37 "l.addi %0, %0, 0x1\n\t"
38 "1:\n\t"
39 : "+r"(a)
40 : "r"(b), "r"(c)
41 );
42 if (a != result) {
43 printf("lf.sfle.s error\n");
44 return -1;
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