[LLVMdev] cross compiling for arm-softfloat-linux-gnu (was troubles with llvm-gcc 4.0 and APFloat on X86_64)

Dietmar Ebner ebner at complang.tuwien.ac.at
Wed Oct 24 06:05:17 PDT 2007


hi,

Chris Lattner wrote:
> On Mon, 22 Oct 2007, Dale Johannesen wrote:
>> In principle I think keeping IEEE float and double in an endian- 
>> independent form in the IR files is a good idea.  BUT: I'm told 
>> retaining the ability to use files in the existing format is a 
>> requirement (so floats still need to occupy 8 bytes).  Since ARM target 
>> doesn't currently work that one is a reasonable exception IMO, but 
>> changing the format for x86, for example, would not be greeted with joy.
> 
> Yep this is a good way of putting it.  Also, if you want to *add* a target 
> data specifier to capture FP endianness (in the target memory, not in the 
> IR files) that would be just fine,
ok, here's a patch (see attachment). credits for preparing it go to 
florian brandner. there's a new flag n/N in addition to e vs. E, e.g., 
e-N-p:32:32-f64:64:64-i64..., that is used to encode FP endianess and 
which is used to get constants right in the backend. in it's absence 
it's initialized to be the same as integer endianess.

you'll also need another patch for llvm-gcc to dump the constants in 
host format and link the softfloat library into libgcc. all patches 
should apply cleanly to the 2.1 release.

the changes are moderate and appear to work quite well. however, i 
wouldn't  advocate to apply it as it is to llvm. it still needs some 
testing and i think it's better to get the endianess issue right once 
and for all by defining a host and target independent format for bitcode 
  that's used throughout the framework.

thanks for your help! cheers,

-
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-2.1-softfloat-endianess.patch
Type: text/x-patch
Size: 10123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071024/85438b05/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-gcc-2.1-softfloat-endianess.patch
Type: text/x-patch
Size: 2054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20071024/85438b05/attachment-0001.bin>


More information about the llvm-dev mailing list