Date: Sun, 17 Feb 2008 20:41:35 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 135589 for review Message-ID: <200802172041.m1HKfZCj077535@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=135589 Change 135589 by marcel@marcel_xcllnt on 2008/02/17 20:41:34 IFC @135588 Affected files ... .. //depot/projects/e500/etc/mail/access.sample#2 integrate .. //depot/projects/e500/etc/sendmail/freebsd.mc#3 integrate .. //depot/projects/e500/lib/libc/stdlib/malloc.3#6 integrate .. //depot/projects/e500/lib/libc/stdlib/malloc.c#8 integrate .. //depot/projects/e500/lib/libmilter/Makefile#2 integrate .. //depot/projects/e500/lib/msun/Makefile#8 integrate .. //depot/projects/e500/lib/msun/Symbol.map#7 integrate .. //depot/projects/e500/lib/msun/ld128/k_cosl.c#1 branch .. //depot/projects/e500/lib/msun/ld128/k_sinl.c#1 branch .. //depot/projects/e500/lib/msun/ld128/k_tanl.c#1 branch .. //depot/projects/e500/lib/msun/ld80/k_cosl.c#1 branch .. //depot/projects/e500/lib/msun/ld80/k_sinl.c#1 branch .. //depot/projects/e500/lib/msun/ld80/k_tanl.c#1 branch .. //depot/projects/e500/lib/msun/man/cos.3#2 integrate .. //depot/projects/e500/lib/msun/man/sin.3#2 integrate .. //depot/projects/e500/lib/msun/man/tan.3#2 integrate .. //depot/projects/e500/lib/msun/src/e_rem_pio2.c#2 integrate .. //depot/projects/e500/lib/msun/src/e_rem_pio2f.c#2 integrate .. //depot/projects/e500/lib/msun/src/k_rem_pio2.c#4 integrate .. //depot/projects/e500/lib/msun/src/math.h#4 integrate .. //depot/projects/e500/lib/msun/src/math_private.h#4 integrate .. //depot/projects/e500/lib/msun/src/s_cos.c#2 integrate .. //depot/projects/e500/lib/msun/src/s_cosl.c#1 branch .. //depot/projects/e500/lib/msun/src/s_sin.c#2 integrate .. //depot/projects/e500/lib/msun/src/s_sinl.c#1 branch .. //depot/projects/e500/lib/msun/src/s_tan.c#2 integrate .. //depot/projects/e500/lib/msun/src/s_tanl.c#1 branch .. //depot/projects/e500/sys/boot/Makefile#5 integrate .. //depot/projects/e500/sys/dev/aic7xxx/aic79xx_osm.c#3 integrate .. //depot/projects/e500/sys/fs/coda/TODO#2 integrate .. //depot/projects/e500/sys/fs/coda/cnode.h#5 integrate .. //depot/projects/e500/sys/fs/coda/coda_kernel.h#3 delete .. //depot/projects/e500/sys/fs/coda/coda_psdev.c#5 integrate .. //depot/projects/e500/sys/kern/kern_exit.c#8 integrate .. //depot/projects/e500/sys/kern/kern_mib.c#6 integrate .. //depot/projects/e500/sys/kern/kern_tc.c#4 integrate Differences ... ==== //depot/projects/e500/etc/mail/access.sample#2 (text+ko) ==== @@ -1,10 +1,17 @@ -# $FreeBSD: src/etc/mail/access.sample,v 1.3 2000/11/02 23:40:40 dirk Exp $ +# $FreeBSD: src/etc/mail/access.sample,v 1.4 2008/02/17 05:22:08 gshapiro Exp $ # # Mail relay access control list. Default is to reject mail unless the # destination is local, or listed in /etc/mail/local-host-names # -cyberspammer.com 550 We don't accept mail from spammers -FREE.STEALTH.MAILER@ 550 We don't accept mail from spammers -another.source.of.spam REJECT -okay.cyberspammer.com OK -128.32 RELAY + +## Examples (commented out for safety) +#From:cyberspammer.com ERROR:"550 We don't accept mail from spammers" +#From:okay.cyberspammer.com OK +#Connect:sendmail.org RELAY +#To:sendmail.org RELAY +#Connect:128.32 RELAY +#Connect:128.32.2 SKIP +#Connect:IPv6:1:2:3:4:5:6:7 RELAY +#Connect:suspicious.example.com QUARANTINE:Mail from suspicious host +#Connect:[127.0.0.3] OK +#Connect:[IPv6:1:2:3:4:5:6:7:8] OK ==== //depot/projects/e500/etc/sendmail/freebsd.mc#3 (text+ko) ==== @@ -44,7 +44,7 @@ # divert(0) -VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.35 2007/11/05 00:18:06 gshapiro Exp $') +VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.36 2008/02/17 05:38:29 gshapiro Exp $') OSTYPE(freebsd6) DOMAIN(generic) @@ -71,7 +71,7 @@ dnl NOTE: This is a subscription service as of July 31, 2001 dnl FEATURE(dnsbl) dnl Alternatively, you can provide your own server and rejection message: -dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', `"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}') +dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', ``"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}'') dnl Dialup users should uncomment and define this appropriately dnl define(`SMART_HOST', `your.isp.mail.server') ==== //depot/projects/e500/lib/libc/stdlib/malloc.3#6 (text+ko) ==== @@ -30,9 +30,9 @@ .\" SUCH DAMAGE. .\" .\" @(#)malloc.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.77 2008/02/06 02:59:54 jasone Exp $ +.\" $FreeBSD: src/lib/libc/stdlib/malloc.3,v 1.78 2008/02/17 17:09:24 jasone Exp $ .\" -.Dd February 5, 2008 +.Dd February 17, 2008 .Dt MALLOC 3 .Os .Sh NAME @@ -231,17 +231,6 @@ .It K Double/halve the virtual memory chunk size. The default chunk size is 1 MB. -.It L -Double/halve the per-arena number of slots for lazy deallocation. -Lazy deallocation can decrease lock contention, especially for programs that use -the producer/consumer model. -The default is 256 slots per arena (so -.Ev MALLOC_OPTIONS=9l -will disable lazy deallocation), but note that due to algorithmic details, the -cache is typically flushed well before it completely fills. -This option has no impact unless there are multiple CPUs, and lazy deallocation -does not activate unless the program uses multiple threads. -This option is not available for some configurations (non-PIC). .It M Use .Xr mmap 2 ==== //depot/projects/e500/lib/libc/stdlib/malloc.c#8 (text+ko) ==== @@ -112,13 +112,6 @@ #endif /* - * MALLOC_LAZY_FREE enables the use of a per-thread vector of slots that free() - * can atomically stuff object pointers into. This can reduce arena lock - * contention. - */ -#define MALLOC_LAZY_FREE - -/* * MALLOC_BALANCE enables monitoring of arena lock contention and dynamically * re-balances arena load if exponentially averaged contention exceeds a * certain threshold. @@ -134,7 +127,7 @@ #define MALLOC_DSS #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.164 2008/02/08 08:02:34 jasone Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.166 2008/02/17 18:34:17 jasone Exp $"); #include "libc_private.h" #ifdef MALLOC_DEBUG @@ -242,10 +235,6 @@ # ifdef MALLOC_BALANCE # undef MALLOC_BALANCE # endif - /* MALLOC_LAZY_FREE requires TLS. */ -# ifdef MALLOC_LAZY_FREE -# undef MALLOC_LAZY_FREE -# endif #endif /* @@ -305,20 +294,6 @@ #define RUN_MAX_SMALL_2POW 15 #define RUN_MAX_SMALL (1U << RUN_MAX_SMALL_2POW) -#ifdef MALLOC_LAZY_FREE - /* Default size of each arena's lazy free cache. */ -# define LAZY_FREE_2POW_DEFAULT 8 - /* - * Number of pseudo-random probes to conduct before considering the cache to - * be overly full. It takes on average n probes to detect fullness of - * (n-1)/n. However, we are effectively doing multiple non-independent - * trials (each deallocation is a trial), so the actual average threshold - * for clearing the cache is somewhat lower. - */ -# define LAZY_FREE_NPROBES_2POW_MIN 2 -# define LAZY_FREE_NPROBES_2POW_MAX 3 -#endif - /* * Hyper-threaded CPUs may need a special instruction inside spin loops in * order to yield to another virtual CPU. If no such instruction is defined @@ -652,16 +627,6 @@ uint32_t contention; #endif -#ifdef MALLOC_LAZY_FREE - /* - * Deallocation of small objects can be lazy, in which case free_cache - * stores pointers to those objects that have not yet been deallocated. - * In order to avoid lock contention, slots are chosen randomly. Empty - * slots contain NULL. - */ - void **free_cache; -#endif - /* * bins is used to store rings of free regions of the following sizes, * assuming a 16-byte quantum, 4kB pagesize, and default MALLOC_OPTIONS. @@ -831,9 +796,6 @@ static bool opt_mmap = true; #endif static size_t opt_dirty_max = DIRTY_MAX_DEFAULT; -#ifdef MALLOC_LAZY_FREE -static int opt_lazy_free_2pow = LAZY_FREE_2POW_DEFAULT; -#endif #ifdef MALLOC_BALANCE static uint64_t opt_balance_threshold = BALANCE_THRESHOLD_DEFAULT; #endif @@ -930,17 +892,13 @@ static void *arena_palloc(arena_t *arena, size_t alignment, size_t size, size_t alloc_size); static size_t arena_salloc(const void *ptr); -#ifdef MALLOC_LAZY_FREE -static void arena_dalloc_lazy_hard(arena_t *arena, arena_chunk_t *chunk, - void *ptr, size_t pageind, arena_chunk_map_t *mapelm, unsigned slot); -#endif static void arena_dalloc_large(arena_t *arena, arena_chunk_t *chunk, void *ptr); -static void arena_ralloc_resize_shrink(arena_t *arena, arena_chunk_t *chunk, +static void arena_ralloc_large_shrink(arena_t *arena, arena_chunk_t *chunk, void *ptr, size_t size, size_t oldsize); -static bool arena_ralloc_resize_grow(arena_t *arena, arena_chunk_t *chunk, +static bool arena_ralloc_large_grow(arena_t *arena, arena_chunk_t *chunk, void *ptr, size_t size, size_t oldsize); -static bool arena_ralloc_resize(void *ptr, size_t size, size_t oldsize); +static bool arena_ralloc_large(void *ptr, size_t size, size_t oldsize); static void *arena_ralloc(void *ptr, size_t size, size_t oldsize); static bool arena_new(arena_t *arena); static arena_t *arenas_extend(unsigned ind); @@ -1115,7 +1073,7 @@ return (x); } -#if (defined(MALLOC_LAZY_FREE) || defined(MALLOC_BALANCE)) +#ifdef MALLOC_BALANCE /* * Use a simple linear congruential pseudo-random number generator: * @@ -1159,17 +1117,6 @@ # define PRN(suffix, lg_range) prn_##suffix(lg_range) #endif -/* - * Define PRNGs, one for each purpose, in order to avoid auto-correlation - * problems. - */ - -#ifdef MALLOC_LAZY_FREE -/* Define the per-thread PRNG used for lazy deallocation. */ -static __thread uint32_t lazy_free_x; -PRN_DEFINE(lazy_free, lazy_free_x, 12345, 12347) -#endif - #ifdef MALLOC_BALANCE /* Define the PRNG used for arena assignment. */ static __thread uint32_t balance_x; @@ -2000,27 +1947,8 @@ assert(__isthreaded); -#ifdef MALLOC_LAZY_FREE - /* - * Seed the PRNG used for lazy deallocation. Since seeding only occurs - * on the first allocation by a thread, it is possible for a thread to - * deallocate before seeding. This is not a critical issue though, - * since it is extremely unusual for an application to to use threads - * that deallocate but *never* allocate, and because even if seeding - * never occurs for multiple threads, they will tend to drift apart - * unless some aspect of the application forces deallocation - * synchronization. - */ - SPRN(lazy_free, (uint32_t)(uintptr_t)(_pthread_self())); -#endif - #ifdef MALLOC_BALANCE - /* - * Seed the PRNG used for arena load balancing. We can get away with - * using the same seed here as for the lazy_free PRNG without - * introducing autocorrelation because the PRNG parameters are - * distinct. - */ + /* Seed the PRNG used for arena load balancing. */ SPRN(balance, (uint32_t)(uintptr_t)(_pthread_self())); #endif @@ -3343,92 +3271,6 @@ #endif } -#ifdef MALLOC_LAZY_FREE -static inline void -arena_dalloc_lazy(arena_t *arena, arena_chunk_t *chunk, void *ptr, - size_t pageind, arena_chunk_map_t *mapelm) -{ - void **free_cache = arena->free_cache; - unsigned i, nprobes, slot; - - if (__isthreaded == false || opt_lazy_free_2pow < 0) { - malloc_spin_lock(&arena->lock); - arena_dalloc_small(arena, chunk, ptr, pageind, *mapelm); - malloc_spin_unlock(&arena->lock); - return; - } - - nprobes = (1U << LAZY_FREE_NPROBES_2POW_MIN) + PRN(lazy_free, - (LAZY_FREE_NPROBES_2POW_MAX - LAZY_FREE_NPROBES_2POW_MIN)); - for (i = 0; i < nprobes; i++) { - slot = PRN(lazy_free, opt_lazy_free_2pow); - if (atomic_cmpset_ptr((uintptr_t *)&free_cache[slot], - (uintptr_t)NULL, (uintptr_t)ptr)) { - return; - } - } - - arena_dalloc_lazy_hard(arena, chunk, ptr, pageind, mapelm, slot); -} - -static void -arena_dalloc_lazy_hard(arena_t *arena, arena_chunk_t *chunk, void *ptr, - size_t pageind, arena_chunk_map_t *mapelm, unsigned slot) -{ - void **free_cache = arena->free_cache; - unsigned i; - - malloc_spin_lock(&arena->lock); - arena_dalloc_small(arena, chunk, ptr, pageind, *mapelm); - - /* - * Check whether another thread already cleared the cache. It is - * possible that another thread cleared the cache *and* this slot was - * already refilled, which could result in a mostly fruitless cache - * sweep, but such a sequence of events causes no correctness issues. - */ - if ((ptr = (void *)atomic_readandclear_ptr( - (uintptr_t *)&free_cache[slot])) - != NULL) { - unsigned lazy_free_mask; - - /* - * Clear the cache, since we failed to find a slot. It is - * possible that other threads will continue to insert objects - * into the cache while this one sweeps, but that is okay, - * since on average the cache is still swept with the same - * frequency. - */ - - /* Handle pointer at current slot. */ - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) >> - pagesize_2pow); - mapelm = &chunk->map[pageind]; - arena_dalloc_small(arena, chunk, ptr, pageind, *mapelm); - - /* Sweep remainder of slots. */ - lazy_free_mask = (1U << opt_lazy_free_2pow) - 1; - for (i = (slot + 1) & lazy_free_mask; - i != slot; - i = (i + 1) & lazy_free_mask) { - ptr = (void *)atomic_readandclear_ptr( - (uintptr_t *)&free_cache[i]); - if (ptr != NULL) { - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - pageind = (((uintptr_t)ptr - (uintptr_t)chunk) - >> pagesize_2pow); - mapelm = &chunk->map[pageind]; - arena_dalloc_small(arena, chunk, ptr, pageind, - *mapelm); - } - } - } - - malloc_spin_unlock(&arena->lock); -} -#endif - static void arena_dalloc_large(arena_t *arena, arena_chunk_t *chunk, void *ptr) { @@ -3479,13 +3321,9 @@ mapelm = &chunk->map[pageind]; if ((*mapelm & CHUNK_MAP_LARGE) == 0) { /* Small allocation. */ -#ifdef MALLOC_LAZY_FREE - arena_dalloc_lazy(arena, chunk, ptr, pageind, mapelm); -#else malloc_spin_lock(&arena->lock); arena_dalloc_small(arena, chunk, ptr, pageind, *mapelm); malloc_spin_unlock(&arena->lock); -#endif } else { assert((*mapelm & CHUNK_MAP_POS_MASK) == 0); arena_dalloc_large(arena, chunk, ptr); @@ -3507,7 +3345,7 @@ } static void -arena_ralloc_resize_shrink(arena_t *arena, arena_chunk_t *chunk, void *ptr, +arena_ralloc_large_shrink(arena_t *arena, arena_chunk_t *chunk, void *ptr, size_t size, size_t oldsize) { extent_node_t *node, key; @@ -3535,7 +3373,7 @@ } static bool -arena_ralloc_resize_grow(arena_t *arena, arena_chunk_t *chunk, void *ptr, +arena_ralloc_large_grow(arena_t *arena, arena_chunk_t *chunk, void *ptr, size_t size, size_t oldsize) { extent_node_t *nodeC, key; @@ -3593,21 +3431,44 @@ * always fail if growing an object, and the following run is already in use. */ static bool -arena_ralloc_resize(void *ptr, size_t size, size_t oldsize) +arena_ralloc_large(void *ptr, size_t size, size_t oldsize) { - arena_chunk_t *chunk; - arena_t *arena; + size_t psize; - chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); - arena = chunk->arena; - assert(arena->magic == ARENA_MAGIC); - - if (size < oldsize) { - arena_ralloc_resize_shrink(arena, chunk, ptr, size, oldsize); + psize = PAGE_CEILING(size); + if (psize == oldsize) { + /* Same size class. */ + if (opt_junk && size < oldsize) { + memset((void *)((uintptr_t)ptr + size), 0x5a, oldsize - + size); + } return (false); } else { - return (arena_ralloc_resize_grow(arena, chunk, ptr, size, - oldsize)); + arena_chunk_t *chunk; + arena_t *arena; + + chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); + arena = chunk->arena; + assert(arena->magic == ARENA_MAGIC); + + if (psize < oldsize) { + /* Fill before shrinking in order avoid a race. */ + if (opt_junk) { + memset((void *)((uintptr_t)ptr + size), 0x5a, + oldsize - size); + } + arena_ralloc_large_shrink(arena, chunk, ptr, psize, + oldsize); + return (false); + } else { + bool ret = arena_ralloc_large_grow(arena, chunk, ptr, + psize, oldsize); + if (ret == false && opt_zero) { + memset((void *)((uintptr_t)ptr + oldsize), 0, + size - oldsize); + } + return (ret); + } } } @@ -3633,16 +3494,9 @@ pow2_ceil(size) == pow2_ceil(oldsize)) goto IN_PLACE; /* Same size class. */ } else if (oldsize > bin_maxclass && oldsize <= arena_maxclass) { - size_t psize; - assert(size > bin_maxclass); - psize = PAGE_CEILING(size); - - if (psize == oldsize) - goto IN_PLACE; /* Same size class. */ - - if (arena_ralloc_resize(ptr, psize, oldsize) == false) - goto IN_PLACE; + if (arena_ralloc_large(ptr, size, oldsize) == false) + return (ptr); } /* @@ -3710,15 +3564,6 @@ #ifdef MALLOC_BALANCE arena->contention = 0; #endif -#ifdef MALLOC_LAZY_FREE - if (opt_lazy_free_2pow >= 0) { - arena->free_cache = (void **) base_calloc(1, sizeof(void *) - * (1U << opt_lazy_free_2pow)); - if (arena->free_cache == NULL) - return (true); - } else - arena->free_cache = NULL; -#endif /* Initialize bins. */ prev_run_size = pagesize; @@ -4037,13 +3882,6 @@ _malloc_message("CPUs: ", umax2s(ncpus, s), "\n", ""); _malloc_message("Max arenas: ", umax2s(narenas, s), "\n", ""); -#ifdef MALLOC_LAZY_FREE - if (opt_lazy_free_2pow >= 0) { - _malloc_message("Lazy free slots: ", - umax2s(1U << opt_lazy_free_2pow, s), "\n", ""); - } else - _malloc_message("Lazy free slots: 0\n", "", "", ""); -#endif #ifdef MALLOC_BALANCE _malloc_message("Arena balance threshold: ", umax2s(opt_balance_threshold, s), "\n", ""); @@ -4189,11 +4027,6 @@ } } -#ifdef MALLOC_LAZY_FREE - if (ncpus == 1) - opt_lazy_free_2pow = -1; -#endif - /* Get page size. */ { long result; @@ -4345,18 +4178,6 @@ (sizeof(size_t) << 3)) opt_chunk_2pow++; break; - case 'l': -#ifdef MALLOC_LAZY_FREE - if (opt_lazy_free_2pow >= 0) - opt_lazy_free_2pow--; -#endif - break; - case 'L': -#ifdef MALLOC_LAZY_FREE - if (ncpus > 1) - opt_lazy_free_2pow++; -#endif - break; case 'm': #ifdef MALLOC_DSS opt_mmap = false; @@ -4493,14 +4314,6 @@ } arena_maxclass = chunksize - (arena_chunk_header_npages << pagesize_2pow); -#ifdef MALLOC_LAZY_FREE - /* - * Make sure that allocating the free_cache does not exceed the limits - * of what base_alloc() can handle. - */ - while ((sizeof(void *) << opt_lazy_free_2pow) > chunksize) - opt_lazy_free_2pow--; -#endif UTRACE(0, 0, 0); @@ -4644,11 +4457,8 @@ #endif /* * Seed here for the initial thread, since choose_arena_hard() is only - * called for other threads. The seed values don't really matter. + * called for other threads. The seed value doesn't really matter. */ -#ifdef MALLOC_LAZY_FREE - SPRN(lazy_free, 42); -#endif #ifdef MALLOC_BALANCE SPRN(balance, 42); #endif ==== //depot/projects/e500/lib/libmilter/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/lib/libmilter/Makefile,v 1.7 2007/04/09 01:45:30 gshapiro Exp $ +# $FreeBSD: src/lib/libmilter/Makefile,v 1.8 2008/02/17 05:14:47 gshapiro Exp $ .include <bsd.own.mk> @@ -8,6 +8,7 @@ CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I. CFLAGS+=-DNOT_SENDMAIL -Dsm_snprintf=snprintf CFLAGS+=-D_THREAD_SAFE +CFLAGS+=-DSM_CONF_POLL .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DNETINET6 ==== //depot/projects/e500/lib/msun/Makefile#8 (text+ko) ==== @@ -1,5 +1,5 @@ # @(#)Makefile 5.1beta 93/09/24 -# $FreeBSD: src/lib/msun/Makefile,v 1.87 2008/02/13 16:56:52 bde Exp $ +# $FreeBSD: src/lib/msun/Makefile,v 1.88 2008/02/17 07:33:51 das Exp $ # # ==================================================== # Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -68,7 +68,8 @@ # Location of fpmath.h and _fpmath.h LIBCDIR= ${.CURDIR}/../libc -CFLAGS+= -I${LIBCDIR}/include -I${LIBCDIR}/${MACHINE_ARCH} +CFLAGS+= -I${.CURDIR}/src -I${LIBCDIR}/include \ + -I${LIBCDIR}/${MACHINE_ARCH} SYM_MAPS+= ${.CURDIR}/Symbol.map VERSION_DEF= ${LIBCDIR}/Versions.def @@ -78,9 +79,10 @@ COMMON_SRCS+= s_copysignl.c s_fabsl.c s_llrintl.c s_lrintl.c s_modfl.c .if ${LDBL_PREC} != 53 # If long double != double use these; otherwise, we alias the double versions. -COMMON_SRCS+= s_ceill.c s_exp2l.c s_floorl.c s_fmal.c s_frexpl.c \ - s_logbl.c s_nanl.c s_nextafterl.c s_nexttoward.c s_rintl.c \ - s_scalbnl.c s_truncl.c +COMMON_SRCS+= k_cosl.c k_sinl.c k_tanl.c s_ceill.c s_cosl.c \ + s_exp2l.c s_floorl.c s_fmal.c \ + s_frexpl.c s_logbl.c s_nanl.c s_nextafterl.c s_nexttoward.c \ + s_rintl.c s_scalbnl.c s_sinl.c s_tanl.c s_truncl.c .endif # C99 complex functions @@ -123,7 +125,7 @@ cimag.3 conj.3 cimag.3 conjf.3 cimag.3 conjl.3 \ cimag.3 creal.3 cimag.3 crealf.3 cimag.3 creall.3 MLINKS+=copysign.3 copysignf.3 copysign.3 copysignl.3 -MLINKS+=cos.3 cosf.3 +MLINKS+=cos.3 cosf.3 cos.3 cosl.3 MLINKS+=cosh.3 coshf.3 MLINKS+=csqrt.3 csqrtf.3 MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3 @@ -166,10 +168,10 @@ MLINKS+=round.3 roundf.3 round.3 roundl.3 MLINKS+=scalbn.3 scalbln.3 scalbn.3 scalblnf.3 scalbn.3 scalblnl.3 MLINKS+=scalbn.3 scalbnf.3 scalbn.3 scalbnl.3 -MLINKS+=sin.3 sinf.3 +MLINKS+=sin.3 sinf.3 sin.3 sinl.3 MLINKS+=sinh.3 sinhf.3 MLINKS+=sqrt.3 cbrt.3 sqrt.3 cbrtf.3 sqrt.3 sqrtf.3 -MLINKS+=tan.3 tanf.3 +MLINKS+=tan.3 tanf.3 tan.3 tanl.3 MLINKS+=tanh.3 tanhf.3 MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3 ==== //depot/projects/e500/lib/msun/Symbol.map#7 (text) ==== @@ -1,5 +1,5 @@ /* - * $FreeBSD: src/lib/msun/Symbol.map,v 1.12 2008/01/18 21:43:10 das Exp $ + * $FreeBSD: src/lib/msun/Symbol.map,v 1.13 2008/02/17 07:33:51 das Exp $ */ /* 7.0-CURRENT */ @@ -198,4 +198,7 @@ nearbyintl; rintl; exp2l; + sinl; + cosl; + tanl; }; ==== //depot/projects/e500/lib/msun/man/cos.3#2 (text+ko) ==== @@ -26,14 +26,15 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)cos.3 5.1 (Berkeley) 5/2/91 -.\" $FreeBSD: src/lib/msun/man/cos.3,v 1.12 2007/01/09 01:02:05 imp Exp $ +.\" $FreeBSD: src/lib/msun/man/cos.3,v 1.13 2008/02/17 07:32:44 das Exp $ .\" -.Dd May 2, 1991 +.Dd January 24, 2008 .Dt COS 3 .Os .Sh NAME .Nm cos , -.Nm cosf +.Nm cosf , +.Nm cosl .Nd cosine functions .Sh LIBRARY .Lb libm @@ -43,11 +44,14 @@ .Fn cos "double x" .Ft float .Fn cosf "float x" +.Fn long double +.Ft cosl "long double x" .Sh DESCRIPTION The -.Fn cos -and the -.Fn cosf +.Fn cos , +.Fn cosf , +and +.Fn cosl functions compute the cosine of .Fa x (measured in radians). @@ -57,9 +61,10 @@ .Xr math 3 . .Sh RETURN VALUES The -.Fn cos -and the -.Fn cosf +.Fn cos , +.Fn cosf , +and +.Fn cosl functions return the cosine value. .Sh SEE ALSO .Xr acos 3 , @@ -73,7 +78,5 @@ .Xr tan 3 , .Xr tanh 3 .Sh STANDARDS -The -.Fn cos -function conforms to -.St -isoC . +These functions conform to +.St -isoC-99 . ==== //depot/projects/e500/lib/msun/man/sin.3#2 (text+ko) ==== @@ -27,14 +27,15 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)sin.3 6.7 (Berkeley) 4/19/91 -.\" $FreeBSD: src/lib/msun/man/sin.3,v 1.10 2007/01/09 01:02:06 imp Exp $ +.\" $FreeBSD: src/lib/msun/man/sin.3,v 1.11 2008/02/17 07:32:44 das Exp $ .\" -.Dd April 19, 1991 +.Dd January 24, 2008 .Dt SIN 3 .Os .Sh NAME .Nm sin , -.Nm sinf +.Nm sinf , +.Nm sinl .Nd sine functions .Sh LIBRARY .Lb libm @@ -44,11 +45,14 @@ .Fn sin "double x" .Ft float .Fn sinf "float x" +.Ft long double +.Fn sinl "long double x" .Sh DESCRIPTION The -.Fn sin -and the -.Fn sinf +.Fn sin , +.Fn sinf , +and +.Fn sinl functions compute the sine of .Fa x (measured in radians). @@ -56,9 +60,10 @@ or no significance. .Sh RETURN VALUES The -.Fn sin -and the -.Fn sinf +.Fn sin , +.Fn sinf , +and +.Fn sinl functions return the sine value. .Sh SEE ALSO .Xr acos 3 , @@ -72,7 +77,5 @@ .Xr tan 3 , .Xr tanh 3 .Sh STANDARDS -The -.Fn sin -function conforms to -.St -isoC . +These functions conform to +.St -isoC-99 . ==== //depot/projects/e500/lib/msun/man/tan.3#2 (text+ko) ==== @@ -26,14 +26,15 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)tan.3 5.1 (Berkeley) 5/2/91 -.\" $FreeBSD: src/lib/msun/man/tan.3,v 1.10 2007/01/09 01:02:06 imp Exp $ +.\" $FreeBSD: src/lib/msun/man/tan.3,v 1.11 2008/02/17 07:32:44 das Exp $ .\" -.Dd May 2, 1991 +.Dd January 24, 2008 .Dt TAN 3 .Os .Sh NAME .Nm tan , -.Nm tanf +.Nm tanf , +.Nm tanl .Nd tangent functions .Sh LIBRARY .Lb libm @@ -43,11 +44,14 @@ .Fn tan "double x" .Ft float .Fn tanf "float x" +.Ft long double +.Fn tanl "long double x" .Sh DESCRIPTION The -.Fn tan -and the -.Fn tanf +.Fn tan , +.Fn tanf , +and +.Fn tanl functions compute the tangent of .Fa x (measured in radians). @@ -57,8 +61,11 @@ .Xr math 3 . .Sh RETURN VALUES The -.Fn tan -function returns the tangent value. +.Fn tan , +.Fn tanf , +and +.Fn tanl +functions return the tangent value. .Sh SEE ALSO .Xr acos 3 , .Xr asin 3 , @@ -71,7 +78,5 @@ .Xr sinh 3 , .Xr tanh 3 .Sh STANDARDS -The -.Fn tan -function conforms to -.St -isoC . +These functions conform to +.St -isoC-99 . ==== //depot/projects/e500/lib/msun/src/e_rem_pio2.c#2 (text+ko) ==== @@ -13,7 +13,7 @@ */ #ifndef lint -static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_rem_pio2.c,v 1.8 2005/02/04 18:26:06 das Exp $"; +static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_rem_pio2.c,v 1.9 2008/02/17 07:31:59 das Exp $"; #endif /* __ieee754_rem_pio2(x,y) @@ -25,23 +25,6 @@ #include "math.h" #include "math_private.h" -/* - * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi - */ -static const int32_t two_over_pi[] = { -0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, -0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, -0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, -0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, -0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, -0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, -0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, -0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, -0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, -0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, -0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, -}; - static const int32_t npio2_hw[] = { 0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C, 0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C, @@ -162,7 +145,7 @@ tx[2] = z; nx = 3; while(tx[nx-1]==zero) nx--; /* skip zero term */ - n = __kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi); + n = __kernel_rem_pio2(tx,y,e0,nx,2); if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} return n; } ==== //depot/projects/e500/lib/msun/src/e_rem_pio2f.c#2 (text+ko) ==== @@ -15,7 +15,7 @@ */ #ifndef lint -static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_rem_pio2f.c,v 1.19 2005/11/23 03:03:09 bde Exp $"; +static char rcsid[] = "$FreeBSD: src/lib/msun/src/e_rem_pio2f.c,v 1.20 2008/02/17 07:31:59 das Exp $"; #endif /* __ieee754_rem_pio2f(x,y) @@ -29,23 +29,6 @@ #include "math_private.h" /* - * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi - */ -static const int32_t two_over_pi[] = { -0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, -0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, -0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, -0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, -0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, -0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, -0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, -0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, -0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, -0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, -0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, -}; - -/* * invpio2: 53 bits of 2/pi * pio2_1: first 33 bit of pi/2 * pio2_1t: pi/2 - pio2_1 @@ -90,7 +73,7 @@ e0 = (ix>>23)-150; /* e0 = ilogb(|x|)-23; */ SET_FLOAT_WORD(z, ix - ((int32_t)(e0<<23))); tx[0] = z; - n = __kernel_rem_pio2(tx,ty,e0,1,1,two_over_pi); + n = __kernel_rem_pio2(tx,ty,e0,1,1); y[0] = ty[0]; y[1] = ty[0] - y[0]; if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} ==== //depot/projects/e500/lib/msun/src/k_rem_pio2.c#4 (text+ko) ==== @@ -12,11 +12,11 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/lib/msun/src/k_rem_pio2.c,v 1.9 2008/01/20 04:09:44 bde Exp $"); +__FBSDID("$FreeBSD: src/lib/msun/src/k_rem_pio2.c,v 1.10 2008/02/17 07:31:59 das Exp $"); /* - * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) - * double x[],y[]; int e0,nx,prec; int ipio2[]; + * __kernel_rem_pio2(x,y,e0,nx,prec) + * double x[],y[]; int e0,nx,prec; * * __kernel_rem_pio2 return the last three digits of N with * y = x - N*pi/2 @@ -60,7 +60,8 @@ * r_head = t+w; * r_tail = w - (r_head - t); * - * e0 The exponent of x[0] + * e0 The exponent of x[0]. Must be <= 16360 or you need to + * expand the ipio2 table. * * nx dimension of x[] * @@ -70,13 +71,6 @@ * 2 64 bits (extended) * 3 113 bits (quad) * - * ipio2[] - * integer array, contains the (24*i)-th to (24*i+23)-th - * bit of 2/pi after binary point. The corresponding - * floating value is - * - * ipio2[i] * 2^(-24(i+1)). - * * External function: * double scalbn(), floor(); * @@ -137,6 +131,143 @@ static const int init_jk[] = {2,3,4,6}; /* initial value for jk */ +/* + * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi + * + * integer array, contains the (24*i)-th to (24*i+23)-th + * bit of 2/pi after binary point. The corresponding >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802172041.m1HKfZCj077535>