software: use the Clang/LLVM compiler
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 7 Feb 2012 11:52:34 +0000 (12:52 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 7 Feb 2012 11:52:34 +0000 (12:52 +0100)
software/include.mak
software/libbase/softfloat-glue.c

index e7129063c3da09841cd53a30b43ce5ac05124fdc..9eba9ec1562dc41b0433f18b605314d3e68f8a51 100644 (file)
@@ -1,15 +1,16 @@
 # Mico32 toolchain
 #
 CROSS_COMPILER=lm32-rtems4.11-
+CLANG=clang -ccc-host-triple mico32-generic-generic -ccc-gcc-name $(CROSS_COMPILER)gcc
 
-CC_normal := $(CROSS_COMPILER)gcc
+CC_normal := $(CLANG)
 AR_normal := $(CROSS_COMPILER)ar
 AS_normal := $(CROSS_COMPILER)as
 LD_normal := $(CROSS_COMPILER)ld
 OBJCOPY_normal := $(CROSS_COMPILER)objcopy
 RANLIB_normal := $(CROSS_COMPILER)ranlib
 
-CC_quiet = @echo " CC " $@ && $(CROSS_COMPILER)gcc
+CC_quiet = @echo " CC " $@ && $(CLANG)
 AR_quiet = @echo " AR " $@ && $(CROSS_COMPILER)ar
 AS_quiet = @echo " AS " $@ && $(CROSS_COMPILER)as
 LD_quiet = @echo " LD " $@ && $(CROSS_COMPILER)ld
@@ -39,9 +40,7 @@ INCLUDES = $(INCLUDES_NOLIBC) -I$(M2DIR)/software/include -I$(M2DIR)/tools
 ASFLAGS = $(INCLUDES) -nostdinc
 # later: -Wmissing-prototypes
 CFLAGS = -O9 -Wall -Wstrict-prototypes -Wold-style-definition -Wshadow \
-        -mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled \
-        -msign-extend-enabled -fno-builtin -fsigned-char \
-        -fsingle-precision-constant $(INCLUDES)
+        -fsigned-char $(INCLUDES)
 LDFLAGS = -nostdlib -nodefaultlibs
 
 # compile and generate dependencies, based on
index 2d7f2055074556a4549aa663d70bac7a7a9af4de..bb2259e212556ec2918ab4d57d9bd26f1bf4628d 100644 (file)
@@ -123,3 +123,13 @@ unsigned int __fixunssfsi(float32 x)
        return float32_to_int32_round_to_zero(x); // XXX
 }
 
+int __unordsf2(float32 a, float32 b)
+{
+       /*
+        * The comparison is unordered if either input is a NaN.
+        * Test for this by comparing each operand with itself.
+        * We must perform both comparisons to correctly check for
+        * signalling NaNs.
+        */
+       return 1 ^ (float32_eq(a, a) & float32_eq(b, b));
+}