Messages in this thread | ![/](/images/icornerl.gif) | | From | Hai Shan <> | Subject | Fixed Powerpc SPE data type conversion failure | Date | Sun, 14 Nov 2010 12:11:02 +0800 |
| |
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(-)
| ![\](/images/icornerr.gif) |