linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fixed Powerpc SPE data type conversion failure
@ 2010-11-14  4:11 Hai Shan
  2010-11-14  4:11 ` [PATCH] Fix float to unsigned conversion failure with SPE enabled Hai Shan
  0 siblings, 1 reply; 4+ messages in thread
From: Hai Shan @ 2010-11-14  4:11 UTC (permalink / raw)
  To: linux-kernel


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(-)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-17  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-14  4:11 Fixed Powerpc SPE data type conversion failure Hai Shan
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).