[LLVMdev] Stange behavior in fp arithmetics on x86 (bug possibly)

Dmitry Borisenkov d.borisenkov at samsung.com
Wed Oct 8 01:36:04 PDT 2014

Hi, Joerg

Both of the examples were compiled ./llc -march=x86 -O3 fpfail.ll (i386).
I've double checked it.

Kind regards, Dmitry Borisenkov

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Joerg Sonnenberger
Sent: Tuesday, October 07, 2014 10:45 PM
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Stange behavior in fp arithmetics on x86 (bug

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

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.

LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu

More information about the llvm-dev mailing list