arm host: Fix compiler warning
PATCH 1/14 arm host: Fix compiler warning
Compilation for arm (native or cross) results in this warning:
fpu/softfloat-native.c: In function ‘float64_round_to_int’:fpu/softfloat-native.c:387: error: control reaches end of non-void function
float64_round_to_int uses special assembler code for arm and has no explicit return value.
As there is no obvious reason why arm should need special code, all fpu related conditionals were removed. The remaining code is standard (C99) and compiles for arm, too.
--- fpu/softfloat-native.c | 20 -------------------- fpu/softfloat-native.h | 7 ------- 2 files changed, 0 insertions(+), 27 deletions(-)
fpu/softfloat-native.c +0 -20
@@ -12,8 +12,6 @@ void set_float_rounding_mode(int val STATUS_PARAM)#if (defined(CONFIG_BSD ) && !defined(__APPLE__) && !defined(__GLIBC__)) || \ (defined(CONFIG_SOLARIS ) &&CONFIG_SOLARIS_VERSION <10 )fpsetround (val); -#elif defined(__arm__) -/* nothing to do */ #else fesetround (val);#endif
@@ -365,25 +363,7 @@ float64 float64_trunc_to_int( float64 a STATUS_PARAM ) float64 float64_round_to_int( float64 a STATUS_PARAM ) { -#if defined(__arm__) -switch (STATUS (float_rounding_mode)) { -default : -case float_round_nearest_even: - asm("rndd %0, %1" :"=f" (a) :"f" (a)); -break ; -case float_round_down: - asm("rnddm %0, %1" :"=f" (a) :"f" (a)); -break ; -case float_round_up: - asm("rnddp %0, %1" :"=f" (a) :"f" (a)); -break ; -case float_round_to_zero: - asm("rnddz %0, %1" :"=f" (a) :"f" (a)); -break ; - } -#else return rint (a); -#endif } float64 float64_rem( float64 a, float64 b STATUS_PARAM)
fpu/softfloat-native.h +0 -7
@@ -126,13 +126,6 @@ enum { float_round_up =FP_RP , float_round_to_zero =FP_RZ }; -#elif defined(__arm__) -enum { - float_round_nearest_even =0 , - float_round_down =1 , - float_round_up =2 , - float_round_to_zero =3 -};#else enum { float_round_nearest_even = FE_TONEAREST,
Signature · 1 line
1.6.5
Quoted 14 lines · Stefan Weil
Compilation for arm (native or cross) results in this warning:
fpu/softfloat-native.c: In function ‘float64_round_to_int’:fpu/softfloat-native.c:387: error: control reaches end of non-void function
float64_round_to_intuses special assembler code for arm and has no explicit return value.As there is no obvious reason why arm should need special code, all fpu related conditionals were removed. The remaining code is standard (C99) and compiles for arm, too.
Quoted 6 lines
Signed-off-by Stefan Weil <[email protected]>--- fpu/softfloat-native.c | 20 -------------------- fpu/softfloat-native.h | 7 ------- 2 files changed, 0 insertions(+), 27 deletions(-)
The "subject" line was wrong: the patch is complete and can be applied as it is.
I'm sorry if I created confusion.
Stefan Weil
Quoted 9 lines · Stefan Weil
Compilation for arm (native or cross) results in this warning:
fpu/softfloat-native.c: In function ‘float64_round_to_int’:fpu/softfloat-native.c:387: error: control reaches end of non-void function
float64_round_to_intuses special assembler code for arm and has no explicit return value.
Quoted 6 lines
As there is no obvious reason why arm should need special code, all fpu related conditionals were removed. The remaining code is standard (C99) and compiles for arm, too.
Signed-off-by Stefan Weil <[email protected]>
Laurent
Quoted 68 lines
---
fpu/softfloat-native.c | 20 --------------------fpu/softfloat-native.h| 7 -------2 files changed, 0 insertions(+), 27 deletions(-)fpu/softfloat-native.c +0
-20@@ -12,8 +12,6 @@ void set_float_rounding_mode(int val STATUS_PARAM) #if (defined(CONFIG_BSD) && !defined(__APPLE__) && !defined(__GLIBC__)) || \ (defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10) fpsetround(val); -#elif defined(__arm__) - /* nothing to do */ #else fesetround(val); #endif@@ -365,25 +363,7 @@ float64 float64_trunc_to_int( float64 a STATUS_PARAM ) float64 float64_round_to_int( float64 a STATUS_PARAM ) { -#if defined(__arm__) - switch(STATUS(float_rounding_mode)) { - default: - case float_round_nearest_even: - asm("rndd %0, %1" : "=f" (a) : "f"(a)); - break; - case float_round_down: - asm("rnddm %0, %1" : "=f" (a) : "f"(a)); - break; - case float_round_up: - asm("rnddp %0, %1" : "=f" (a) : "f"(a)); - break; - case float_round_to_zero: - asm("rnddz %0, %1" : "=f" (a) : "f"(a)); - break; - } -#else return rint(a); -#endif } float64 float64_rem( float64 a, float64 b STATUS_PARAM)fpu/softfloat-native.h +0
-0@@ -126,13 +126,6 @@ enum { float_round_up = FP_RP,
float_round_to_zero=FP_RZ
};fpu/softfloat-native.h +0
-7-#elif defined(__arm__) -enum { - float_round_nearest_even = 0, - float_round_down = 1, - float_round_up = 2, - float_round_to_zero = 3 -};#else
enum {
float_round_nearest_even=FE_TONEAREST,
--
1.6.5
Quoted 6 lines · Stefan Weil
Compilation for arm (native or cross) results in this warning:
fpu/softfloat-native.c: In function ‘float64_round_to_int’:fpu/softfloat-native.c:387: error: control reaches end of non-void function
Quoted 7 lines
float64_round_to_intuses special assembler code for arm and has no explicit return value.As there is no obvious reason why arm should need special code, all fpu related conditionals were removed. The remaining code is standard (C99) and compiles for arm, too.
The reason for this special code is that ARM old ABI does not have the FE_* constants defined. Only EABI is supported since the switch to TCG, so this is not a problem removing that code.
Patch applied.
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net