From owner-svn-src-head@FreeBSD.ORG Mon Jan 16 04:05:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84EC9106567B; Mon, 16 Jan 2012 04:05:54 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EDB28FC1E; Mon, 16 Jan 2012 04:05:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G45srn014583; Mon, 16 Jan 2012 04:05:54 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G45sYK014577; Mon, 16 Jan 2012 04:05:54 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201160405.q0G45sYK014577@svn.freebsd.org> From: David Schultz Date: Mon, 16 Jan 2012 04:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230189 - in head/lib/libc: arm/softfloat mips/softfloat softfloat softfloat/bits32 softfloat/bits64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 04:05:54 -0000 Author: das Date: Mon Jan 16 04:05:53 2012 New Revision: 230189 URL: http://svn.freebsd.org/changeset/base/230189 Log: Convert softfloat to use the standard exception flag and rounding macros in fenv.h instead of the non-standard and incomplete ones in ieeefp.h. Thanks to Ian Lepore for testing this patch. Modified: head/lib/libc/arm/softfloat/softfloat.h head/lib/libc/mips/softfloat/softfloat.h head/lib/libc/softfloat/bits32/softfloat.c head/lib/libc/softfloat/bits64/softfloat.c head/lib/libc/softfloat/softfloat-specialize Modified: head/lib/libc/arm/softfloat/softfloat.h ============================================================================== --- head/lib/libc/arm/softfloat/softfloat.h Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/arm/softfloat/softfloat.h Mon Jan 16 04:05:53 2012 (r230189) @@ -45,7 +45,7 @@ the `FLOAT128' macro and the quadruple-p /* #define FLOATX80 */ /* #define FLOAT128 */ -#include +#include /* ------------------------------------------------------------------------------- @@ -84,12 +84,12 @@ enum { Software IEC/IEEE floating-point rounding mode. ------------------------------------------------------------------------------- */ -extern fp_rnd_t float_rounding_mode; +extern int float_rounding_mode; enum { - float_round_nearest_even = FP_RN, - float_round_to_zero = FP_RZ, - float_round_down = FP_RM, - float_round_up = FP_RP + float_round_nearest_even = FE_TONEAREST, + float_round_to_zero = FE_TOWARDZERO, + float_round_down = FE_DOWNWARD, + float_round_up = FE_UPWARD }; /* @@ -97,14 +97,14 @@ enum { Software IEC/IEEE floating-point exception flags. ------------------------------------------------------------------------------- */ -extern fp_except float_exception_flags; -extern fp_except float_exception_mask; +extern int float_exception_flags; +extern int float_exception_mask; enum { - float_flag_inexact = FP_X_IMP, - float_flag_underflow = FP_X_UFL, - float_flag_overflow = FP_X_OFL, - float_flag_divbyzero = FP_X_DZ, - float_flag_invalid = FP_X_INV + float_flag_inexact = FE_INEXACT, + float_flag_underflow = FE_UNDERFLOW, + float_flag_overflow = FE_OVERFLOW, + float_flag_divbyzero = FE_DIVBYZERO, + float_flag_invalid = FE_INVALID }; /* @@ -113,7 +113,7 @@ Routine to raise any or all of the softw exception flags. ------------------------------------------------------------------------------- */ -void float_raise( fp_except ); +void float_raise( int ); /* ------------------------------------------------------------------------------- Modified: head/lib/libc/mips/softfloat/softfloat.h ============================================================================== --- head/lib/libc/mips/softfloat/softfloat.h Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/mips/softfloat/softfloat.h Mon Jan 16 04:05:53 2012 (r230189) @@ -45,7 +45,7 @@ the `FLOAT128' macro and the quadruple-p /* #define FLOATX80 */ /* #define FLOAT128 */ -#include +#include /* ------------------------------------------------------------------------------- @@ -84,12 +84,12 @@ enum { Software IEC/IEEE floating-point rounding mode. ------------------------------------------------------------------------------- */ -extern fp_rnd_t float_rounding_mode; +extern int float_rounding_mode; enum { - float_round_nearest_even = FP_RN, - float_round_to_zero = FP_RZ, - float_round_down = FP_RM, - float_round_up = FP_RP + float_round_nearest_even = FE_TONEAREST, + float_round_to_zero = FE_TOWARDZERO, + float_round_down = FE_DOWNWARD, + float_round_up = FE_UPWARD }; /* @@ -97,14 +97,14 @@ enum { Software IEC/IEEE floating-point exception flags. ------------------------------------------------------------------------------- */ -extern fp_except float_exception_flags; -extern fp_except float_exception_mask; +extern int float_exception_flags; +extern int float_exception_mask; enum { - float_flag_inexact = FP_X_IMP, - float_flag_underflow = FP_X_UFL, - float_flag_overflow = FP_X_OFL, - float_flag_divbyzero = FP_X_DZ, - float_flag_invalid = FP_X_INV + float_flag_inexact = FE_INEXACT, + float_flag_underflow = FE_UNDERFLOW, + float_flag_overflow = FE_OVERFLOW, + float_flag_divbyzero = FE_DIVBYZERO, + float_flag_invalid = FE_INVALID }; /* @@ -113,7 +113,7 @@ Routine to raise any or all of the softw exception flags. ------------------------------------------------------------------------------- */ -void float_raise( fp_except ); +void float_raise( int ); /* ------------------------------------------------------------------------------- Modified: head/lib/libc/softfloat/bits32/softfloat.c ============================================================================== --- head/lib/libc/softfloat/bits32/softfloat.c Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/softfloat/bits32/softfloat.c Mon Jan 16 04:05:53 2012 (r230189) @@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$"); Floating-point rounding mode and exception flags. ------------------------------------------------------------------------------- */ -fp_rnd_t float_rounding_mode = float_round_nearest_even; -fp_except float_exception_flags = 0; +int float_rounding_mode = float_round_nearest_even; +int float_exception_flags = 0; /* ------------------------------------------------------------------------------- Modified: head/lib/libc/softfloat/bits64/softfloat.c ============================================================================== --- head/lib/libc/softfloat/bits64/softfloat.c Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/softfloat/bits64/softfloat.c Mon Jan 16 04:05:53 2012 (r230189) @@ -71,8 +71,8 @@ Floating-point rounding mode, extended d and exception flags. ------------------------------------------------------------------------------- */ -fp_rnd_t float_rounding_mode = float_round_nearest_even; -fp_except float_exception_flags = 0; +int float_rounding_mode = float_round_nearest_even; +int float_exception_flags = 0; #ifdef FLOATX80 int8 floatx80_rounding_precision = 80; #endif Modified: head/lib/libc/softfloat/softfloat-specialize ============================================================================== --- head/lib/libc/softfloat/softfloat-specialize Mon Jan 16 04:04:35 2012 (r230188) +++ head/lib/libc/softfloat/softfloat-specialize Mon Jan 16 04:05:53 2012 (r230189) @@ -58,8 +58,8 @@ substitute a result value. If traps are should be simply `float_exception_flags |= flags;'. ------------------------------------------------------------------------------- */ -fp_except float_exception_mask = 0; -void float_raise( fp_except flags ) +int float_exception_mask = 0; +void float_raise( int flags ) { float_exception_flags |= flags;