From: Jan-Benedict G. <jb...@us...> - 2005-09-30 09:12:29
|
Update of /cvsroot/linux-vax/toolchain/patches In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27098 Added Files: uclibc-000007-nonnegative_floats_config_option.patch uclibc-000008-config-nonnegative-floats.patch Log Message: - uclibc-000007: Don't try to find out if a zero float value is +0 or -1. This is done by dividing 1.0/x , which'll generate a floating point exception being signaled to the application (which crashes then :-) - uclibc-000008: Use the new config option. --- NEW FILE: uclibc-000008-config-nonnegative-floats.patch --- diff -Nurp src-uclibc-fresh/.config src-uclibc-hacked/.config --- src-uclibc-fresh/.config 2005-09-30 10:09:20.000000000 +0200 +++ src-uclibc-hacked/.config 2005-09-30 10:15:16.000000000 +0200 @@ -35,6 +35,7 @@ ARCH_LITTLE_ENDIAN=y # ARCH_HAS_NO_MMU is not set ARCH_HAS_MMU=y UCLIBC_HAS_FLOATS=y +# TARGET_HAS_NEGATIVE_ZERO_FLOATS is not set HAS_FPU=y DO_C99_MATH=y C_SYMBOL_PREFIX="" --- NEW FILE: uclibc-000007-nonnegative_floats_config_option.patch --- diff -Nurp src-uclibc-fresh/extra/Configs/Config.in.arch src-uclibc-hacked/extra/Configs/Config.in.arch --- src-uclibc-fresh/extra/Configs/Config.in.arch 2005-06-05 18:39:50.000000000 +0200 +++ src-uclibc-hacked/extra/Configs/Config.in.arch 2005-09-30 10:14:36.000000000 +0200 @@ -28,8 +28,8 @@ config ARCH_HAS_MMU default y depends !ARCH_HAS_NO_MMU help - If your target CPU does not have a memory management unit (MMU), - then answer N here. Normally, Linux runs on systems with an MMU. + If your target CPU does not have a memory management unit (MMU), + then answer N here. Normally, Linux runs on systems with an MMU. If you are building a uClinux system, answer N. Most people will answer Y. @@ -40,13 +40,24 @@ config UCLIBC_HAS_FLOATS help This option allows you to entirely omit all floating point number support from uClibc. This will cause floating point functions like - strtod() to be omitted from uClibc. Other floating point functions, - such as printf() and scanf() will still be included in the library, + strtod() to be omitted from uClibc. Other floating point functions, + such as printf() and scanf() will still be included in the library, but will not contain support for floating point numbers. Answering N to this option can reduce the size of uClibc. Most people will answer Y. +config TARGET_HAS_NEGATIVE_ZERO_FLOATS + bool " Target CPU differs between +0 and -0" + default y + depends on UCLIBC_HAS_FLOATS + help + If your target CPU can differ +0 and -0 (IEEE floating point + support works that way), then you should enable this option. + + Most people will answer Y, because nearly all CPUs do use IEEE + floating point support. + config HAS_FPU bool "Target CPU has a floating point unit (FPU)" depends on UCLIBC_HAS_FLOATS @@ -77,7 +88,7 @@ config DO_C99_MATH listed as part of the traditional POSIX/IEEE 1003.1b-1993 standard. Leaving this option set to N will save around 35k on an x86 system. - If your applications require the newer C99 math library functions, + If your applications require the newer C99 math library functions, then answer Y. config KERNEL_SOURCE diff -Nurp src-uclibc-fresh/libc/stdio/_fpmaxtostr.c src-uclibc-hacked/libc/stdio/_fpmaxtostr.c --- src-uclibc-fresh/libc/stdio/_fpmaxtostr.c 2005-07-30 22:29:22.000000000 +0200 +++ src-uclibc-hacked/libc/stdio/_fpmaxtostr.c 2005-09-30 10:20:42.000000000 +0200 @@ -17,7 +17,7 @@ typedef size_t (__fp_outfunc_t)(FILE *fp /* Copyright (C) 2000, 2001, 2003 Manuel Novoa III * - * Function: + * Function: * * size_t _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info *info, * __fp_outfunc_t fp_outfunc); @@ -183,7 +183,7 @@ static const __fpmax_t exp16_table[] = { #if FPMAX_MAX_EXP >= 16384 0x1.0p16384L #endif -#if FPMAX_MAX_EXP >= 32768 +#if FPMAX_MAX_EXP >= 32768 #error unsupported FPMAX_MAX_EXP. please increase table #endif }; @@ -275,7 +275,7 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t } if (x == 0) { /* Handle 0 now to avoid false positive. */ -#if 1 +#ifdef __TARGET_HAS_NEGATIVE_ZERO_FLOATS__ if (zeroisnegative(x)) { /* Handle 'signed' zero. */ *sign_str = '-'; } @@ -323,14 +323,14 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t base = 16; } else { lower_bnd = 1e8; - /* upper_bnd = 1e9; */ + /* upper_bnd = 1e9; */ power_table = exp10_table; exp = DIGITS_PER_BLOCK - 1; i = EXP10_TABLE_SIZE; j = EXP10_TABLE_MAX; - /* dpb = DIGITS_PER_BLOCK; */ - /* ndb = NUM_DIGIT_BLOCKS; */ - /* base = 10; */ + /* dpb = DIGITS_PER_BLOCK; */ + /* ndb = NUM_DIGIT_BLOCKS; */ + /* base = 10; */ } @@ -406,7 +406,7 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t if (mode < 'a') { *exp_buf -= ('a' - 'A'); /* e->E and p->P */ mode += ('a' - 'A'); - } + } o_mode = mode; if ((mode == 'g') && (preci > 0)){ @@ -446,7 +446,7 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t #ifdef __UCLIBC_HAS_HEXADECIMAL_FLOATS__ if ((mode|0x20) == 'a') { char *q; - + for (q = e ; *q ; --q) { if (*q > '9') { *q += (*exp_buf - ('p' - 'a') - '9' - 1); @@ -694,12 +694,12 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t cnt += num_groups * tslen; /* Adjust count now for sep chars. */ -/* printf("\n"); */ +/* printf("\n"); */ do { if (!blk) { /* Initial group could be 0 digits long! */ blk = nblk2; } else if (len >= blk) { /* Enough digits for a group. */ -/* printf("norm: len=%d blk=%d \"%.*s\"\n", len, blk, blk, gp); */ +/* printf("norm: len=%d blk=%d \"%.*s\"\n", len, blk, blk, gp); */ if (fp_outfunc(fp, *ppc, blk, (intptr_t) gp) != blk) { return -1; } @@ -709,9 +709,9 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t } len -= blk; } else { /* Transition to 0s. */ -/* printf("trans: len=%d blk=%d \"%.*s\"\n", len, blk, len, gp); */ +/* printf("trans: len=%d blk=%d \"%.*s\"\n", len, blk, len, gp); */ if (len) { -/* printf("len\n"); */ +/* printf("len\n"); */ if (fp_outfunc(fp, *ppc, len, (intptr_t) gp) != len) { return -1; } @@ -719,7 +719,7 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t } if (ppc[3] == FPO_ZERO_PAD) { /* Need to group 0s */ -/* printf("zeropad\n"); */ +/* printf("zeropad\n"); */ cnt += ppc[1]; ppc += 3; gp = (const char *) ppc[2]; @@ -742,7 +742,7 @@ ssize_t _fpmaxtostr(FILE * fp, __fpmax_t } blk = nblk2; -/* printf("num_groups=%d blk=%d\n", num_groups, blk); */ +/* printf("num_groups=%d blk=%d\n", num_groups, blk); */ } while (1); } else |