Wind River Support Network

HomeDefectsLIN5-19108
Fixed

LIN5-19108 : CLONE - strtof return error value when set round mode to FE_TOWARDZERO, FE_UPWARD or FE_DOWNWARD

Created: Jul 21, 2014    Updated: Dec 19, 2017
Resolved Date: Jul 24, 2014
Previous ID: LIN4-31588
Found In Version: 5.0.1
Fix Version: 5.0.1.17
Severity: Standard
Applicable for: Wind River Linux 5
Component/s: Toolchain

Description

'strtof' may return error value when set round mode to FE_TOWARDZERO, FE_UPWARD or FE_DOWNWARD. For example, when set round mode to FE_TOWARDZERO, the value of strtof("0x1.ACFD13P-73", NULL) should be 0x1.ACFD12P-73, but it return 0x1.ACFD14p-73.

Steps to Reproduce

1. create project: /WindRiver-4.3/wrlinux-4/wrlinux/../ldat/configure --enable-board=arm_coretile_express_a9x4 --enable-rootfs=glibc_std --enable-kernel=standard --enable-parallel-pkgbuilds=4 --enable-jobs=4 --with-product-dir=/WindRiver-4.3/wrlinux-4/wrlinux
2.compile attached test program -  'float_test.c' to float_test
3.run linux system: make start-target
4.run test program: /float_test, and get result as below:
f_value=0x1.acfd14p-73, f_exp=0x1.acfd12p-73
FE_TOWARDZERO 0x1.ACFD13P-73 should be 0x1.ACFD12P-73
f_value=-0x1.acfd14p-73, f_exp=-0x1.acfd12p-73
FE_TOWARDZERO -0x1.ACFD13P-73 should be -0x1.ACFD12P-73
f_value=0x1.acfd14p-73, f_exp=0x1.acfd14p-73
f_value=-0x1.acfd14p-73, f_exp=-0x1.acfd12p-73
FE_UPWARD -0x1.ACFD13P-73 should be -0x1.ACFD12P-73
f_value=0x1.acfd14p-73, f_exp=0x1.acfd12p-73
FE_DOWNWARD 0x1.ACFD13P-73 should be 0x1.ACFD12P-73
f_value=-0x1.acfd14p-73, f_exp=-0x1.acfd14p-73

5. running the test program in wrlinux 6 will get correct result as below:
f_value=0x1.acfd12p-73, f_exp=0x1.acfd12p-73
f_value=-0x1.acfd12p-73, f_exp=-0x1.acfd12p-73
f_value=0x1.acfd14p-73, f_exp=0x1.acfd14p-73
f_value=-0x1.acfd12p-73, f_exp=-0x1.acfd12p-73
f_value=0x1.acfd12p-73, f_exp=0x1.acfd12p-73
f_value=-0x1.acfd14p-73, f_exp=-0x1.acfd14p-73

Other Downloads


Live chat
Online