Fixed Powerpc SPE data type conversion failure

From: Hai Shan
Date: Sat Nov 13 2010 - 23:11:37 EST



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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/