* Re: [ptxdist] cortex-a8 and not working conversion from double to float
[not found] <OFAFEE6AF8.6FEF052C-ONC1257F95.004C2F0A-C1257F95.004F1B9C@energotest.com.pl>
@ 2016-04-15 9:11 ` Marc Kleine-Budde
0 siblings, 0 replies; only message in thread
From: Marc Kleine-Budde @ 2016-04-15 9:11 UTC (permalink / raw)
To: ptxdist; +Cc: Marcin Starczewski
[-- Attachment #1.1.1: Type: text/plain, Size: 1491 bytes --]
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<float>(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<float>(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 |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
[-- Attachment #2: Type: text/plain, Size: 91 bytes --]
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-15 9:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <OFAFEE6AF8.6FEF052C-ONC1257F95.004C2F0A-C1257F95.004F1B9C@energotest.com.pl>
2016-04-15 9:11 ` [ptxdist] cortex-a8 and not working conversion from double to float Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox