From 63f6dece5629a0741a18332481dc4152bfbd827b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 7 Feb 2012 12:52:34 +0100 Subject: [PATCH] software: use the Clang/LLVM compiler --- software/include.mak | 9 ++++----- software/libbase/softfloat-glue.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/software/include.mak b/software/include.mak index e7129063..9eba9ec1 100644 --- a/software/include.mak +++ b/software/include.mak @@ -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 diff --git a/software/libbase/softfloat-glue.c b/software/libbase/softfloat-glue.c index 2d7f2055..bb2259e2 100644 --- a/software/libbase/softfloat-glue.c +++ b/software/libbase/softfloat-glue.c @@ -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)); +} -- 2.30.2