On 04/14/2016 04:23 PM, Piotr MasoĊ„ wrote: > > Hi, during debugging of code compiled by means of > OSELAS.Toolchain-2013.12.1/arm-cortexa8-linux-gnueabihf/gcc-4.8.3-glibc-2.18-binutils-2.24-kernel-3.12-sanitized > for procesoor TI AM3558, I get a strange behavoiur for double to float > conversion. > > //cValue.getValue() returns double > float floatValue=static_cast(cValue.getValue()); > > and when cValue.getValue() = 5.0 then after conversion floatValue = > 8.40779079e-45 and it seams, that the conversion doesn't work. > > > when I only add a line with simple assigning to double variable at the > same branch after the conversion line, after compilation, float values > work fine. > > > float floatValue=static_cast(cValue.getValue()); > double doubleValue=cValue.getValue(); > > I get doubleValue = 5.0 and floatValue = 5.0 > > How compiler decides, which instructions of NEON or VFP choose, or does > it use a "hard-float" at all in this case. Why it does work with an > extra line of code with assignig a float value to double value? Can you try a newer compiler? Can you give us a simple compiling test case that illustrates the problem? Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |