[LLVMdev] troubles with llvm-gcc 4.0 and APFloat on X86_64

Dietmar Ebner ebner at complang.tuwien.ac.at
Fri Oct 19 07:23:21 PDT 2007


hi,

i'm trying to make some experiments with the ARM backend (llvm 2.1) and 
therefore built an arm-softfloat-linux-gnu toolchain on x86_64 linux.

however, the llvm-gcc frontend seems to cause troubles with single 
precision floating point values, i.e., they are not converted correctly 
to the particular target format (double precision works as expected).

it seems the problem is related to the following piece of code taken
from APFloat.cpp:1836 (called from ConvertREAL_CST)
	APFloat::APFloat(float f) {
	  APInt api = APInt(32, 0);
	  initFromAPInt(api.floatToBits(f));
	}

i guess the floatToBits call will return the wrong half word since ints 
are 4, but float and double are both 8 byte on x86_64 (but i'm not yet 
sure).

is anybody having the same kind of problems or is there an official 
patch for this issue? is llvm-gcc known to work as a cross compiler on 
x86_64 for 32 bit targets and/or arm in particular?

thanks in advance,

-
dietmar


-- 
Dietmar Ebner
CD Laboratory - Compilation Techniques for Embedded Processors
Institut fuer Computersprachen  E: ebner at complang.tuwien.ac.at
Technische Universitaet Wien    T: (+431) 58801-18598
Argentinierstrasse 8 / E1851    F: (+431) 58801-58521
1040 Wien, Austria              W: www.complang.tuwien.ac.at/cd/ebner



More information about the llvm-dev mailing list