mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hai Shan <haishan.bai@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Fixed Powerpc SPE data type conversion failure
Date: Sun, 14 Nov 2010 12:11:02 +0800	[thread overview]
Message-ID: <1289707863-1768-1-git-send-email-shan.hai@windriver.com> (raw)


The following test case failed on Powerpc e500 with CONFIG_SPE

static float fm;
static signed int si_min = (-2147483647 - 1);
static unsigned int ui;
int main()
{
        fm = (float) si_min; ;
        ui = (unsigned int)fm;

        printf("ui=%d, should be %d\n", ui, si_min);

        return 0;
}

Result: ui=-1, should be -2147483648

The reason is failure to emulate the minus float to unsigned conversion instruction
in the SPE driver.

---
 arch/powerpc/math-emu/math_efp.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)


             reply	other threads:[~2010-11-14  4:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14  4:11 Hai Shan [this message]
2010-11-14  4:11 ` [PATCH] Fix float to unsigned conversion failure with SPE enabled Hai Shan
2010-11-16 11:29   ` Josh Boyer
2010-11-17  1:39     ` haishan

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=1289707863-1768-1-git-send-email-shan.hai@windriver.com \
    --to=haishan.bai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®