mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Marcin Starczewski <MStarczewski@energotest.com.pl>
Subject: Re: [ptxdist] cortex-a8 and not working conversion from double to float
Date: Fri, 15 Apr 2016 11:11:01 +0200	[thread overview]
Message-ID: <5710B025.6030207@pengutronix.de> (raw)
In-Reply-To: <OFAFEE6AF8.6FEF052C-ONC1257F95.004C2F0A-C1257F95.004F1B9C@energotest.com.pl>


[-- 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

           reply	other threads:[~2016-04-15  9:11 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <OFAFEE6AF8.6FEF052C-ONC1257F95.004C2F0A-C1257F95.004F1B9C@energotest.com.pl>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5710B025.6030207@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=MStarczewski@energotest.com.pl \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox