Not to be fixed
Created: Apr 24, 2013
Updated: Apr 19, 2018
Resolved Date: Apr 17, 2018
Previous ID: LIN4-7022
Found In Version: 6.0
Severity: Critical
Applicable for: Wind River Linux 6
Component/s: BSP
Run on p2041hfp board, result: [PASS]
MCCA-minh /tmp # ./float_mcca
result = 0x1.7ffffcp+127, expect = 0x1.7ffffcp+127
except-flag: 0
Run on p1010hfp board, result: [FAIL]
P1010-minh /tmp # ./float_p1010
result = 0x1.7ffffep+127, expect = 0x1.7ffffcp+127
except-flag: 0
1project config see attachment.
2 test code:
2 #include <stdio.h>
3 #include <fenv.h>
4
5 int main()
6 {
7 fexcept_t flagp_temp = 0;
8 float result = 0;
9 float tmp1, tmp2;
10 int ret;
11
12 //b32/ > -1.7FFFFCP83 -1.000000P-44 -> +1.7FFFFCP127
13
14 /* clear exceptions */
15 ret = feclearexcept(FE_ALL_EXCEPT);
16 if(ret != 0)
17 {
18 printf("feclearexcept FE_ALL_EXCEPT fail \n");
19 return 1;
20 }
21
22 /* set rounding_mode : ">" */
23 ret = fesetround(FE_UPWARD);
24 if(ret != 0)
25 {
26 printf("fesetround FE_UPWARD fail \n");
27 return 1;
28 }
29
30 tmp1 = -0x1.7FFFFCP83;
31 tmp2 = -0x1.000000P-44;
32 result = tmp1 / tmp2;
33
34 /* get exceptions */
35 ret = fegetexceptflag(&flagp_temp, FE_ALL_EXCEPT);
36 if(ret != 0)
37 {
38 printf("fegetexceptflag fail.\n");
39 return 1;
40 }
41
42 printf("result = %0.6a, expect = %0.6a\n", result, 0x1.7FFFFCP127);
43 printf("except-flag: %d\n", flagp_temp);
44
45 return 0;
46 }
3
Run on p2041hfp board, result: [PASS]
MCCA-minh /tmp # ./float_mcca
result = 0x1.7ffffcp+127, expect = 0x1.7ffffcp+127
except-flag: 0
Run on p1010hfp board, result: [FAIL]
P1010-minh /tmp # ./float_p1010
result = 0x1.7ffffep+127, expect = 0x1.7ffffcp+127
except-flag: 0