[LLVMdev] Stange behavior in fp arithmetics on x86 (bug possibly)
joerg at britannica.bec.de
Tue Oct 7 11:45:29 PDT 2014
On Tue, Oct 07, 2014 at 09:50:37PM +0400, Dmitry Borisenkov wrote:
> I'm not an expert neither in llvm nor in x86 nor in IEEE standard for
> floating point numbers, thus any of my following assumptions maybe wrong. If
> so, I will be grateful if you clarify me what's goes wrong. But if my
> guesses are correct we possibly have a bug in fp arithmetics on x86.
Are you targetting the same backend? i386 (32bit mode) uses FPU registers
for argument passing and return values, x86_64 / amd64 (64bit mode) uses
SSE registers for float/double values and FPU registers for long double.
The error on retl makes me think the second example is compiled for
i386, while the first example looks more like x86_64.
More information about the llvm-dev