[Qemu-devel] [Bug 1728325] Re: POWER8: Wrong behaviour with float-to-int punning

2017-10-31 Thread Iain Buclaw
The original code used a union. It generates the same assembler all the same. ** Changed in: qemu Status: Invalid => New -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1728325 Title: POWER8

[Qemu-devel] [Bug 1728325] Re: POWER8: Wrong behaviour with float-to-int punning

2017-10-28 Thread Iain Buclaw
I am running: qemu-ppc64le-static -L /usr/powerpc64le-linux-gnu ./a.out -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1728325 Title: POWER8: Wrong behaviour with float-to-int punning Status in QE

[Qemu-devel] [Bug 1728325] [NEW] POWER8: Wrong behaviour with float-to-int punning

2017-10-28 Thread Iain Buclaw
Public bug reported: Building a reduced test program with 'gcc -O2 -fno-inline -mcpu=power8' produces wrong results at runtime. I don't think gcc is at fault here. --- #include int getWord(const float x) { return *(int*)&x; } void main() { int foo = getWord(+123.456f); int bar = getW