From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: References: From: Marc Kleine-Budde Message-ID: <5710B025.6030207@pengutronix.de> Date: Fri, 15 Apr 2016 11:11:01 +0200 MIME-Version: 1.0 In-Reply-To: Subject: Re: [ptxdist] cortex-a8 and not working conversion from double to float List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: multipart/mixed; boundary="===============1167215293==" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Marcin Starczewski This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============1167215293== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DsHFUMkqDwc5ldk9wM7EfmIgJOg6aBOvp" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DsHFUMkqDwc5ldk9wM7EfmIgJOg6aBOvp Content-Type: multipart/mixed; boundary="fSTQ91AKG0MdwO7ct59BRnkMU6f0vk5FM" From: Marc Kleine-Budde To: ptxdist@pengutronix.de Cc: Marcin Starczewski Message-ID: <5710B025.6030207@pengutronix.de> Subject: Re: [ptxdist] cortex-a8 and not working conversion from double to float References: In-Reply-To: --fSTQ91AKG0MdwO7ct59BRnkMU6f0vk5FM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/14/2016 04:23 PM, Piotr Maso=C5=84 wrote: >=20 > 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. >=20 > //cValue.getValue() returns double > float floatValue=3Dstatic_cast(cValue.getValue()); >=20 > and when cValue.getValue() =3D 5.0 then after conversion floatValue =3D= > 8.40779079e-45 and it seams, that the conversion doesn't work. >=20 >=20 > 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. >=20 >=20 > float floatValue=3Dstatic_cast(cValue.getValue()); > double doubleValue=3DcValue.getValue(); >=20 > I get doubleValue =3D 5.0 and floatValue =3D 5.0 >=20 > 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 --=20 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 | --fSTQ91AKG0MdwO7ct59BRnkMU6f0vk5FM-- --DsHFUMkqDwc5ldk9wM7EfmIgJOg6aBOvp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJXELAlAAoJED07qiWsqSVq8E4IAIy6Dmzmgrd4r/bsnO9T+CA/ Z/Ty6s6f3+c9FuoY1hFlEzuB2YVv7fxZCgpd2TpP+aVVAGOIySCRDnVAt7xK9OcT m5dxdg2qZ9qQ7MpP41Q/Wi1LM6D0I1S7US4Vtwr2RRw9UEpA+h8fk9BvoOvITWV1 zmTeAnvOH4zbTwXfh30gl5AEshd6u2UiA6dZDXkXbLRv60t0olVcpPpMoKBhYdxJ S1WfxeYbIt6LD2mSR7DPTIEKzrueCvgd5ZoUnYzdXnYp3vmuKXeoBGG6vcHnkcDv Rbm7BeWr6hF0VOOUbRfmcuL3bZTeyfSsmZ7o+3vxVdQWKFRDCPl3Ee5GnaA/a9w= =yYwF -----END PGP SIGNATURE----- --DsHFUMkqDwc5ldk9wM7EfmIgJOg6aBOvp-- --===============1167215293== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KcHR4ZGlzdCBt YWlsaW5nIGxpc3QKcHR4ZGlzdEBwZW5ndXRyb25peC5kZQ== --===============1167215293==--