Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1688 → Rev 1689

/shark/trunk/oslib/makefile
File deleted
/shark/trunk/oslib/examples/syscalls.c
File deleted
/shark/trunk/oslib/examples/bugs.txt
File deleted
/shark/trunk/oslib/examples/timetest.c
File deleted
/shark/trunk/oslib/examples/ctxswdem.c
File deleted
/shark/trunk/oslib/examples/biosdemo.c
File deleted
/shark/trunk/oslib/examples/mbdemo.c
File deleted
/shark/trunk/oslib/examples/pitsdemo.c
File deleted
/shark/trunk/oslib/examples/pushdem.c
File deleted
/shark/trunk/oslib/examples/vmdemo.c
File deleted
/shark/trunk/oslib/examples/eventdem.c
File deleted
/shark/trunk/oslib/examples/asdemo.c
File deleted
/shark/trunk/oslib/examples/cpudemo.c
File deleted
/shark/trunk/oslib/examples/makefile
File deleted
/shark/trunk/oslib/examples/scheddem.c
File deleted
/shark/trunk/oslib/xlib/cpu2.s
File deleted
/shark/trunk/oslib/xlib/xdosm.c
File deleted
/shark/trunk/oslib/xlib/ccpu.c
File deleted
/shark/trunk/oslib/xlib/fpu.c
File deleted
/shark/trunk/oslib/xlib/xinit.c
File deleted
/shark/trunk/oslib/xlib/irq.c
File deleted
/shark/trunk/oslib/xlib/makefile
File deleted
/shark/trunk/oslib/xlib/xconv.c
File deleted
/shark/trunk/oslib/xlib/xsystab.c
File deleted
/shark/trunk/oslib/xlib/mem.s
File deleted
/shark/trunk/oslib/xlib/exc.s
File deleted
/shark/trunk/oslib/xlib/vm86.c
File deleted
/shark/trunk/oslib/xlib/idtinit.c
File deleted
/shark/trunk/oslib/xlib/xsys0.s
File deleted
/shark/trunk/oslib/xlib/x0.s
File deleted
/shark/trunk/oslib/xlib/ctxsw.c
File deleted
/shark/trunk/oslib/xlib/ctx.s
File deleted
/shark/trunk/oslib/xlib/xinfo.c
File deleted
/shark/trunk/oslib/xlib/xdosf.c
File deleted
/shark/trunk/oslib/xlib/xbios.c
File deleted
/shark/trunk/oslib/xlib/x1.c
File deleted
/shark/trunk/oslib/GPL.txt
File deleted
/shark/trunk/oslib/tools/binfin.c
File deleted
/shark/trunk/oslib/tools/checksymbols.c
File deleted
/shark/trunk/oslib/todo.txt
File deleted
/shark/trunk/oslib/libm/msun/src/s_logb.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_frexp.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_cos.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_hypot.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_pow.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_sinf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_sinhf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_j0.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_drem.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_hypotf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_rem_pi.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_sinf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_expm1f.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_asinh.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_gamma.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_sinh.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_expf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_acos.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_hypot.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_signga.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_rem1.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_sinhf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_jn.c
File deleted
/shark/trunk/oslib/libm/msun/src/math.h
File deleted
/shark/trunk/oslib/libm/msun/src/e_cosh.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_exp.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_powf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_signif.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_cabsf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_acoshf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_gamma.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_atanf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_tanh.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_atan2f.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_cbrtf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_scalbn.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_j1f.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_gamma_.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_fini1.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_scalb.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_isnan.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_cabs.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_gamf1.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_sinh.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_coshf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_expf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_rem1.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_scalb.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_fmod.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_gammaf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_j1.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_powf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_jnf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_gamf1.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_copysi.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_coshf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_log10f.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_scalbf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_acosf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_hypotf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_j0.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_fabsf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_floor.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_sign1.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_j0f.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_atan.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_lgam1.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_nextaf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_log1pf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_expm1.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_asin.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_acosf.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_standa.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_ilogbf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_log10.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_lgam1.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_fmod.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_acoshf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_finite.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_atan2f.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_mather.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_sin.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_asinf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_ceilf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_modf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_log.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_gamma_.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_log10.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_rem2.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_sin.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_cbrt.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_logf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_modff.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_ilogb.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_rem1.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_asinf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_pow.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_fabs.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_asin.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_ceil.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_atanh.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_isnanf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_j1.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_tanf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_lgamma.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_sqrtf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_ldexpf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_atanhf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_lgam2.c
File deleted
/shark/trunk/oslib/libm/msun/src/math_pri.h
File deleted
/shark/trunk/oslib/libm/msun/src/s_tanf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_log10f.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_sqrt.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_remain.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_scalbf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_atanh.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_exp.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_sqrtf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_lgam2.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_asinhf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_logf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_ldexp.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_fmodf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_log1p.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_erff.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_j1f.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_jn.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_logbf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_copy1.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_fmodf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_tanhf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_j0f.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_dremf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_scal1.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_rem_pi.c
File deleted
/shark/trunk/oslib/libm/msun/src/math_private.h
File deleted
/shark/trunk/oslib/libm/msun/src/e_sqrt.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_erf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_acosh.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_jnf.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_cosf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_rintf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_lgam3.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_floorf.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_atan2.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_acos.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_cosf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_frexpf.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_next1.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_lib_ve.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_cosh.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_acosh.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_lgamma.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_log.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_atanhf.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_lgam3.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_atan2.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_tan.c
File deleted
/shark/trunk/oslib/libm/msun/src/e_gammaf.c
File deleted
/shark/trunk/oslib/libm/msun/src/k_cos.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_rint.c
File deleted
/shark/trunk/oslib/libm/msun/src/w_remain.c
File deleted
/shark/trunk/oslib/libm/msun/src/s_tan.c
File deleted
/shark/trunk/oslib/libm/msun/i387/e_asin.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_rint.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_ceil.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_finite.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_exp.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_signif.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_floor.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_log1p.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_tan.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_logb.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_atan.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_cos.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_atan2.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_sin.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_ilogb.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_remain.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_scalbn.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_log.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_log10.s
File deleted
/shark/trunk/oslib/libm/msun/i387/s_copysi.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_scalb.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_acos.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_fmod.s
File deleted
/shark/trunk/oslib/libm/msun/i387/e_sqrt.s
File deleted
/shark/trunk/oslib/libm/machine/endian.h
File deleted
/shark/trunk/oslib/libm/machine/defs.h
File deleted
/shark/trunk/oslib/libm/machine/infinity.c
File deleted
/shark/trunk/oslib/libm/machine/asmacros.h
File deleted
/shark/trunk/oslib/libm/machine/stub.c
File deleted
/shark/trunk/oslib/libm/makefile
File deleted
/shark/trunk/oslib/kl/intevt.c
File deleted
/shark/trunk/oslib/kl/timeint.s
File deleted
/shark/trunk/oslib/kl/advtimer.c
File deleted
/shark/trunk/oslib/kl/oq.txt
File deleted
/shark/trunk/oslib/kl/aspace.c
File deleted
/shark/trunk/oslib/kl/makefile
File deleted
/shark/trunk/oslib/kl/mem.c
File deleted
/shark/trunk/oslib/kl/time.c
File deleted
/shark/trunk/oslib/kl/event.c
File deleted
/shark/trunk/oslib/kl/todo.txt
File deleted
/shark/trunk/oslib/kl/estub.c
File deleted
/shark/trunk/oslib/kl/event1.c
File deleted
/shark/trunk/oslib/kl/cxsw-2.c
File deleted
/shark/trunk/oslib/kl/init.c
File deleted
/shark/trunk/oslib/kl/abort.s
File deleted
/shark/trunk/oslib/lib/readme
File deleted
/shark/trunk/oslib/lib/makefile
File deleted
/shark/trunk/oslib/ll/ll.h
File deleted
/shark/trunk/oslib/ll/sys/ll/event.h
File deleted
/shark/trunk/oslib/ll/sys/ll/ll-mem.h
File deleted
/shark/trunk/oslib/ll/sys/ll/ll-instr.h
File deleted
/shark/trunk/oslib/ll/sys/ll/aspace.h
File deleted
/shark/trunk/oslib/ll/sys/ll/time.h
File deleted
/shark/trunk/oslib/ll/sys/ll/ll-data.h
File deleted
/shark/trunk/oslib/ll/sys/ll/exc.h
File deleted
/shark/trunk/oslib/ll/sys/ll/ll-func.h
File deleted
/shark/trunk/oslib/ll/sys/types.h
File deleted
/shark/trunk/oslib/ll/sys/cdefs.h
File deleted
/shark/trunk/oslib/ll/math.h
File deleted
/shark/trunk/oslib/ll/time.h
File deleted
/shark/trunk/oslib/ll/assert.h
File deleted
/shark/trunk/oslib/ll/stdlib.h
File deleted
/shark/trunk/oslib/ll/limits.h
File deleted
/shark/trunk/oslib/ll/stdio.h
File deleted
/shark/trunk/oslib/ll/i386/hw-data.h
File deleted
/shark/trunk/oslib/ll/i386/mb-info.h
File deleted
/shark/trunk/oslib/ll/i386/64bit.h
File deleted
/shark/trunk/oslib/ll/i386/hw-arch.h
File deleted
/shark/trunk/oslib/ll/i386/error.h
File deleted
/shark/trunk/oslib/ll/i386/x-dosmem.h
File deleted
/shark/trunk/oslib/ll/i386/int.h
File deleted
/shark/trunk/oslib/ll/i386/x-dos.h
File deleted
/shark/trunk/oslib/ll/i386/pit.h
File deleted
/shark/trunk/oslib/ll/i386/farptr.h
File deleted
/shark/trunk/oslib/ll/i386/limits.h
File deleted
/shark/trunk/oslib/ll/i386/x-bios.h
File deleted
/shark/trunk/oslib/ll/i386/cons.h
File deleted
/shark/trunk/oslib/ll/i386/float.h
File deleted
/shark/trunk/oslib/ll/i386/tss-ctx.h
File deleted
/shark/trunk/oslib/ll/i386/string.h
File deleted
/shark/trunk/oslib/ll/i386/hw-func.h
File deleted
/shark/trunk/oslib/ll/i386/mb-hdr.h
File deleted
/shark/trunk/oslib/ll/i386/linkage.h
File deleted
/shark/trunk/oslib/ll/i386/advtimer.h
File deleted
/shark/trunk/oslib/ll/i386/pic.h
File deleted
/shark/trunk/oslib/ll/i386/hw-instr.h
File deleted
/shark/trunk/oslib/ll/i386/apic.h
File deleted
/shark/trunk/oslib/ll/i386/mem.h
File deleted
/shark/trunk/oslib/ll/i386/defs.h
File deleted
/shark/trunk/oslib/ll/i386/stdlib.h
File deleted
/shark/trunk/oslib/ll/i386/stdio.h
File deleted
/shark/trunk/oslib/ll/i386/hw-io.h
File deleted
/shark/trunk/oslib/ll/i386/sel.h
File deleted
/shark/trunk/oslib/ll/ctype.h
File deleted
/shark/trunk/oslib/ll/stdarg.h
File deleted
/shark/trunk/oslib/ll/errno.h
File deleted
/shark/trunk/oslib/ll/float.h
File deleted
/shark/trunk/oslib/ll/string.h
File deleted
/shark/trunk/oslib/ll/unistd.h
File deleted
/shark/trunk/oslib/mk/linux.mk
File deleted
/shark/trunk/oslib/mk/os.x
File deleted
/shark/trunk/oslib/mk/oldgnu.mk
File deleted
/shark/trunk/oslib/mk/gnu.mk
File deleted
/shark/trunk/oslib/docs/todo.txt
File deleted
/shark/trunk/oslib/docs/oslib.tex
File deleted
/shark/trunk/oslib/docs/ref.txt
File deleted
/shark/trunk/oslib/docs/makefile
File deleted
/shark/trunk/oslib/libc/reboot.c
File deleted
/shark/trunk/oslib/libc/makefile
File deleted
/shark/trunk/oslib/libc/ioformat/sprintf.h
File deleted
/shark/trunk/oslib/libc/ioformat/sscanf.c
File deleted
/shark/trunk/oslib/libc/ioformat/ksprintf.c
File deleted
/shark/trunk/oslib/libc/ioformat/ecvt.c
File deleted
/shark/trunk/oslib/libc/ioformat/ucvt.c
File deleted
/shark/trunk/oslib/libc/ioformat/fcvt.c
File deleted
/shark/trunk/oslib/libc/ioformat/gcvt.c
File deleted
/shark/trunk/oslib/libc/ioformat/sprintf.c
File deleted
/shark/trunk/oslib/libc/stdlib/stdlib.c
File deleted
/shark/trunk/oslib/libc/stdlib/strtoi.c
File deleted
/shark/trunk/oslib/libc/stdlib/strtol.c
File deleted
/shark/trunk/oslib/libc/stdlib/strtoul.c
File deleted
/shark/trunk/oslib/libc/stdlib/strtod.c
File deleted
/shark/trunk/oslib/libc/stdlib/strtou.c
File deleted
/shark/trunk/oslib/libc/stdlib/random.c
File deleted
/shark/trunk/oslib/libc/modf.s
File deleted
/shark/trunk/oslib/libc/string/strbase.c
File deleted
/shark/trunk/oslib/libc/string/string.c
File deleted
/shark/trunk/oslib/libc/string/strrchr.c
File deleted
/shark/trunk/oslib/libc/string/strnum.c
File deleted
/shark/trunk/oslib/libc/string/strncat.c
File deleted
/shark/trunk/oslib/libc/string/special.c
File deleted
/shark/trunk/oslib/libc/string/strstr.c
File deleted
/shark/trunk/oslib/libcons/cons1.c
File deleted
/shark/trunk/oslib/libcons/message.c
File deleted
/shark/trunk/oslib/libcons/cons2.c
File deleted
/shark/trunk/oslib/libcons/cprintf.c
File deleted
/shark/trunk/oslib/libcons/makefile
File deleted
/shark/trunk/oslib/config.mk
File deleted
/shark/trunk/makefile
File deleted
/shark/trunk/mkf/makefile.libm
File deleted
/shark/trunk/mkf/makefile.kl
File deleted
/shark/trunk/kernel/makefile
File deleted
/shark/trunk/kernel/join.c
50,9 → 50,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/kern.c
59,9 → 59,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/tpreempt.c
50,9 → 50,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/activate.c
50,9 → 50,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/blkact.c
53,9 → 53,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/mqueue.c
49,7 → 49,7
*/
 
#include <mqueue.h>
#include <ll/string.h>
#include <arch/string.h>
#include <kernel/types.h>
#include <kernel/var.h>
#include <kernel/func.h>
/shark/trunk/kernel/assert.c
44,9 → 44,9
*/
 
#include <ll/i386/cons.h>
#include <ll/stdarg.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/stdarg.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/func.h>
#include <kernel/var.h>
#include <kernel/assert.h>
/shark/trunk/kernel/init.c
51,9 → 51,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/printk.c
44,9 → 44,9
*/
 
#include <ll/i386/cons.h>
#include <ll/stdarg.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/stdarg.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/log.h>
#include <kernel/func.h>
 
/shark/trunk/kernel/grpcreat.c
52,9 → 52,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/tskmsg.c
48,9 → 48,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/perror.c
19,8 → 19,8
 
#include <errno.h>
#include <kernel/const.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <kernel/func.h>
 
/* This is a list of all known `errno' codes. */
/shark/trunk/kernel/nanoslp.c
51,9 → 51,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/keys.c
51,9 → 51,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/signal.c
75,8 → 75,8
 
 
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <ll/i386/pic.h>
#include <signal.h>
#include <errno.h>
/shark/trunk/kernel/event.c
54,9 → 54,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/jet.c
58,9 → 58,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/cancel.c
53,9 → 53,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/panic.c
44,9 → 44,9
*/
 
#include <ll/i386/cons.h>
#include <ll/stdarg.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/stdarg.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <stdlib.h>
#include <kernel/func.h>
 
/shark/trunk/kernel/kill.c
54,9 → 54,9
 
#include <stdarg.h>
#include <ll/ll.h>
#include <ll/stdlib.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/kernel/Makefile
0,0 → 1,31
targets:= \
activate.o \
assert.o \
blkact.o \
cancel.o \
conditio.o \
event.o \
exchand.o \
grpcreat.o \
jet.o \
join.o \
kern.o \
keys.o \
kill.o \
init.o \
int_sem.o \
mem/ \
mem.o \
mqueue.o \
mutex.o \
nanoslp.o \
panic.o \
printk.o \
perror.o \
pthread.o \
iqueue.o \
signal.o \
time.o \
tpreempt.o \
tskmsg.o
 
/shark/trunk/kernel/mem/makefile
File deleted
/shark/trunk/kernel/mem/stats.c
73,7 → 73,7
#define DEBUG
#endif
 
#include <ll/stdio.h>
#include <arch/stdio.h>
#include <kernel/func.h>
 
#include <kernel/lmm.h>
/shark/trunk/kernel/mem/dump.c
74,7 → 74,7
#define DEBUG
#endif
 
#include <ll/stdio.h>
#include <arch/stdio.h>
#include <kernel/func.h>
#include <kernel/lmm.h>
#define assert(test) assertk(test)
/shark/trunk/kernel/mem/Makefile
0,0 → 1,17
targets:= \
addfree.o \
addregio.o \
alloc.o \
alloc_al.o \
alloc_ge.o \
alloc_pa.o \
avail.o \
avail_in.o \
dump.o \
findfree.o \
free.o \
freepage.o \
init.o \
removefr.o \
stats.o
 
/shark/trunk/tracer/makefile
File deleted
/shark/trunk/tracer/include/qudp.h
40,7 → 40,7
 
#include <kernel/model.h>
#include <drivers/udpip.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/tracer/include/qdummy.h
38,7 → 38,7
#ifndef __TRACE_QDUMMY_H
#define __TRACE_QDUMMY_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/tracer/include/trace.h
48,7 → 48,7
#ifndef __TRACE_TRACE_H
#define __TRACE_TRACE_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/tracer/include/qfixed.h
38,7 → 38,7
#ifndef __TRACE_QFIXED_H
#define __TRACE_QFIXED_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/tracer/include/qcirc.h
38,7 → 38,7
#ifndef __TRACE_QCIRC_H
#define __TRACE_QCIRC_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/tracer/include/queues.h
50,7 → 50,7
 
#include <ll/sys/types.h>
#include "types.h"
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/tracer/include/FTrace_types.h
23,7 → 23,7
 
#include <ll/sys/types.h>
#include <ll/i386/mem.h>
#include <ll/math.h>
#include <arch/math.h>
 
#include "FTrace.h"
 
/shark/trunk/tracer/newtrace/Makefile
0,0 → 1,7
targets:= \
FTrace.o \
FTrace_OSD.o \
FTrace_OSD_ll.o \
FTrace_udp.o \
FTrace_disk.o
 
/shark/trunk/tracer/oldtrace/trcudp.c
39,7 → 39,7
*/
 
#include <ll/sys/types.h>
#include <ll/stdlib.h>
#include <arch/stdlib.h>
 
#include <kernel/func.h>
#include <kernel/mem.h>
/shark/trunk/tracer/oldtrace/trcdfix.c
34,7 → 34,7
*/
 
#include <ll/sys/types.h>
#include <ll/stdlib.h>
#include <arch/stdlib.h>
 
#include <kernel/func.h>
#include <kernel/mem.h>
/shark/trunk/tracer/oldtrace/trcdummy.c
34,7 → 34,7
*/
 
#include <ll/sys/types.h>
#include <ll/stdlib.h>
#include <arch/stdlib.h>
 
#include <kernel/log.h>
 
/shark/trunk/tracer/oldtrace/trcfixed.c
34,7 → 34,7
*/
 
#include <ll/sys/types.h>
#include <ll/stdlib.h>
#include <arch/stdlib.h>
 
#include <kernel/func.h>
#include <kernel/mem.h>
/shark/trunk/tracer/oldtrace/trccirc.c
46,7 → 46,7
*/
 
#include <ll/sys/types.h>
#include <ll/stdlib.h>
#include <arch/stdlib.h>
 
#include <kernel/func.h>
#include <kernel/mem.h>
/shark/trunk/tracer/oldtrace/Makefile
0,0 → 1,9
targets:= \
oldtrace.o \
trccirc.o \
trcdfix.o \
trcudp.o \
trcfixed.o \
trcdummy.o \
ctable.o
 
/shark/trunk/tracer/oldtrace/oldtrace.c
40,8 → 40,8
#include <kernel/types.h>
#include <kernel/var.h>
 
#include <ll/stdlib.h>
#include <ll/string.h>
#include <arch/stdlib.h>
#include <arch/string.h>
 
#include <kernel/func.h>
 
/shark/trunk/tracer/Makefile
0,0 → 1,11
targets-NEW:= libtracer.a
targets-OLD:= libtracer.a
 
objs-NEW:= newtrace/
objs-OLD:= oldtrace/
 
targets:= $(targets-$(TRACER))
libtracer.a-objs:= $(objs-$(TRACER))
 
exported-cppflags:= -I$(curdir)/include -I$(srctree)/drivers/net/include
 
/shark/trunk/include/math.h
52,7 → 52,7
#ifndef __MATH_H__
#define __MATH_H__
 
#include <ll/math.h>
#include <arch/math.h>
 
/* not POSIX but required by some programs */
 
/shark/trunk/include/kernel/func.h
73,7 → 73,7
#define __KERNEL_FUNC_H__
 
#include <ll/ll.h>
#include <ll/stdio.h>
#include <arch/stdio.h>
#include <kernel/types.h>
#include <kernel/model.h>
#include <kernel/mem.h>
89,7 → 89,7
/* if a source use printk() it should include log.h not func.h */
#include <kernel/log.h>
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/iqueue.h
75,7 → 75,7
#ifndef __KERNEL_IQUEUE_H__
#define __KERNEL_IQUEUE_H__
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/int_sem.h
64,7 → 64,7
 
#include <kernel/types.h>
#include <kernel/iqueue.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/kernmem.h
49,7 → 49,7
#ifndef __KERNEL_KERNMEM_H_
#define __KERNEL_KERNMEM_H__
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
/* These function are used to manage memory at VM layer */
/shark/trunk/include/kernel/mem.h
59,7 → 59,7
#define __KERNEL_MEM_H__
 
#include <kernel/lmm.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/kern.h
56,8 → 56,8
*/
 
#include <ll/ll.h>
#include <ll/stdio.h>
#include <ll/stdlib.h>
#include <arch/stdio.h>
#include <arch/stdlib.h>
#include <kernel/config.h>
#include <kernel/model.h>
#include <kernel/const.h>
/shark/trunk/include/kernel/descr.h
72,7 → 72,7
#include <kernel/types.h>
#include <kernel/iqueue.h>
#include <limits.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/model.h
56,7 → 56,7
 
#include "ll/ll.h"
#include "kernel/types.h"
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/assert.h
49,7 → 49,7
#ifndef _KERNEL_ASSERT_H
#define _KERNEL_ASSERT_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/log.h
49,7 → 49,7
#ifndef __KERNEL_LOG_H
#define __KERNEL_LOG_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/types.h
51,7 → 51,7
 
#ifndef __KERNEL_TYPES_H__
#define __KERNEL_TYPES_H__
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/kernel/lmm.h
80,7 → 80,7
// this part was oskit/lmm.h
 
#include <sys/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
typedef DWORD lmm_flags_t;
/shark/trunk/include/kernel/var.h
57,7 → 57,7
#include <ll/ll.h>
#include <sys/types.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/time.h
61,7 → 61,7
#endif
 
/* timespec defined in ll/sys/ll/time.h */
#include <ll/time.h>
#include <arch/time.h>
#include <signal.h>
 
 
/shark/trunk/include/assert.h
47,7 → 47,7
 
#ifndef __ASSERT_H
#define __ASSERT_H
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/mqueue.h
61,7 → 61,7
#include <fcntl.h>
#include <time.h>
#include <signal.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/float.h
39,8 → 39,8
#ifndef _MACHINE_FLOAT_H_
#define _MACHINE_FLOAT_H_ 1
 
#include <ll/limits.h>
#include <ll/float.h>
#include <arch/limits.h>
#include <arch/float.h>
 
#define LDBL_MANT_DIG DBL_MANT_DIG
#define LDBL_EPSILON DBL_EPSILON
/shark/trunk/include/unistd.h
90,7 → 90,7
#define __UNISTD_H__
 
#include <features.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/string.h
50,8 → 50,8
 
#ifndef __STRING_H__
#define __STRING_H__
#include <ll/string.h>
#include "ll/sys/cdefs.h"
#include <arch/string.h>
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/trace/qudp.h
40,7 → 40,7
 
#include <kernel/model.h>
#include <drivers/udpip.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/trace/qdummy.h
38,7 → 38,7
#ifndef __TRACE_QDUMMY_H
#define __TRACE_QDUMMY_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/trace/trace.h
48,7 → 48,7
#ifndef __TRACE_TRACE_H
#define __TRACE_TRACE_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/trace/qfixed.h
38,7 → 38,7
#ifndef __TRACE_QFIXED_H
#define __TRACE_QFIXED_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/trace/qcirc.h
38,7 → 38,7
#ifndef __TRACE_QCIRC_H
#define __TRACE_QCIRC_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/trace/queues.h
50,7 → 50,7
 
#include <ll/sys/types.h>
#include <trace/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/bits/endian.h
53,5 → 53,5
#define _QUAD_LOWWORD 0
#endif
 
#include "../../oslib/libm/machine/endian.h"
#include <arch/endian.h>
 
/shark/trunk/include/bits/limits.h
48,7 → 48,7
#ifndef _BITS_LIMITS_H
#define _BITS_LIMITS_H
 
#include <ll/limits.h>
#include <arch/limits.h>
 
#define FILENAME_MAX 1024
#define FOPEN_MAX 20
/shark/trunk/include/bits/errno.h
83,7 → 83,7
#ifndef __BITS_ERRNO_H__
#define __BITS_ERRNO_H__
 
#include <ll/errno.h>
#include <arch/errno.h>
 
/*---------------------------------------------------------------------*/
/* Abort values */
/shark/trunk/include/signal.h
95,7 → 95,7
#include <kernel/types.h>
#include <sys/types.h>
//#include <time.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/stdlib.h
53,10 → 53,10
#ifndef __STDLIB_H__
#define __STDLIB_H__
 
#include <ll/stdlib.h>
#include <arch/stdlib.h>
#include <sys/types.h>
#include <stddef.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/irq.h
47,7 → 47,7
 
#ifndef __HARTIK_IRQ_H
#define __HARTIK_IRQ_H
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/fsinit.h
47,7 → 47,7
#include <fs/major.h>
#include <fs/fsind.h>
#include <fs/mount.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/libio.h
55,7 → 55,7
#ifndef __FS_LIBIO_H
#define __FS_LIBIO_H
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/limits.h
50,7 → 50,7
#define __FS_LIMITS_H
 
#include <bits/limits.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/assert.h
50,7 → 50,7
#define __FS_ASSERT_H
 
#include <kernel/assert.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/mutex.h
59,7 → 59,7
*/
#include <kernel/int_sem.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/mount.h
58,7 → 58,7
 
#include <fs/types.h>
#include <fs/fsconf.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/bdevinit.h
54,7 → 54,7
#include <fs/types.h>
#include <fs/const.h>
#include <fs/bdevconf.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/fs.h
50,7 → 50,7
 
#include <fs/types.h>
#include <fs/mount.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/syscall.h
40,7 → 40,7
#define __FS_SYSCALL_H
 
#include <fs/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/semaph.h
55,7 → 55,7
#define _FS_SEMAPH_H
 
#include <kernel/int_sem.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/util.h
57,13 → 57,13
#include <fs/types.h>
#include <fs/stdarg.h>
 
#include <ll/i386/stdio.h>
//#include <ll/string.h> strcasecmp moved!!!
#include <arch/i386/stdio.h>
//#include <arch/string.h> strcasecmp moved!!!
#include <string.h>
#include <ll/stdlib.h>
#include <arch/stdlib.h>
#include <kernel/log.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/maccess.h
54,7 → 54,7
* verify read/write access to user space
*
*/
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/fs/bdev.h
49,7 → 49,7
#define __FS_BDEV_H__
 
#include <fs/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/stdio.h
97,7 → 97,7
#define _STDIO_H_
 
/* MG */
#include <ll/stdio.h>
#include <arch/stdio.h>
#include <kernel/descr.h>
#include <limits.h>
 
/shark/trunk/include/ctype.h
75,7 → 75,7
#include <features.h>
#include <bits/types.h>
 
#include <ll/ctype.h>
#include <arch/ctype.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/stdarg.h
53,6 → 53,6
#ifndef __STDARG_H__
#define __STDARG_H__
 
#include <ll/stdarg.h>
#include <arch/stdarg.h>
 
#endif
/shark/trunk/include/sched.h
55,7 → 55,7
#define __SCHED_H__
 
#include <kernel/model.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/pthread.h
60,7 → 60,7
#include <signal.h>
#include <errno.h>
#include <kernel/func.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/sys/stat.h
33,7 → 33,7
# include <time.h> /* For time_t. */
#endif
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
/* The Single Unix specification says that some more types are
available here. */
/shark/trunk/include/sys/utsname.h
53,7 → 53,7
#ifndef __SYS_UTSNAME_H__
#define __SYS_UTSNAME_H__
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/sys/sysmacro.h
19,7 → 19,7
 
#ifndef _SYS_SYSMACROS_H
#define _SYS_SYSMACROS_H 1
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
_
/shark/trunk/include/sys/mount.h
44,7 → 44,7
#include <sys/types.h>
#include <fs/mount.h>
#include <fs/fsind.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/include/sys/cdefs.h
19,7 → 19,7
#ifndef _SYS_CDEFS_H
#define _SYS_CDEFS_H 1
 
#include <ll/sys/cdefs.h>
#include <arch/sys/cdefs.h>
 
/* MODIFIED by this add */
/*#define __warn_references(func,str)*/
/shark/trunk/include/sys/types.h
61,7 → 61,7
 
#include <bits/types.h>
#include <sys/htypes.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
/shark/trunk/Rules.mk
0,0 → 1,197
# Shark-specific bits of the build system.
# Include the configuration file.
topdir=$(if $(S),$(S),$(srctree))
include $(topdir)/shark.cfg
 
# Those are the targets used to build all the libraries that compose
# the system. This is the only point (except local Makefiles, of course,
# that need to be added as needed) that has to be modified to add new files
# or directories to the main system.
# $(TARGETS) is the list of the main targets used to build the system,
# it contains all the directories recursed by the main Makefile, and the
# special target libgkern.a, that contains the base system. To add a
# directory that specifies its own libraries simply put it in $(TARGETS).
TARGETS= libgkern.a drivers/ libc/ ports/ tracer/ $(fs-$(SHARK_FS))
 
# $(LIBGKERN-OBJS) is the list of targets that compose libgkern.a. To
# add a directory to it, simply put it here. The generic kernel used to
# be separed from the oslib and from the modules, but that hardly made
# sense for a Shark application, as all those three components are needed
# for it to run.
LIBGKERN-OBJS= arch/$(ARCH)/ kernel/ modules/
 
# Handle Shark configuration. Really insane, indeed, btw there should
# not be the need to modify anything below this point in the file to
# handle common maintainance tasks.
options:=TSC APIC BIOS TRACER FG FB COMPILER
define strip-in-place
$(1):=$(strip $($(1)))
endef
$(foreach cfgopt,$(options),$(eval $(call strip-in-place,$(cfgopt))))
 
cpp-tsc-TRUE:= -D__TSC__
cpp-apic-TRUE:= -D__APIC__
cpp-bios-VM86:= -DVM86
cpp-tracer-NEW:= -D__NEW_TRACER__
cpp-tracer-OLD:= -D__OLD_TRACER__
cpp-fg-FORCE_PXC:= -D__FORCE_PXC__
cpp-fb-VESA:= -DCONFIG_FB_VESA -DCONFIG_LOGO
cpp-fb-FINDPCI:= -DCONFIG_FB_RIVA -DCONFIG_FB_RADEON -DCONFIG_FB_MATROX \
-DCONFIG_LOGO -DCONFIG_FB_MATROX_G100 \
-DCONFIG_FB_MATROX_MILLENIUM -DCONFIG_FB_MATROX_MYSTIQUE
cpp-fb-VGA16:= -DCONFIG_FB_VGA16
 
include-dirs:= \
-I$(topdir)/include -I$(topdir)/modules \
-I$(topdir)/arch/$(ARCH)/include/arch \
-I$(topdir)/libc/arch/$(ARCH)/include \
-I$(topdir)/tracer/include
 
config:= -D__LINUX__ \
$(cpp-tsc-$(TSC)) $(cpp-apic-$(APIC)) $(cpp-bios-$(BIOS)) \
$(cpp-tracer-$(TRACER)) $(cpp-fg-$(FG)) $(cpp-fb-$(FB))
 
exported-cppflags:= $(include-dirs) $(config)
exported-aflags:= -x assembler-with-cpp $(include-dirs) $(config)
 
cc-compiler-GCC4:= -Wimplicit-function-declaration -Wno-attributes \
-Wno-pointer-sign -Wall -O -fno-builtin -nostdinc \
-minline-all-stringops -fno-stack-protector
cc-compiler-GCC3:= -Wimplicit-function-declaration -Wall -O \
-fno-builtin -nostdinc -minline-all-stringops
cc-compiler-DJGPP:= -Wimplicit-function-declaration -Wall -O \
-fno-builtin -nostdinc -minline-all-stringops
 
exported-cflags:= $(cc-compiler-$(COMPILER))
 
fs-YES:= fs/
 
ifndef APP
# If we are not building an application, just build the system libraries.
targets:= $(TARGETS)
libgkern.a-objs:= $(LIBGKERN-OBJS)
all: install
else
# Rules to build a Shark application. The following variables are used:
# APP: the application to build.
# INIT: the initialization object file.
# OTHEROBJS: other objects to be linked to the application.
# OTHERLIBS: other libraries to be linked to the application.
# OTHERINCL: additional preprocessor flags for the app and its
# additional objects.
# SHARKOPT: options to specify which Shark components are to be
# linked to the application.
 
# Directory where we search for the compiled Shark libraries.
libs-dir:= $(if $(B),$(B)/.lib,$(if $(S),$(S)/.lib,\
$(if $(BASE),$(BASE)/.lib,../../.lib)))
ifeq ($(wildcard $(libs-dir)),)
$(error Cannod find Shark build directory)
endif
 
# Handle $(SHARKOPT). Always link the generic kernel and the architecture
# support code, as they're needed for the application to run. Link the
# libc too, as we still don't have proper interface separation.
# XXX Bring back tracer and filesystem.
# XXX The old build system included also the ports and other libs...
app-libs:= -lgkern -lc -lcons -lserial
app-cppflags:= -I$(topdir)/drivers/linuxc26/include\
-I$(topdir)/drivers/cons/include
 
wants-option=$(if $(filter $(1),$(uselib)),y)
 
use-zlib-y:= __ZLIB__
uselib:= $(SHARKOPT)
 
# PCI
libs-__PCI__-y:= -lpci
cppflags-__PCI__-y:= -I$(topdir)/drivers/pci/include
 
# Network
libs-__NET__-y:= -lnet
cppflags-__NET__-y:= -I$(topdir)/drivers/net/include
 
# grx
libs-__GRX__-y:= -lgrx
cppflags-__GRX__-y:= -I$(topdir)/drivers/grx/include
 
# Framebuffer
libs-__FB__-y:= -lfb
cppflags-__FB__-y:= -I$(topdir)/drivers/fb/include
 
# Oldchar
libs-__OLDCHAR__-y:= -loldch
cppflags-__OLDCHAR__-y:= -I$(topdir)/drivers/oldchar/include
 
# Linux compatibility layer
libs-__LINUXC26__-y:= -lcomp26
 
# PCL833
libs-__PCL833__-y:= -lpcl833
cppflags-__PCL833__-y:= -I$(topdir)/drivers/pcl833/include
 
# Parport
libs-__PPORT__-y:= -lpport
cppflags-__PPORT__-y:= -I$(topdir)/drivers/parport/include
 
# PCLAB
libs-__PCLAB__-y:= -lpclab
cppflags-__PCLAB__-y:= -I$(topdir)/drivers/pcl812/include
 
# BTTV
libs-__BTTV__-y:= -lbttv
cppflags-__BTTV__-y:= -I$(topdir)/drivers/bttv/include
 
# Input
libs-__INPUT__-y:= -linput
cppflags-__INPUT__-y:= -I$(topdir)/drivers/input/include
 
# CPU
libs-__CPU__-y:= -lcpu
cppflags-__CPU__-y:= -I$(topdir)/drivers/cpu/include
 
# USB
libs-__USB__-y:= -lusb
cppflags-__USB__-y:= -I$(topdir)/drivers/usb/include
 
# I2C
libs-__I2C__-y:= -li2c
cppflags-__I2C__-y:= -I$(topdir)/drivers/i2c/include
 
# 6025e
libs-__6025E__-y:= -l6025e
cppflags-__6025E__-y:= -I$(topdir)/drivers/pci6025e/include
 
# Mesa
libs-__OSMESA__-y:= -losmesa -lglut -lglu
cppflags-__OSMESA__-y:= -I$(topdir)/ports/mesa/include
 
# Servo
libs-__SERVO__-y:= -lservo
cppflags-__SERVO__-y:= -I$(topdir)/ports/servo/include
 
# TFTP
libs-__TFTP__-y:= -ltftp
cppflags-__TFTP__-y:= -I$(topdir)/ports/tftp/include
 
libs-tracer-OLD:= -ltracer -lnet -lpci -lcomp26
libs-tracer-NEW:= $(libs-tracer-OLD)
 
options= __PCI__ __NET__ __GRX__ __FB__ __OLDCHAR__ __LINUXC26__ __PCL833__\
__PPORT__ __PCLAB__ __BTTV__ __INPUT__ __CPU__ __USB__ __I2C__ \
__6025E__ __OSMESA__ __SERVO__ __TFTP__
 
app-libs+= $(foreach opt,$(options),$(libs-$(opt)-$(call wants-option,$(opt))))
app-cppflags+= $(foreach opt,$(options),$(cppflags-$(opt)-$(call\
wants-option,$(opt))))
 
app-libs+= $(libs-tracer-$(TRACER))
 
targets:= $(APP)
$(APP)-objs:= $(APP).o $(OTHEROBJS)
$(APP)-startup:= $(libs-dir)/x0.o
$(APP)-cppflags+= $(OTHERINCL) $(app-cppflags)
$(APP)-ldflags+= -Bstatic -Ttext $(MEM_START) -s -nostartfiles -nostdlib\
-L$(libs-dir) --start-group $(sort $(app-libs)) $(OTHERLIBS) --end-group
endif
 
/shark/trunk/config/config.mk
6,7 → 6,7
LD = ld
AR = ar
 
INCL = -I$(BASE)/include -I$(BASE)/modules
INCL = -I$(BASE)/include -I$(BASE)/modules -I$(BASE)/libc/arch/$(ARCH)/include
LIB_PATH = $(BASE)/lib
OSLIB = $(BASE)/oslib
OSLIB_PATH = $(OSLIB)/lib
/shark/trunk/lib/makefile
File deleted
/shark/trunk/lib/Makefile
0,0 → 1,15
#
#
#
 
ifndef BASE
BASE=../..
endif
 
.PHONY: all install depend clean cleanall
 
all install clean depend:
 
cleanall:
$(RM) lib*.a
 
/shark/trunk/shark.cfg
7,6 → 7,11
# COMPILER = GCC3, GCC4, DJGPP
COMPILER = GCC4
 
# Architecture selection
# The architecture we're building the system for. The only supported
# value (at the time being) is x86.
ARCH = x86
 
# Kernel Image Start Point
# MEM_START = 0x220000
# The kernel image file will be loaded starting from this
32,7 → 37,7
 
# Select the events tracer
# TRACER = NO,OLD,NEW
TRACER = NO
TRACER = NEW
 
# Select the BIOS INTERRUPT access mode
# BIOS = X,VM86
64,4 → 69,4
# Select the S.Ha.R.K. file system support
# YES = build the FS library
# NO = do not build the FS library
SHARK_FS = NO
SHARK_FS = YES
/shark/trunk/mk/App.mk
0,0 → 1,69
# Copyright (c) 2008 Fabio Checconi <fabio@gandalf.sssup.it>
#
# Helper file defining standard targets for Shark applications. It should
# be included from the application makefiles in this way (preserving much
# of the old behavior):
#
# # Example of Shark application makefile.
# S?=<source tree>
# B?=<build tree, if different from $(S)>
#
# SUBDIRS:= <list of subdirectories>
# APPS:= <list of applications>
#
# include $(S)/mk/App.mk
#
# # For each <application>:
# <application>:
# make -f $(S)/Makefile APP=<application> \
# OTHEROBJS="<list of objects>" \
# OTHERINCL="<list of extra include dirs>" \
# SHARKOPT="<list of options>"
#
# # End of Shark application makefile example.
#
 
ifndef S
$(error Missing Shark source tree specification)
endif
 
define subdir-templ
.PHONY: $(1)-$(2)
$(1)-$(2):
make -C $(1) $(2)
endef
 
define export-if-defined
ifdef $(1)
export $(1)
endif
endef
 
to-be-exported:= S B O CROSS_COMPILE AR CC LD RM INSTALL V
$(foreach v, $(to-be-exported),$(eval $(call export-if-defined,$(v))))
 
foreach-subdir=$(foreach d, $(SUBDIRS),$(eval $(call subdir-templ,$d,$1)))
 
# The default target: build all subdirs and all the applications in the
# current directory.
.PHONY: all
all: subdirs $(APPS)
 
# Build subdirs before applications.
$(APPS): subdirs
 
.PHONY: subdirs
# Build all the subdirs
$(call foreach-subdir,all)
subdirs: $(addsuffix -all,$(SUBDIRS))
 
.PHONY: clean
$(call foreach-subdir,clean)
clean: $(addsuffix -clean,$(SUBDIRS))
rm -f *.o $(APPS)
 
.PHONY: distclean
$(call foreach-subdir,distclean)
distclean: clean $(addsuffix -distclean,$(SUBDIRS))
rm -f .*.deps
 
/shark/trunk/ports/makefile
File deleted
/shark/trunk/ports/snapshot/makefile
File deleted
/shark/trunk/ports/snapshot/Makefile
0,0 → 1,20
# Snapshot Library
 
ifndef BASE
BASE=../..
endif
 
include $(BASE)/config/config.mk
 
LIBRARY = snapshot
 
OBJS_PATH = $(BASE)/ports/snapshot
 
SNAPSHOT = snapshot.o
 
OBJS = $(SNAPSHOT)
 
C_OPT += -I./include -I. -I.. -I../../drivers/fb/include
 
include $(BASE)/config/lib.mk
 
/shark/trunk/ports/zlib/makefile
File deleted
/shark/trunk/ports/zlib/Makefile
0,0 → 1,22
# The Frame Buffer Device
 
ifndef BASE
BASE=../..
endif
 
include $(BASE)/config/config.mk
 
LIBRARY = zlib
 
OBJS_PATH = $(BASE)/ports/zlib
 
ZLIB = adler32.o compress.o crc32.o deflate.o gzio.o\
infblock.o infcodes.o inffast.o inflate.o inftrees.o\
infutil.o trees.o uncompr.o zutil.o
 
OBJS = $(ZLIB)
 
C_OPT += -I../../../drivers/linuxc26/include -I./include -I. -I..
 
include $(BASE)/config/lib.mk
 
/shark/trunk/ports/mesa/makefile
File deleted
/shark/trunk/ports/mesa/src-glut.dos/makefile
File deleted
/shark/trunk/ports/mesa/src-glut.dos/Makefile
0,0 → 1,18
targets:= libglut.a
 
libglut.a-objs:= \
bitmap.o \
color.o \
globals.o \
models.o \
teapot.o \
window.o \
callback.o \
init.o \
menu.o \
overlay.o \
state.o
 
cppflags+= -I$(srctree)/drivers/linuxc26/include -I$(curdir)/../include \
-I$(curdir) -I$(curdir)/../
 
/shark/trunk/ports/mesa/src/makefile
File deleted
/shark/trunk/ports/mesa/src/tnl/Makefile
0,0 → 1,24
targets:= \
t_array_api.o \
t_import_array.o \
t_context.o \
t_eval_api.o \
t_imm_alloc.o \
t_imm_api.o \
t_imm_debug.o \
t_imm_dlist.o \
t_imm_elt.o \
t_imm_eval.o \
t_imm_exec.o \
t_imm_fixup.o \
t_pipeline.o \
t_vb_fog.o \
t_vb_light.o \
t_vb_normals.o \
t_vb_points.o \
t_vb_program.o \
t_vb_render.o \
t_vb_gentex.o \
t_vb_texmat.o \
t_vb_vertex.o
 
/shark/trunk/ports/mesa/src/math/Makefile
0,0 → 1,10
targets:= \
m_clip_debug.o \
m_norm_debug.o \
m_xform_debug.o \
m_eval.o \
m_matrix.o \
m_translate.o \
m_vector.o \
m_xform.o
 
/shark/trunk/ports/mesa/src/swrast/Makefile
0,0 → 1,30
targets:= \
s_aaline.o \
s_aatriangle.o \
s_accum.o \
s_alphabuf.o \
s_alpha.o \
s_bitmap.o \
s_blend.o \
s_buffers.o \
s_context.o \
s_copypix.o \
s_depth.o \
s_drawpix.o \
s_feedback.o \
s_fog.o \
s_histogram.o \
s_imaging.o \
s_lines.o \
s_logic.o \
s_masking.o \
s_pixeltex.o \
s_points.o \
s_readpix.o \
s_span.o \
s_stencil.o \
s_texstore.o \
s_texture.o \
s_triangle.o \
s_zoom.o
 
/shark/trunk/ports/mesa/src/array_cache/Makefile
0,0 → 1,2
targets:= ac_context.o ac_import.o
 
/shark/trunk/ports/mesa/src/Makefile
0,0 → 1,71
targets:= libosmesa.a
 
libosmesa.a-objs:= \
accum.o \
api_arrayelt.o \
api_eval.o \
api_loopback.o \
api_noop.o \
api_validate.o \
attrib.o \
blend.o \
buffers.o \
clip.o \
colortab.o \
context.o \
convolve.o \
debug.o \
depth.o \
dispatch.o \
dlist.o \
drawpix.o \
enable.o \
enums.o \
eval.o \
extensions.o \
feedback.o \
fog.o \
get.o \
glapi.o \
glthread.o \
hash.o \
hint.o \
histogram.o \
image.o \
light.o \
lines.o \
matrix.o \
mmath.o \
pixel.o \
points.o \
polygon.o \
rastpos.o \
state.o \
stencil.o \
texcompress.o \
texformat.o \
teximage.o \
texobj.o \
texstate.o \
texstore.o \
texutil.o \
varray.o \
vpexec.o \
vpparse.o \
vpstate.o \
vtxfmt.o \
array_cache/ \
swrast/ \
swrastst/ \
tnl/ \
math/ \
x86/ \
osmesa/ \
imports.o
 
exported-aflags:= -I$(srctree)/drivers/linuxc26/include/asm \
-I$(srctree)/ports/mesa/include
 
exported-cppflags:= -I$(srctree)/drivers/linuxc26/include \
-I$(srctree)/ports/mesa/include -I$(srctree)/ports/mesa/src
 
/shark/trunk/ports/mesa/src/swrastst/Makefile
0,0 → 1,2
targets:= ss_context.o ss_triangle.o ss_vb.o
 
/shark/trunk/ports/mesa/src/x86/Makefile
0,0 → 1,11
targets:= \
asm_common_x86.o \
common_x86.o \
glapi_x86.o \
mmx_blend.o \
x86.o \
x86_cliptest.o \
xform2_x86.o \
xform3_x86.o \
xform4_x86.o
 
/shark/trunk/ports/mesa/src/osmesa/Makefile
0,0 → 1,2
targets:= osmesa.o
 
/shark/trunk/ports/mesa/src-glu/makefile
File deleted
/shark/trunk/ports/mesa/src-glu/Makefile
0,0 → 1,18
targets:= libglu.a
 
libglu.a-objs:= \
glu.o \
mipmap.o \
nurbs.o \
nurbsutl.o \
project.o \
tess.o \
nurbscrv.o \
nurbssrf.o \
polytest.o \
quadric.o \
tesselat.o
 
cppflags+= -I$(srctree)/drivers/linuxc26/include -I$(curdir)/../include \
-I$(curdir) -I$(curdir)/../
 
/shark/trunk/ports/mesa/Makefile
0,0 → 1,5
targets:= \
src/ \
src-glu/ \
src-glut.dos/
 
/shark/trunk/ports/fftw/makefile
File deleted
/shark/trunk/ports/fftw/rfftw/makefile
File deleted
/shark/trunk/ports/fftw/rfftw/Makefile
0,0 → 1,27
# The real FFTW library
 
ifndef BASE
BASE=../../..
endif
 
include $(BASE)/config/config.mk
 
LIBRARY = fftr
 
OBJS_PATH = $(BASE)/ports/fftw/rfftw
 
OTHERINCL += -I$(BASE)/ports/fftw/include
 
OBJS = frc_1.o frc_2.o frc_3.o frc_4.o frc_5.o frc_6.o frc_7.o frc_8.o \
frc_9.o frc_10.o frc_11.o frc_12.o frc_13.o frc_14.o frc_15.o \
frc_16.o frc_32.o frc_64.o frc_128.o fhf_2.o fhf_3.o fhf_4.o \
fhf_5.o fhf_6.o fhf_7.o fhf_8.o fhf_9.o fhf_10.o fhf_16.o \
fhf_32.o fcr_1.o fcr_2.o fcr_3.o fcr_4.o fcr_5.o fcr_6.o \
fcr_7.o fcr_8.o fcr_9.o fcr_10.o fcr_11.o fcr_12.o fcr_13.o \
fcr_14.o fcr_15.o fcr_16.o fcr_32.o fcr_64.o fcr_128.o fhb_2.o \
fhb_3.o fhb_4.o fhb_5.o fhb_6.o fhb_7.o fhb_8.o fhb_9.o fhb_10.o \
fhb_16.o fhb_32.o rconfig.o rplanner.o rexec.o rexec2.o rfftwnd.o \
rgeneric.o
# rfftwf77.o
 
include $(BASE)/config/lib.mk
/shark/trunk/ports/fftw/fftw/makefile
File deleted
/shark/trunk/ports/fftw/fftw/Makefile
0,0 → 1,29
# The complex FFTW library
 
ifndef BASE
BASE=../../..
endif
 
include $(BASE)/config/config.mk
 
LIBRARY = fftc
 
OBJS_PATH = $(BASE)/ports/fftw/fftw
 
OTHERINCL += -I$(BASE)/ports/fftw/include
 
OBJS = fn_1.o fn_2.o fn_3.o fn_4.o fn_5.o fn_6.o fn_7.o fn_8.o fn_9.o \
fn_10.o fn_11.o fn_12.o fn_13.o fn_14.o fn_15.o fn_16.o fn_32.o \
fn_64.o ftw_2.o ftw_3.o ftw_4.o ftw_5.o ftw_6.o ftw_7.o ftw_8.o \
ftw_9.o ftw_10.o ftw_16.o ftw_32.o ftw_64.o fni_1.o fni_2.o \
fni_3.o fni_4.o fni_5.o fni_6.o fni_7.o fni_8.o fni_9.o fni_10.o \
fni_11.o fni_12.o fni_13.o fni_14.o fni_15.o fni_16.o fni_32.o \
fni_64.o ftwi_2.o ftwi_3.o ftwi_4.o ftwi_5.o ftwi_6.o ftwi_7.o \
ftwi_8.o ftwi_9.o ftwi_10.o ftwi_16.o ftwi_32.o ftwi_64.o \
config.o planner.o twiddle.o executor.o generic.o fftwnd.o malloc.o \
rader.o putils.o \
wisdom.o wisdomio.o
#fftwf77.o timer.o
 
include $(BASE)/config/lib.mk
 
/shark/trunk/ports/fftw/faq/makefile
File deleted
/shark/trunk/ports/fftw/faq/Makefile
0,0 → 1,12
all:
@echo converting 1 ...
perl bfnnconv.pl fftw-faq.bfnn
@echo converting 2 ...
perl bfnnconv.pl fftw-faq.bfnn
 
install-html: all
cp fftw-faq.html/* $(HOME)/WWW/faq/
 
clean:
rm -f *~ core a.out *.lout *.ps *.info *.ascii *.xrefdb *.post
rm -rf *.html
/shark/trunk/ports/fftw/Makefile
0,0 → 1,7
 
.PHONY: all install clean cleanall depend
 
all install clean cleanall depend::
make -C rfftw $@
make -C fftw $@
 
/shark/trunk/ports/first/makefile
File deleted
/shark/trunk/ports/first/fsf_include/tests/makefile
File deleted
/shark/trunk/ports/first/fsf_include/tests/shark_glue/makefile
File deleted
/shark/trunk/ports/first/fsf_include/tests/shark_glue/Makefile
0,0 → 1,20
#
# util_linux -> compiles the tracer utilities under Linux
#
 
ifndef BASE
BASE=../../..
endif
 
.PHONY: util_dos util_linux clean
 
all: udpdump
 
udpdump: udpdump.c
gcc -Wimplicit-function-declaration -Wall -ggdb\
-I$(BASE)/tracer/include -I$(BASE)/oslib udpdump.c -o udpdump
 
clean:
rm -rf *.o udpdump
 
 
/shark/trunk/ports/first/fsf_include/tests/fsf_negotiation_test/makefile
File deleted
/shark/trunk/ports/first/fsf_include/tests/fsf_negotiation_test/Makefile
0,0 → 1,29
#
#
ifeq ($(OS), S)
BASE=../../../../..
OSNAME = shark_glue
export BASE
 
include $(BASE)/config/config.mk
endif
 
PROGS= $(OS)_$(WL)_negotiation_test
 
ifeq ($(OS), S)
include $(BASE)/config/example.mk
endif
 
$(OS)_$(WL)_negotiation_test:
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=fsf_negotiation_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o ../$(OSNAME)/net_print.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"
 
ifeq ($(OS), M)
 
HERE=$(shell /bin/pwd)
export HERE
 
$(PROGS):
cd /home/marte/fsf ; make $(PROGS)
 
endif
 
/shark/trunk/ports/first/fsf_include/tests/synch_obj_test/makefile
File deleted
/shark/trunk/ports/first/fsf_include/tests/synch_obj_test/Makefile
0,0 → 1,19
#
#
ifeq ($(OS), S)
BASE=../../../../..
OSNAME = shark_glue
export BASE
 
include $(BASE)/config/config.mk
endif
 
PROGS= $(OS)_$(WL)_synch_test
 
ifeq ($(OS), S)
include $(BASE)/config/example.mk
endif
 
$(OS)_$(WL)_synch_test:
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=fsf_synch_obj_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o ../$(OSNAME)/net_print.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"
 
/shark/trunk/ports/first/fsf_include/tests/Makefile
0,0 → 1,44
ifndef OS
OS=S
endif
 
ifndef WL
WL=0
endif
 
ifeq ($(OS), S)
include ../../../../shark.cfg
endif
 
ifeq ($(OS), M)
endif
 
export OS
export WL
 
ifeq ($(findstring NEW,$(TRACER)) , NEW)
TRC = newtrace
endif
 
dirs := $(filter-out CVS cvs tefses shark_glue marte_glue common tabledriven makefile readme.txt newtrace README.TXT, $(wildcard *))
dirs += $(TRC)
p_all := $(addprefix prefixall_, $(dirs))
p_install := $(addprefix prefixinstall_, $(dirs))
p_clean := $(addprefix prefixclean_, $(dirs))
pcleanall := $(addprefix prefixcleanall_, $(dirs))
pdepend := $(addprefix prefixdepend_, $(dirs))
 
 
.PHONY: all clean
 
 
 
all: $(p_all)
 
clean: $(p_clean)
 
prefixall_%:
make -C $*
 
prefixclean_%:
make -C $* clean
/shark/trunk/ports/first/fsf_include/tests/fsf_jitter_test/makefile
File deleted
/shark/trunk/ports/first/fsf_include/tests/fsf_jitter_test/Makefile
0,0 → 1,19
#
#
ifeq ($(OS), S)
BASE=../../../../..
OSNAME = shark_glue
export BASE
 
include $(BASE)/config/config.mk
endif
 
PROGS= $(OS)_$(WL)_jitter_test
 
ifeq ($(OS), S)
include $(BASE)/config/example.mk
endif
 
$(OS)_$(WL)_jitter_test:
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=jitter_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o ../$(OSNAME)/net_print.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"
 
/shark/trunk/ports/first/first-contract.c
34,7 → 34,7
#include <kernel/descr.h>
#include <kernel/func.h>
#include <pistar.h>
#include <ll/i386/string.h>
#include <arch/i386/string.h>
 
#define MAX_SHARED_NAME 15
 
/shark/trunk/ports/first/include/pistar.h
90,7 → 90,7
#define __PISTAR_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/ports/first/modules/fedfstar.c
37,8 → 37,8
 
#include "ll/i386/64bit.h"
#include "fedfstar.h"
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/ports/first/modules/tdstar.c
36,8 → 36,8
*/
#include "fsf.h"
#include "tdstar.h"
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/ports/first/modules/mpegstar.c
36,8 → 36,8
*/
 
 
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/ports/first/modules/pistar.c
54,8 → 54,8
 
 
#include <ll/ll.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/descr.h>
/shark/trunk/ports/first/modules/edfstar.c
36,8 → 36,8
*/
 
#include "edfstar.h"
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/ports/first/modules/rmstar.c
36,8 → 36,8
*/
 
#include "rmstar.h"
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/ports/first/modules/nonestar.c
36,8 → 36,8
*/
 
 
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/ports/first/modules/posixstar.c
36,8 → 36,8
*/
 
 
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/ports/first/Makefile
0,0 → 1,21
# The Frame Buffer Device
ifndef BASE
BASE=../..
endif
 
include $(BASE)/config/config.mk
 
LIBRARY = first
 
OBJS_PATH = $(BASE)/ports/first
 
FIRST = first-contract.o first-server.o first-sync.o server-task.o first-error.o \
./modules/grubstar.o ./modules/posixstar.o ./modules/fedfstar.o ./modules/cbsnhstar.o \
./modules/edfstar.o ./modules/cbsstar.o ./modules/rmstar.o \
./modules/nonestar.o ./modules/pistar.o ./modules/tdstar.o
 
OBJS = $(FIRST)
 
C_OPT += -I./fsf_include -I./include -I. -I..
 
include $(BASE)/config/lib.mk
/shark/trunk/ports/dynalink/makefile
File deleted
/shark/trunk/ports/dynalink/elf.c
22,7 → 22,7
#include <ll/i386/cons.h>
#include <ll/i386/error.h>
#include <ll/i386/mem.h>
#include <ll/ctype.h>
#include <arch/ctype.h>
#include <ll/i386/x-bios.h>
 
#include "format.h"
/shark/trunk/ports/dynalink/dynalink.c
23,7 → 23,7
#include <ll/i386/cons.h>
#include <ll/i386/error.h>
#include <ll/i386/mem.h>
#include <ll/ctype.h>
#include <arch/ctype.h>
#include <ll/i386/x-bios.h>
 
#include "format.h"
/shark/trunk/ports/dynalink/Makefile
0,0 → 1,29
# Dynalink
 
ifndef BASE
BASE=../..
endif
 
include $(BASE)/config/config.mk
 
LIBRARY = dynalink
 
OBJS_PATH = $(BASE)/dynalink
 
 
OBJS = dynalink.o elf.o
 
OTHERINCL += -I$(BASE)/drivers/linuxc26/include -I./include -I.
OTHERINCL += -I$(BASE)/drivers/pci/include
OTHERINCL += -I$(BASE)/drivers/input/include
 
 
 
C_OPT += -D__KERNEL__ -D__i386__ $(CFG_VIDEO_OPT)
 
include $(BASE)/config/lib.mk
 
clean::
rm -f $(OBJS)
rm -f deps
 
/shark/trunk/ports/tftp/makefile
File deleted
/shark/trunk/ports/tftp/Makefile
0,0 → 1,6
targets:= libtftp.a
 
libtftp.a-objs:= tftp.o endn.o
 
cppflags+= -I$(srctree)/ports/tftp/include -I$(srctree)/drivers/net/include/
 
/shark/trunk/ports/Makefile
0,0 → 1,2
targets:= mesa/ servo/ tftp/
 
/shark/trunk/ports/didma/makefile
File deleted
/shark/trunk/ports/didma/Makefile
0,0 → 1,18
# The DIDMA library
 
ifndef BASE
BASE=../..
endif
 
include $(BASE)/config/config.mk
 
LIBRARY = didma
 
OBJS_PATH = $(BASE)/ports/didma
 
# Object files
OTHERINCL=-I ./include
OBJS = didma.o
 
include $(BASE)/config/lib.mk
 
/shark/trunk/ports/servo/makefile
File deleted
/shark/trunk/ports/servo/Makefile
0,0 → 1,6
targets:= libservo.a
 
libservo.a-objs:= servo.o
 
cppflags+= -I$(curdir)/include -I$(curdir) -I$(srctree)/drivers/serial/include
 
/shark/trunk/fs/makefile
File deleted
/shark/trunk/fs/rtcfunc.h
57,7 → 57,7
 
#include <time.h>
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/fs/Makefile
0,0 → 1,37
targets:= libfs.a
 
libfs.a-objs:= \
access.o \
chdir.o \
close.o \
closedir.o \
dcache.o \
dentry.o \
fcntl.o \
fdevice.o \
file.o \
fs.o \
fstat.o \
getcwd.o \
getumask.o \
inode.o \
lseek.o \
mount.o \
open.o \
opendir.o \
read.o \
readdir.o \
rwlock.o \
rtc.o \
stat.o \
super.o \
truncate.o \
umask.o \
umount.o \
unlink.o \
utime.o \
write.o
 
exported-cppflags:= -D_PARANOIA -DNDEBUG -I$(curdir) \
-imacros $(srctree)/include/fs/fsconf.h
 
/shark/trunk/fs/msdos/makefile
File deleted
/shark/trunk/fs/msdos/Makefile
0,0 → 1,26
#
# The MSDOS (FAT16) sub-library
#
 
ifndef BASE
BASE=../..
endif
 
include $(BASE)/config/config.mk
 
LIBRARY = fs
 
OBJS_PATH = $(BASE)/fs/msdos
 
OBJS= msdos_i.o \
msdos_f.o \
msdos_s.o \
msdos_d.o
 
#C_DEF += -D_PARANOIA
C_DEF += -D_PARANOIA -DNDEBUG
 
C_MAC += -imacros $(BASE)/include/fs/fsconf.h
C_INC += -I..
 
include $(BASE)/config/sublib.mk
/shark/trunk/modules/makefile
File deleted
/shark/trunk/modules/rrsoft/subdir.mk
File deleted
/shark/trunk/modules/rrsoft/rrsoft/rrsoft.h
103,7 → 103,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/rrsoft/rrsoft.c
54,8 → 54,8
 
 
#include <rrsoft/rrsoft/rrsoft.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/rrsoft/Makefile
0,0 → 1,0
targets:= rrsoft.o
/shark/trunk/modules/ps/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/ps/ps/ps.h
93,7 → 93,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/ps/ps.c
97,8 → 97,8
 
 
#include <ps/ps/ps.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/ps/Makefile
0,0 → 1,0
targets:= ps.o
/shark/trunk/modules/rr/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/rr/rr/rr.h
95,7 → 95,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/rr/rr.c
54,8 → 54,8
 
 
#include <rr/rr/rr.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/rr/Makefile
0,0 → 1,0
targets:= rr.o
/shark/trunk/modules/sem/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/sem/sem/sem.h
73,7 → 73,7
#define __MODULES_SEM_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/sem/sem.c
63,7 → 63,7
#include <sem/sem/sem.h>
#include <kernel/config.h>
#include <ll/ll.h>
#include <ll/string.h>
#include <arch/string.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/descr.h>
/shark/trunk/modules/sem/Makefile
0,0 → 1,0
targets:= sem.o
/shark/trunk/modules/elastic/subdir.mk
File deleted
/shark/trunk/modules/elastic/Makefile
0,0 → 1,0
targets:= elastic.o
/shark/trunk/modules/intdrive/subdir.mk
File deleted
/shark/trunk/modules/intdrive/intdrive/intdrive.h
43,7 → 43,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/intdrive/Makefile
0,0 → 1,0
targets:= intdrive.o inttask.o
/shark/trunk/modules/ss/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/ss/ss/ss.h
103,7 → 103,7
#include <kernel/config.h>
#include <kernel/types.h>
#include <sys/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/ss/ss/ssutils.h
62,7 → 62,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/ss/ss.c
114,8 → 114,8
 
#include <stdlib.h>
#include <ss/ss/ss.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
 
#include <ll/sys/ll/event.h>
 
/shark/trunk/modules/ss/Makefile
0,0 → 1,0
targets:= ss.o
/shark/trunk/modules/tbs/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/tbs/tbs/tbs.h
126,7 → 126,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/tbs/tbs.c
54,8 → 54,8
 
 
#include <tbs/tbs/tbs.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/tbs/Makefile
0,0 → 1,0
targets:= tbs.o
/shark/trunk/modules/dummy/subdir.mk
File deleted
/shark/trunk/modules/dummy/dummy/dummy.h
79,7 → 79,7
#define __DUMMY_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/dummy/dummy.c
54,8 → 54,8
 
#include <dummy/dummy/dummy.h>
#include <ll/ll.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/model.h>
/shark/trunk/modules/dummy/Makefile
0,0 → 1,0
targets:= dummy.o
/shark/trunk/modules/nop/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/nop/nop/nop.h
80,7 → 80,7
#define __NOP_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/nop/nop.c
54,8 → 54,8
#include <nop/nop/nop.h>
 
#include <ll/ll.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/descr.h>
/shark/trunk/modules/nop/Makefile
0,0 → 1,0
targets:= nop.o
/shark/trunk/modules/npp/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/npp/npp/npp.h
88,7 → 88,7
#ifndef __NPP_H__
#define __NPP_H__
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/npp/Makefile
0,0 → 1,0
targets:= npp.o
/shark/trunk/modules/npp/npp.c
54,8 → 54,8
#include <npp/npp/npp.h>
 
#include <ll/ll.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/descr.h>
/shark/trunk/modules/edf/subdir.mk
File deleted
/shark/trunk/modules/edf/edf.c
55,8 → 55,8
 
 
#include <edf/edf/edf.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/edf/Makefile
0,0 → 1,0
targets:= edf.o
/shark/trunk/modules/edf/edf/edf.h
144,7 → 144,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/posix/subdir.mk
File deleted
/shark/trunk/modules/posix/posix/posix.h
96,7 → 96,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/posix/posix.c
57,8 → 57,8
 
 
#include <posix/posix/posix.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/posix/Makefile
0,0 → 1,0
targets:= posix.o
/shark/trunk/modules/pc/subdir.mk
File deleted
/shark/trunk/modules/pc/pc/pc.h
92,7 → 92,7
 
#include <kernel/types.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/pc/pc.c
54,8 → 54,8
#include <pc/pc/pc.h>
 
#include <ll/ll.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/var.h>
/shark/trunk/modules/pc/Makefile
0,0 → 1,0
targets:= pc.o
/shark/trunk/modules/bd_edf/subdir.mk
File deleted
/shark/trunk/modules/bd_edf/bd_edf/bd_edf.h
50,7 → 50,7
 
#include <kernel/types.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/bd_edf/bd_edf.c
48,8 → 48,8
#include <bd_edf/bd_edf/bd_edf.h>
 
#include <ll/ll.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/var.h>
/shark/trunk/modules/bd_edf/Makefile
0,0 → 1,0
targets:= bd_edf.o
/shark/trunk/modules/hartport/subdir.mk
File deleted
/shark/trunk/modules/hartport/hartport/hartport.h
77,7 → 77,7
#include <sem/sem/sem.h>
#include <ll/ll.h>
 
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/hartport/hartport.c
60,8 → 60,8
#include <hartport/hartport/hartport.h>
#include <kernel/config.h>
#include <ll/ll.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/model.h>
#include <kernel/const.h>
#include <sys/types.h>
/shark/trunk/modules/hartport/Makefile
0,0 → 1,0
targets:= hartport.o
/shark/trunk/modules/srp/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/srp/srp/srp.h
107,7 → 107,7
 
#include <kernel/model.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/srp/srp.c
138,8 → 138,8
#include <srp/srp/srp.h>
 
#include <ll/ll.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/descr.h>
/shark/trunk/modules/srp/Makefile
0,0 → 1,0
targets:= srp.o
/shark/trunk/modules/rr2/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/rr2/rr2/rr2.h
94,7 → 94,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/rr2/rr2.c
54,8 → 54,8
 
 
#include <rr2/rr2/rr2.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/rr2/Makefile
0,0 → 1,0
targets:= rr2.o
/shark/trunk/modules/hardcbs/subdir.mk
File deleted
/shark/trunk/modules/hardcbs/hardcbs/hardcbs.h
96,7 → 96,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/hardcbs/hardcbs.c
39,8 → 39,8
*/
 
#include <hardcbs/hardcbs/hardcbs.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/hardcbs/Makefile
0,0 → 1,0
targets:= hardcbs.o
/shark/trunk/modules/ds/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/ds/ds/ds.h
92,7 → 92,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/ds/ds.c
58,8 → 58,8
 
 
#include <ds/ds/ds.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/ds/Makefile
0,0 → 1,0
targets:= ds.o
/shark/trunk/modules/cbs/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/cbs/cbs/cbs.h
103,7 → 103,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/cbs/cbs.c
54,8 → 54,8
 
 
#include <cbs/cbs/cbs.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/cbs/Makefile
0,0 → 1,0
targets:= cbs.o
/shark/trunk/modules/cabs/subdir.mk
File deleted
/shark/trunk/modules/cabs/cabs/cabs.h
66,7 → 66,7
#define __CAB_H__
 
#include <ll/sys/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/cabs/cabs.c
59,7 → 59,7
 
#include <kernel/config.h>
#include <ll/ll.h>
#include <ll/string.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/const.h>
#include <sys/types.h>
/shark/trunk/modules/cabs/Makefile
0,0 → 1,0
targets:= cabs.o
/shark/trunk/modules/pi/subdir.mk
File deleted
/shark/trunk/modules/pi/pi/pi.h
90,7 → 90,7
#define __PI_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/pi/pi.c
54,8 → 54,8
#include <pi/pi/pi.h>
 
#include <ll/ll.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/descr.h>
/shark/trunk/modules/pi/Makefile
0,0 → 1,0
targets:= pi.o
/shark/trunk/modules/nopm/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/nopm/nopm/nopm.h
59,7 → 59,7
#define __NOPM_H__
 
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/nopm/nopm.c
54,8 → 54,8
#include <nopm/nopm/nopm.h>
 
#include <ll/ll.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/descr.h>
/shark/trunk/modules/nopm/Makefile
0,0 → 1,0
targets:= nopm.o
/shark/trunk/modules/bd_pscan/subdir.mk
File deleted
/shark/trunk/modules/bd_pscan/bd_pscan/bd_pscan.h
51,7 → 51,7
 
#include <kernel/types.h>
#include <kernel/descr.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/modules/bd_pscan/bd_pscan.c
48,8 → 48,8
#include <bd_pscan/bd_pscan/bd_pscan.h>
 
#include <ll/ll.h>
#include <ll/string.h>
#include <ll/stdio.h>
#include <arch/string.h>
#include <arch/stdio.h>
#include <kernel/const.h>
#include <sys/types.h>
#include <kernel/var.h>
/shark/trunk/modules/bd_pscan/Makefile
0,0 → 1,0
targets:= bd_pscan.o
/shark/trunk/modules/Makefile
0,0 → 1,27
targets:= \
bd_edf/ \
bd_pscan/ \
cabs/ \
cbs/ \
ds/ \
dummy/ \
edf/ \
elastic/ \
hardcbs/ \
hartport/ \
intdrive/ \
nop/ \
nopm/ \
npp/ \
pc/ \
pi/ \
posix/ \
ps/ \
rm/ \
rr/ \
rr2/ \
rrsoft/ \
sem/ \
srp/ \
ss/ \
tbs/
/shark/trunk/modules/rm/subdir.mk
File deleted
\ No newline at end of file
/shark/trunk/modules/rm/rm.c
54,8 → 54,8
 
 
#include <rm/rm/rm.h>
#include <ll/stdio.h>
#include <ll/string.h>
#include <arch/stdio.h>
#include <arch/string.h>
#include <kernel/model.h>
#include <kernel/descr.h>
#include <kernel/var.h>
/shark/trunk/modules/rm/Makefile
0,0 → 1,0
targets:= rm.o
/shark/trunk/modules/rm/rm/rm.h
144,7 → 144,7
#include <kernel/config.h>
#include <sys/types.h>
#include <kernel/types.h>
#include "ll/sys/cdefs.h"
#include <arch/sys/cdefs.h>
 
__BEGIN_DECLS
 
/shark/trunk/libc/makefile
File deleted
/shark/trunk/libc/assert/makefile
File deleted
/shark/trunk/libc/assert/Makefile
0,0 → 1,2
targets:= assert.o
 
/shark/trunk/libc/stdlib/makefile
File deleted
/shark/trunk/libc/stdlib/Makefile
0,0 → 1,13
targets:= \
abort.o \
atexit.o \
calloc.o \
free.o \
malloc.o \
realloc.o \
strtod.o \
strtol.o \
strtoul.o \
qsort.o \
bsearch.o
 
/shark/trunk/libc/getopt/makefile
File deleted
/shark/trunk/libc/getopt/Makefile
0,0 → 1,2
targets:= getopt.o getopt1.o
 
/shark/trunk/libc/stdio/makefile
File deleted
/shark/trunk/libc/stdio/Makefile
0,0 → 1,63
targets:= \
asprintf.o \
clrerr.o \
fclose.o \
fdopen.o \
feof.o \
ferror.o \
fflush.o \
fgetc.o \
fgetln.o \
fgetpos.o \
fgets.o \
fileno.o \
findfp.o \
flags.o \
fopen.o \
fprintf.o \
fpurge.o \
fputc.o \
fputs.o \
fread.o \
freopen.o \
fscanf.o \
fseek.o \
fsetpos.o \
ftell.o \
funopen.o \
fvwrite.o \
fwalk.o \
fwrite.o \
getc.o \
getchar.o \
gets.o \
getw.o \
makebuf.o \
mktemp.o \
printf.o \
putc.o \
putchar.o \
puts.o \
putw.o \
refill.o \
remove.o \
rewind.o \
rget.o \
scanf.o \
setbuf.o \
setbuffe.o \
setvbuf.o \
snprintf.o \
stdio.o \
tempnam.o \
tmpnam.o \
ungetc.o \
vasprint.o \
vfprintf.o \
vfscanf.o \
vprintf.o \
vscanf.o \
vsnprint.o \
wbuf.o \
wsetup.o
 
/shark/trunk/libc/stdio/vfprintf.c
35,7 → 35,7
*/
 
/* MODIFIED:
* --added include <ll/math.h>
* --added include <arch/math.h>
* --initialization to prevent warnings
*/
 
82,18 → 82,18
# undef _ANSI_SOURCE
# if defined(_POSIX_SOURCE)
# undef _POSIX_SOURCE
# include <ll/math.h>
# include <arch/math.h>
# define _POSIX_SOURCE
# else
# include <ll/math.h>
# include <arch/math.h>
# endif
# define _ANSI_SOURCE
# elif defined(_POSIX_SOURCE)
# undef _POSIX_SOURCE
# include <ll/math.h>
# include <arch/math.h>
# define _POSIX_SOURCE
# else
# include <ll/math.h>
# include <arch/math.h>
# endif
#endif
 
/shark/trunk/libc/ctype/makefile
File deleted
/shark/trunk/libc/ctype/Makefile
0,0 → 1,2
targets:= ctype.o
 
/shark/trunk/libc/string/makefile
File deleted
/shark/trunk/libc/string/strcasecmp.c
50,8 → 50,8
 
 
 
#include <ll/i386/string.h>
#include <ll/ctype.h>
#include <arch/i386/string.h>
#include <arch/ctype.h>
 
int strcasecmp(const char *s1, const char *s2)
{
/shark/trunk/libc/string/Makefile
0,0 → 1,2
targets:= strcasecmp.o
 
/shark/trunk/libc/unistd/makefile
File deleted
/shark/trunk/libc/unistd/Makefile
0,0 → 1,5
targets:= \
fpathcon.o \
pathconf.o \
sysconf.o
 
/shark/trunk/libc/quad/makefile
File deleted
/shark/trunk/libc/quad/Makefile
0,0 → 1,28
targets:= \
adddi3.o \
anddi3.o \
ashldi3.o \
ashrdi3.o \
cmpdi2.o \
divdi3.o \
fixdfdi.o \
fixsfdi.o \
fixunsdf.o \
fixunssf.o \
floatdid.o \
floatdis.o \
floatuns.o \
iordi3.o \
lshldi3.o \
lshrdi3.o \
moddi3.o \
muldi3.o \
negdi2.o \
notdi2.o \
qdivrem.o \
subdi3.o \
ucmpdi2.o \
udivdi3.o \
umoddi3.o \
xordi3.o
 
/shark/trunk/libc/quad/old/makefile
File deleted
/shark/trunk/libc/quad/old/Makefile
0,0 → 1,62
#
# GNU-C 32 bit makefile
#
 
HARTIK=$(BASE)
 
include $(HARTIK)/config/config.mak
 
# to remove
CP=cp
RM=rm -f
 
C_DEF += -D_THREAD_SAFE
#C_INC += -I.
 
#
# Device driver files
#
 
C_SRCS= anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c fixdfdi.c \
fixsfdi.c fixunsdf.c fixunssf.c floatdid.c floatdis.c \
floatuns.c iordi3.c lshldi3.c lshrdi3.c moddi3.c \
muldi3.c negdi2.c notdi2.c subdi3.c adddi3.c qdivrem.c \
ucmpdi2.c udivdi3.c umoddi3.c xordi3.c
 
S_SRCS=
 
SRCS= $(C_SRCS) $(S_SRCS)
 
#
 
LIBNAME= c
 
#
# Finally the dependency rules!
#
 
.PHONY : all install depend clean allclean
 
 
#
 
all install: ../lib$(LIBNAME).a
 
depend deps:
$(CC) $(C_OPT) -M $(C_SRCS) >deps
 
clean :
-del *.o
-del *.err
-del *.a
 
allclean : clean
 
#
#
#
 
include deps
 
../lib$(LIBNAME).a : $(SRCS:.c=.o)
ar rs ../lib$(LIBNAME).a $(SRCS:.c=.o)
/shark/trunk/libc/utsname/makefile
File deleted
/shark/trunk/libc/utsname/Makefile
0,0 → 1,2
targets:= utsname.o
 
/shark/trunk/libc/Makefile
0,0 → 1,16
targets:= libc.a
 
libc.a-objs:= \
init.o \
libio/ \
quad/ \
stdio/ \
stdlib/ \
assert/ \
unistd/ \
utsname/ \
ctype/ \
string/ \
getopt/ \
arch/$(ARCH)/
 
/shark/trunk/libc/arch/x86/libm/msun/i387/Makefile
0,0 → 1,26
targets:= \
e_acos.o \
e_asin.o \
e_atan2.o \
e_exp.o \
e_fmod.o \
e_log.o \
e_log10.o \
e_remain.o \
e_scalb.o \
e_sqrt.o \
s_atan.o \
s_ceil.o \
s_copysi.o \
s_cos.o \
s_finite.o \
s_floor.o \
s_ilogb.o \
s_log1p.o \
s_logb.o \
s_rint.o \
s_scalbn.o \
s_signif.o \
s_sin.o \
s_tan.o
 
/shark/trunk/libc/arch/x86/libm/msun/i387/s_ilogb.s
0,0 → 1,53
/*
* Copyright (c) 1994 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_ilogb.S,v 1.2.6.1 1996/02/25 20:34:46 bde Exp $")
 
ENTRY(ilogb)
pushl %ebp
movl %esp,%ebp
subl $4,%esp
 
fldl 8(%ebp)
fxtract
fstpl %st
 
fistpl -4(%ebp)
movl -4(%ebp),%eax
 
leave
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_remain.s
0,0 → 1,48
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_remainder.S,v 1.2 1994/08/19 11:14:18 jkh Exp $")
 
ENTRY(__ieee754_remainder)
fldl 12(%esp)
fldl 4(%esp)
1: fprem1
fstsw %ax
sahf
jp 1b
fstpl %st(1)
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_scalbn.s
0,0 → 1,45
/*
* Copyright (c) 1994 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_scalbn.S,v 1.2.6.1 1996/12/15 15:15:45 bde Exp $")
 
ENTRY(scalbn)
fildl 12(%esp)
fldl 4(%esp)
fscale
fstp %st(1)
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_log.s
0,0 → 1,44
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_log.S,v 1.2 1994/08/19 11:14:15 jkh Exp $")
 
ENTRY(__ieee754_log)
fldln2
fldl 4(%esp)
fyl2x
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_log10.s
0,0 → 1,44
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_log10.S,v 1.2 1994/08/19 11:14:16 jkh Exp $")
 
ENTRY(__ieee754_log10)
fldlg2
fldl 4(%esp)
fyl2x
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_copysi.s
0,0 → 1,48
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_copysign.S,v 1.2 1994/08/19 11:14:22 jkh Exp $")
 
ENTRY(copysign)
movl 16(%esp),%edx
andl $0x80000000,%edx
movl 8(%esp),%eax
andl $0x7fffffff,%eax
orl %edx,%eax
movl %eax,8(%esp)
fldl 4(%esp)
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_scalb.s
0,0 → 1,45
/*
* Copyright (c) 1994 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_scalb.S,v 1.2.6.1 1996/12/15 15:15:43 bde Exp $")
 
ENTRY(__ieee754_scalb)
fldl 12(%esp)
fldl 4(%esp)
fscale
fstp %st(1)
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_acos.s
0,0 → 1,50
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_acos.S,v 1.2 1994/08/19 11:12:52 jkh Exp $")
 
/* acos = atan (sqrt(1 - x^2) / x) */
ENTRY(__ieee754_acos)
fldl 4(%esp) /* x */
fst %st(1)
fmul %st(0) /* x^2 */
fld1
fsubp /* 1 - x^2 */
fsqrt /* sqrt (1 - x^2) */
fxch %st(1)
fpatan
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_fmod.s
0,0 → 1,48
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_fmod.S,v 1.2 1994/08/19 11:14:15 jkh Exp $")
 
ENTRY(__ieee754_fmod)
fldl 12(%esp)
fldl 4(%esp)
1: fprem
fstsw %ax
sahf
jp 1b
fstpl %st(1)
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_sqrt.s
0,0 → 1,43
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_sqrt.S,v 1.2 1994/08/19 11:14:20 jkh Exp $")
 
ENTRY(__ieee754_sqrt)
fldl 4(%esp)
fsqrt
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_ceil.s
0,0 → 1,58
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_ceil.S,v 1.2.6.1 1996/12/15 15:23:16 bde Exp $")
 
ENTRY(ceil)
pushl %ebp
movl %esp,%ebp
subl $8,%esp
 
fstcw -4(%ebp) /* store fpu control word */
movw -4(%ebp),%dx
orw $0x0800,%dx /* round towards +oo */
andw $0xfbff,%dx
movw %dx,-8(%ebp)
fldcw -8(%ebp) /* load modfied control word */
 
fldl 8(%ebp); /* round */
frndint
 
fldcw -4(%ebp) /* restore original control word */
 
leave
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_asin.s
0,0 → 1,49
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_asin.S,v 1.2 1994/08/19 11:14:12 jkh Exp $")
 
/* asin = atan (x / sqrt(1 - x^2)) */
ENTRY(__ieee754_asin)
fldl 4(%esp) /* x */
fst %st(1)
fmul %st(0) /* x^2 */
fld1
fsubp /* 1 - x^2 */
fsqrt /* sqrt (1 - x^2) */
fpatan
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_rint.s
0,0 → 1,43
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_rint.S,v 1.2 1994/08/19 11:14:29 jkh Exp $")
 
ENTRY(rint)
fldl 4(%esp)
frndint
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_exp.s
0,0 → 1,54
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_exp.S,v 1.2.6.3 1996/06/08 08:25:28 bde Exp $")
 
/* e^x = 2^(x * log2(e)) */
ENTRY(__ieee754_exp)
fldl 4(%esp)
fldl2e
fmulp /* x * log2(e) */
fstl %st(1)
frndint /* int(x * log2(e)) */
fstl %st(2)
fsubrp /* fract(x * log2(e)) */
f2xm1 /* 2^(fract(x * log2(e))) - 1 */
fld1
faddp /* 2^(fract(x * log2(e))) */
fscale /* e^x */
fstpl %st(1)
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_finite.s
0,0 → 1,46
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_finite.S,v 1.2 1994/08/19 11:14:24 jkh Exp $")
 
ENTRY(finite)
movl 8(%esp),%eax
andl $0x7ff00000, %eax
cmpl $0x7ff00000, %eax
setne %al
andl $0x000000ff, %eax
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_signif.s
0,0 → 1,44
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_significand.S,v 1.2 1994/08/19 11:14:30 jkh Exp $")
 
ENTRY(significand)
fldl 4(%esp)
fxtract
fstpl %st(1)
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_floor.s
0,0 → 1,58
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_floor.S,v 1.2.6.1 1996/12/15 15:23:17 bde Exp $")
 
ENTRY(floor)
pushl %ebp
movl %esp,%ebp
subl $8,%esp
 
fstcw -4(%ebp) /* store fpu control word */
movw -4(%ebp),%dx
orw $0x0400,%dx /* round towards -oo */
andw $0xf7ff,%dx
movw %dx,-8(%ebp)
fldcw -8(%ebp) /* load modfied control word */
 
fldl 8(%ebp); /* round */
frndint
 
fldcw -4(%ebp) /* restore original control word */
 
leave
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_log1p.s
0,0 → 1,55
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_log1p.S,v 1.3 1994/08/19 23:52:29 jkh Exp $")
 
/*
* The fyl2xp1 instruction has such a limited range:
* -(1 - (sqrt(2) / 2)) <= x <= sqrt(2) - 1
* it's not worth trying to use it.
*
* Also, I'm not sure fyl2xp1's extra precision will
* matter once the result is converted from extended
* real (80 bits) back to double real (64 bits).
*/
ENTRY(log1p)
fldln2
fldl 4(%esp)
fld1
faddp
fyl2x
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_tan.s
0,0 → 1,58
/*
* Copyright (c) 1994 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_tan.S,v 1.2 1994/08/19 11:14:32 jkh Exp $")
 
ENTRY(tan)
fldl 4(%esp)
fptan
fnstsw %ax
andw $0x400,%ax
jnz 1f
fstp %st(0)
ret
1: fldpi
fadd %st(0)
fxch %st(1)
2: fprem1
fstsw %ax
andw $0x400,%ax
jnz 2b
fstp %st(1)
fptan
fstp %st(0)
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_atan.s
0,0 → 1,44
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_atan.S,v 1.2 1994/08/19 11:14:20 jkh Exp $")
 
ENTRY(atan)
fldl 4(%esp)
fld1
fpatan
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_logb.s
0,0 → 1,44
/*
* Copyright (c) 1993,94 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_logb.S,v 1.2 1994/08/19 11:14:28 jkh Exp $")
 
ENTRY(logb)
fldl 4(%esp)
fxtract
fstpl %st
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_cos.s
0,0 → 1,56
/*
* Copyright (c) 1994 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_cos.S,v 1.2 1994/08/19 11:14:23 jkh Exp $")
 
ENTRY(cos)
fldl 4(%esp)
fcos
fnstsw %ax
andw $0x400,%ax
jnz 1f
ret
1: fldpi
fadd %st(0)
fxch %st(1)
2: fprem1
fnstsw %ax
andw $0x400,%ax
jnz 2b
fstp %st(1)
fcos
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/e_atan2.s
0,0 → 1,44
/*
* Copyright (c) 1994 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: e_atan2.S,v 1.2 1994/08/19 11:14:13 jkh Exp $")
 
ENTRY(__ieee754_atan2)
fldl 4(%esp)
fldl 12(%esp)
fpatan
ret
/shark/trunk/libc/arch/x86/libm/msun/i387/s_sin.s
0,0 → 1,56
/*
* Copyright (c) 1994 Winning Strategies, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Winning Strategies, Inc.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
/*
* Written by:
* J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc.
*/
 
#include <machine/asmacros.h>
 
RCSID("$\Id: s_sin.S,v 1.2 1994/08/19 11:14:31 jkh Exp $")
 
ENTRY(sin)
fldl 4(%esp)
fsin
fnstsw %ax
andw $0x400,%ax
jnz 1f
ret
1: fldpi
fadd %st(0)
fxch %st(1)
2: fprem1
fnstsw %ax
andw $0x400,%ax
jnz 2b
fstp %st(1)
fsin
ret
/shark/trunk/libc/arch/x86/libm/msun/src/Makefile
0,0 → 1,139
targets:= \
e_acosf.o \
e_acosh.o \
e_acoshf.o \
e_asinf.o \
e_atan2f.o \
e_atanh.o \
e_atanhf.o \
e_cosh.o \
e_coshf.o \
e_expf.o \
e_fmod.o \
e_fmodf.o \
e_gamf1.o \
e_gamma.o \
e_gamma_.o \
e_gammaf.o \
e_hypot.o \
e_hypotf.o \
e_j0.o \
e_j0f.o \
e_j1.o \
e_j1f.o \
e_jn.o \
e_jnf.o \
e_lgam1.o \
e_lgam2.o \
e_lgam3.o \
e_lgamma.o \
e_log10f.o \
e_logf.o \
e_pow.o \
e_powf.o \
e_rem1.o \
e_rem2.o \
e_rem_pi.o \
e_scalbf.o \
e_sinh.o \
e_sinhf.o \
e_sqrtf.o \
k_cos.o \
k_cosf.o \
k_rem1.o \
k_rem_pi.o \
k_sin.o \
k_sinf.o \
k_standa.o \
k_tan.o \
k_tanf.o \
s_asinh.o \
s_asinhf.o \
s_atanf.o \
s_cbrt.o \
s_cbrtf.o \
s_ceilf.o \
s_copy1.o \
s_cosf.o \
s_erf.o \
s_erff.o \
s_expm1.o \
s_expm1f.o \
s_fabs.o \
s_fabsf.o \
s_fini1.o \
s_floorf.o \
s_frexp.o \
s_frexpf.o \
s_ilogbf.o \
s_isnan.o \
s_isnanf.o \
s_ldexp.o \
s_ldexpf.o \
s_lib_ve.o \
s_log1pf.o \
s_logbf.o \
s_mather.o \
s_modf.o \
s_modff.o \
s_next1.o \
s_nextaf.o \
s_rintf.o \
s_scal1.o \
s_sign1.o \
s_signga.o \
s_sinf.o \
s_tanf.o \
s_tanh.o \
s_tanhf.o \
w_acos.o \
w_acosf.o \
w_acosh.o \
w_acoshf.o \
w_asin.o \
w_asinf.o \
w_atan2.o \
w_atan2f.o \
w_atanh.o \
w_atanhf.o \
w_cabs.o \
w_cabsf.o \
w_cosh.o \
w_coshf.o \
w_drem.o \
w_dremf.o \
w_exp.o \
w_expf.o \
w_fmod.o \
w_fmodf.o \
w_gamf1.o \
w_gamma.o \
w_gamma_.o \
w_gammaf.o \
w_hypot.o \
w_hypotf.o \
w_j0.o \
w_j0f.o \
w_j1.o \
w_j1f.o \
w_jn.o \
w_jnf.o \
w_lgam1.o \
w_lgam2.o \
w_lgam3.o \
w_lgamma.o \
w_log.o \
w_log10.o \
w_log10f.o \
w_logf.o \
w_pow.o \
w_powf.o \
w_rem1.o \
w_remain.o \
w_scalb.o \
w_scalbf.o \
w_sinh.o \
w_sinhf.o \
w_sqrt.o \
w_sqrtf.o
 
/shark/trunk/libc/arch/x86/libm/msun/src/w_cabs.c
0,0 → 1,27
/*
* cabs() wrapper for hypot().
*
* Written by J.T. Conklin, <jtc@wimsey.com>
* Placed into the Public Domain, 1994.
*/
 
#include "math.h"
 
struct complex {
double x;
double y;
};
 
double
cabs(z)
struct complex z;
{
return hypot(z.x, z.y);
}
 
double
z_abs(z)
struct complex *z;
{
return hypot(z->x, z->y);
}
/shark/trunk/libc/arch/x86/libm/msun/src/math.h
0,0 → 1,273
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
/*
* from: @(#)fdlibm.h 5.1 93/09/24
* $\Id: math.h,v 1.2 1995/05/30 05:49:16 rgrimes Exp $
*/
 
#ifndef _MATH_H_
#define _MATH_H_
 
/*
* ANSI/POSIX
*/
extern char __infinity[];
#define HUGE_VAL (*(double *) __infinity)
 
/*
* XOPEN/SVID
*/
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
#define M_E 2.7182818284590452354 /* e */
#define M_LOG2E 1.4426950408889634074 /* log 2e */
#define M_LOG10E 0.43429448190325182765 /* log 10e */
#define M_LN2 0.69314718055994530942 /* log e2 */
#define M_LN10 2.30258509299404568402 /* log e10 */
#define M_PI 3.14159265358979323846 /* pi */
#define M_PI_2 1.57079632679489661923 /* pi/2 */
#define M_PI_4 0.78539816339744830962 /* pi/4 */
#define M_1_PI 0.31830988618379067154 /* 1/pi */
#define M_2_PI 0.63661977236758134308 /* 2/pi */
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
 
#define MAXFLOAT ((float)3.40282346638528860e+38)
extern int signgam;
 
#if !defined(_XOPEN_SOURCE)
enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix};
 
#define _LIB_VERSION_TYPE enum fdversion
#define _LIB_VERSION _fdlib_version
 
/* if global variable _LIB_VERSION is not desirable, one may
* change the following to be a constant by:
* #define _LIB_VERSION_TYPE const enum version
* In that case, after one initializes the value _LIB_VERSION (see
* s_lib_version.c) during compile time, it cannot be modified
* in the middle of a program
*/
extern _LIB_VERSION_TYPE _LIB_VERSION;
 
#define _IEEE_ fdlibm_ieee
#define _SVID_ fdlibm_svid
#define _XOPEN_ fdlibm_xopen
#define _POSIX_ fdlibm_posix
 
struct exception {
int type;
char *name;
double arg1;
double arg2;
double retval;
};
 
#define HUGE MAXFLOAT
 
/*
* set X_TLOSS = pi*2**52, which is possibly defined in <values.h>
* (one may replace the following line by "#include <values.h>")
*/
 
#define X_TLOSS 1.41484755040568800000e+16
 
#define DOMAIN 1
#define SING 2
#define OVERFLOW 3
#define UNDERFLOW 4
#define TLOSS 5
#define PLOSS 6
 
#endif /* !_XOPEN_SOURCE */
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
 
 
#include <arch/sys/cdefs.h>
__BEGIN_DECLS
/*
* ANSI/POSIX
*/
extern double acos __P((double));
extern double asin __P((double));
extern double atan __P((double));
extern double atan2 __P((double, double));
extern double cos __P((double));
extern double sin __P((double));
extern double tan __P((double));
 
extern double cosh __P((double));
extern double sinh __P((double));
extern double tanh __P((double));
 
extern double exp __P((double));
extern double frexp __P((double, int *));
extern double ldexp __P((double, int));
extern double log __P((double));
extern double log10 __P((double));
extern double modf __P((double, double *));
 
extern double pow __P((double, double));
extern double sqrt __P((double));
 
extern double ceil __P((double));
extern double fabs __P((double));
extern double floor __P((double));
extern double fmod __P((double, double));
 
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
extern double erf __P((double));
extern double erfc __P((double));
extern double gamma __P((double));
extern double hypot __P((double, double));
extern int isinf __P((double));
extern int isnan __P((double));
extern int finite __P((double));
extern double j0 __P((double));
extern double j1 __P((double));
extern double jn __P((int, double));
extern double lgamma __P((double));
extern double y0 __P((double));
extern double y1 __P((double));
extern double yn __P((int, double));
 
#if !defined(_XOPEN_SOURCE)
extern double acosh __P((double));
extern double asinh __P((double));
extern double atanh __P((double));
extern double cbrt __P((double));
extern double logb __P((double));
extern double nextafter __P((double, double));
extern double remainder __P((double, double));
extern double scalb __P((double, double));
 
extern int matherr __P((struct exception *));
 
/*
* IEEE Test Vector
*/
extern double significand __P((double));
 
/*
* Functions callable from C, intended to support IEEE arithmetic.
*/
extern double copysign __P((double, double));
extern int ilogb __P((double));
extern double rint __P((double));
extern double scalbn __P((double, int));
 
/*
* BSD math library entry points
*/
extern double cabs();
extern double drem __P((double, double));
extern double expm1 __P((double));
extern double log1p __P((double));
 
/*
* Reentrant version of gamma & lgamma; passes signgam back by reference
* as the second argument; user must allocate space for signgam.
*/
#ifdef _REENTRANT
extern double gamma_r __P((double, int *));
extern double lgamma_r __P((double, int *));
#endif /* _REENTRANT */
 
 
/* float versions of ANSI/POSIX functions */
extern float acosf __P((float));
extern float asinf __P((float));
extern float atanf __P((float));
extern float atan2f __P((float, float));
extern float cosf __P((float));
extern float sinf __P((float));
extern float tanf __P((float));
 
extern float coshf __P((float));
extern float sinhf __P((float));
extern float tanhf __P((float));
 
extern float expf __P((float));
extern float frexpf __P((float, int *));
extern float ldexpf __P((float, int));
extern float logf __P((float));
extern float log10f __P((float));
extern float modff __P((float, float *));
 
extern float powf __P((float, float));
extern float sqrtf __P((float));
 
extern float ceilf __P((float));
extern float fabsf __P((float));
extern float floorf __P((float));
extern float fmodf __P((float, float));
 
extern float erff __P((float));
extern float erfcf __P((float));
extern float gammaf __P((float));
extern float hypotf __P((float, float));
extern int isnanf __P((float));
extern int finitef __P((float));
extern float j0f __P((float));
extern float j1f __P((float));
extern float jnf __P((int, float));
extern float lgammaf __P((float));
extern float y0f __P((float));
extern float y1f __P((float));
extern float ynf __P((int, float));
 
extern float acoshf __P((float));
extern float asinhf __P((float));
extern float atanhf __P((float));
extern float cbrtf __P((float));
extern float logbf __P((float));
extern float nextafterf __P((float, float));
extern float remainderf __P((float, float));
extern float scalbf __P((float, float));
 
/*
* float version of IEEE Test Vector
*/
extern float significandf __P((float));
 
/*
* Float versions of functions callable from C, intended to support
* IEEE arithmetic.
*/
extern float copysignf __P((float, float));
extern int ilogbf __P((float));
extern float rintf __P((float));
extern float scalbnf __P((float, int));
 
/*
* float versions of BSD math library entry points
*/
extern float cabsf ();
extern float dremf __P((float, float));
extern float expm1f __P((float));
extern float log1pf __P((float));
 
/*
* Float versions of reentrant version of gamma & lgamma; passes
* signgam back by reference as the second argument; user must
* allocate space for signgam.
*/
#ifdef _REENTRANT
extern float gammaf_r __P((float, int *));
extern float lgammaf_r __P((float, int *));
#endif /* _REENTRANT */
 
#endif /* !_XOPEN_SOURCE */
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
__END_DECLS
 
#endif /* _MATH_H_ */
/shark/trunk/libc/arch/x86/libm/msun/src/s_ldexpf.c
0,0 → 1,35
/* s_ldexpf.c -- float version of s_ldexp.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_ldexpf.c,v 1.2 1995/05/30 05:49:53 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
#include <arch/errno.h>
 
#ifdef __STDC__
float ldexpf(float value, int exp)
#else
float ldexpf(value, exp)
float value; int exp;
#endif
{
if(!finitef(value)||value==(float)0.0) return value;
value = scalbnf(value,exp);
if(!finitef(value)||value==(float)0.0) errno = ERANGE;
return value;
}
/shark/trunk/libc/arch/x86/libm/msun/src/math_pri.h
0,0 → 1,223
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
/*
* from: @(#)fdlibm.h 5.1 93/09/24
* $\Id: math_private.h,v 1.2 1995/05/30 05:49:17 rgrimes Exp $
*/
 
#ifndef _MATH_PRIVATE_H_
#define _MATH_PRIVATE_H_
 
#include <arch/endian.h>
#include <ll/sys/types.h>
 
/* The original fdlibm code used statements like:
n0 = ((*(int*)&one)>>29)^1; * index of high word *
ix0 = *(n0+(int*)&x); * high word of x *
ix1 = *((1-n0)+(int*)&x); * low word of x *
to dig two 32 bit words out of the 64 bit IEEE floating point
value. That is non-ANSI, and, moreover, the gcc instruction
scheduler gets it wrong. We instead use the following macros.
Unlike the original code, we determine the endianness at compile
time, not at run time; I don't see much benefit to selecting
endianness at run time. */
 
/* A union which permits us to convert between a double and two 32 bit
ints. */
 
#if BYTE_ORDER == BIG_ENDIAN
 
typedef union
{
double value;
struct
{
u_int32_t msw;
u_int32_t lsw;
} parts;
} ieee_double_shape_type;
 
#endif
 
#if BYTE_ORDER == LITTLE_ENDIAN
 
typedef union
{
double value;
struct
{
u_int32_t lsw;
u_int32_t msw;
} parts;
} ieee_double_shape_type;
 
#endif
 
/* Get two 32 bit ints from a double. */
 
#define EXTRACT_WORDS(ix0,ix1,d) \
do { \
ieee_double_shape_type ew_u; \
ew_u.value = (d); \
(ix0) = ew_u.parts.msw; \
(ix1) = ew_u.parts.lsw; \
} while (0)
 
/* Get the more significant 32 bit int from a double. */
 
#define GET_HIGH_WORD(i,d) \
do { \
ieee_double_shape_type gh_u; \
gh_u.value = (d); \
(i) = gh_u.parts.msw; \
} while (0)
 
/* Get the less significant 32 bit int from a double. */
 
#define GET_LOW_WORD(i,d) \
do { \
ieee_double_shape_type gl_u; \
gl_u.value = (d); \
(i) = gl_u.parts.lsw; \
} while (0)
 
/* Set a double from two 32 bit ints. */
 
#define INSERT_WORDS(d,ix0,ix1) \
do { \
ieee_double_shape_type iw_u; \
iw_u.parts.msw = (ix0); \
iw_u.parts.lsw = (ix1); \
(d) = iw_u.value; \
} while (0)
 
/* Set the more significant 32 bits of a double from an int. */
 
#define SET_HIGH_WORD(d,v) \
do { \
ieee_double_shape_type sh_u; \
sh_u.value = (d); \
sh_u.parts.msw = (v); \
(d) = sh_u.value; \
} while (0)
 
/* Set the less significant 32 bits of a double from an int. */
 
#define SET_LOW_WORD(d,v) \
do { \
ieee_double_shape_type sl_u; \
sl_u.value = (d); \
sl_u.parts.lsw = (v); \
(d) = sl_u.value; \
} while (0)
 
/* A union which permits us to convert between a float and a 32 bit
int. */
 
typedef union
{
float value;
/* FIXME: Assumes 32 bit int. */
unsigned int word;
} ieee_float_shape_type;
 
/* Get a 32 bit int from a float. */
 
#define GET_FLOAT_WORD(i,d) \
do { \
ieee_float_shape_type gf_u; \
gf_u.value = (d); \
(i) = gf_u.word; \
} while (0)
 
/* Set a float from a 32 bit int. */
 
#define SET_FLOAT_WORD(d,i) \
do { \
ieee_float_shape_type sf_u; \
sf_u.word = (i); \
(d) = sf_u.value; \
} while (0)
 
/* ieee style elementary functions */
extern double __ieee754_sqrt __P((double));
extern double __ieee754_acos __P((double));
extern double __ieee754_acosh __P((double));
extern double __ieee754_log __P((double));
extern double __ieee754_atanh __P((double));
extern double __ieee754_asin __P((double));
extern double __ieee754_atan2 __P((double,double));
extern double __ieee754_exp __P((double));
extern double __ieee754_cosh __P((double));
extern double __ieee754_fmod __P((double,double));
extern double __ieee754_pow __P((double,double));
extern double __ieee754_lgamma_r __P((double,int *));
extern double __ieee754_gamma_r __P((double,int *));
extern double __ieee754_lgamma __P((double));
extern double __ieee754_gamma __P((double));
extern double __ieee754_log10 __P((double));
extern double __ieee754_sinh __P((double));
extern double __ieee754_hypot __P((double,double));
extern double __ieee754_j0 __P((double));
extern double __ieee754_j1 __P((double));
extern double __ieee754_y0 __P((double));
extern double __ieee754_y1 __P((double));
extern double __ieee754_jn __P((int,double));
extern double __ieee754_yn __P((int,double));
extern double __ieee754_remainder __P((double,double));
extern int __ieee754_rem_pio2 __P((double,double*));
extern double __ieee754_scalb __P((double,double));
 
/* fdlibm kernel function */
extern double __kernel_standard __P((double,double,int));
extern double __kernel_sin __P((double,double,int));
extern double __kernel_cos __P((double,double));
extern double __kernel_tan __P((double,double,int));
extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));
 
 
/* ieee style elementary float functions */
extern float __ieee754_sqrtf __P((float));
extern float __ieee754_acosf __P((float));
extern float __ieee754_acoshf __P((float));
extern float __ieee754_logf __P((float));
extern float __ieee754_atanhf __P((float));
extern float __ieee754_asinf __P((float));
extern float __ieee754_atan2f __P((float,float));
extern float __ieee754_expf __P((float));
extern float __ieee754_coshf __P((float));
extern float __ieee754_fmodf __P((float,float));
extern float __ieee754_powf __P((float,float));
extern float __ieee754_lgammaf_r __P((float,int *));
extern float __ieee754_gammaf_r __P((float,int *));
extern float __ieee754_lgammaf __P((float));
extern float __ieee754_gammaf __P((float));
extern float __ieee754_log10f __P((float));
extern float __ieee754_sinhf __P((float));
extern float __ieee754_hypotf __P((float,float));
extern float __ieee754_j0f __P((float));
extern float __ieee754_j1f __P((float));
extern float __ieee754_y0f __P((float));
extern float __ieee754_y1f __P((float));
extern float __ieee754_jnf __P((int,float));
extern float __ieee754_ynf __P((int,float));
extern float __ieee754_remainderf __P((float,float));
extern int __ieee754_rem_pio2f __P((float,float*));
extern float __ieee754_scalbf __P((float,float));
 
/* float versions of fdlibm kernel functions */
extern float __kernel_sinf __P((float,float,int));
extern float __kernel_cosf __P((float,float));
extern float __kernel_tanf __P((float,float,int));
extern int __kernel_rem_pio2f __P((float*,float*,int,int,int,const int*));
 
#endif /* _MATH_PRIVATE_H_ */
/shark/trunk/libc/arch/x86/libm/msun/src/w_scalbf.c
0,0 → 1,65
/* w_scalbf.c -- float version of w_scalb.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_scalbf.c,v 1.2 1995/05/30 05:51:42 rgrimes Exp $";
#endif
 
/*
* wrapper scalbf(float x, float fn) is provide for
* passing various standard test suite. One
* should use scalbn() instead.
*/
 
#include "math.h"
#include "math_private.h"
 
#include <arch/errno.h>
 
#ifdef __STDC__
#ifdef _SCALB_INT
float scalbf(float x, int fn) /* wrapper scalbf */
#else
float scalbf(float x, float fn) /* wrapper scalbf */
#endif
#else
float scalbf(x,fn) /* wrapper scalbf */
#ifdef _SCALB_INT
float x; int fn;
#else
float x,fn;
#endif
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_scalbf(x,fn);
#else
float z;
z = __ieee754_scalbf(x,fn);
if(_LIB_VERSION == _IEEE_) return z;
if(!(finitef(z)||isnanf(z))&&finitef(x)) {
/* scalbf overflow */
return (float)__kernel_standard((double)x,(double)fn,132);
}
if(z==(float)0.0&&z!=x) {
/* scalbf underflow */
return (float)__kernel_standard((double)x,(double)fn,133);
}
#ifndef _SCALB_INT
if(!finitef(fn)) errno = ERANGE;
#endif
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_ldexp.c
0,0 → 1,32
/* @(#)s_ldexp.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_ldexp.c,v 1.2 1995/05/30 05:49:51 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
#include <arch/errno.h>
 
#ifdef __STDC__
double ldexp(double value, int exp)
#else
double ldexp(value, exp)
double value; int exp;
#endif
{
if(!finite(value)||value==0.0) return value;
value = scalbn(value,exp);
if(!finite(value)||value==0.0) errno = ERANGE;
return value;
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_drem.c
0,0 → 1,15
/*
* drem() wrapper for remainder().
*
* Written by J.T. Conklin, <jtc@wimsey.com>
* Placed into the Public Domain, 1994.
*/
 
#include "math.h"
 
double
drem(x, y)
double x, y;
{
return remainder(x, y);
}
/shark/trunk/libc/arch/x86/libm/msun/src/math_private.h
0,0 → 1,223
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
/*
* from: @(#)fdlibm.h 5.1 93/09/24
* $\Id: math_private.h,v 1.2 1995/05/30 05:49:17 rgrimes Exp $
*/
 
#ifndef _MATH_PRIVATE_H_
#define _MATH_PRIVATE_H_
 
#include <arch/endian.h>
#include <ll/sys/types.h>
 
/* The original fdlibm code used statements like:
n0 = ((*(int*)&one)>>29)^1; * index of high word *
ix0 = *(n0+(int*)&x); * high word of x *
ix1 = *((1-n0)+(int*)&x); * low word of x *
to dig two 32 bit words out of the 64 bit IEEE floating point
value. That is non-ANSI, and, moreover, the gcc instruction
scheduler gets it wrong. We instead use the following macros.
Unlike the original code, we determine the endianness at compile
time, not at run time; I don't see much benefit to selecting
endianness at run time. */
 
/* A union which permits us to convert between a double and two 32 bit
ints. */
 
#if BYTE_ORDER == BIG_ENDIAN
 
typedef union
{
double value;
struct
{
u_int32_t msw;
u_int32_t lsw;
} parts;
} ieee_double_shape_type;
 
#endif
 
#if BYTE_ORDER == LITTLE_ENDIAN
 
typedef union
{
double value;
struct
{
u_int32_t lsw;
u_int32_t msw;
} parts;
} ieee_double_shape_type;
 
#endif
 
/* Get two 32 bit ints from a double. */
 
#define EXTRACT_WORDS(ix0,ix1,d) \
do { \
ieee_double_shape_type ew_u; \
ew_u.value = (d); \
(ix0) = ew_u.parts.msw; \
(ix1) = ew_u.parts.lsw; \
} while (0)
 
/* Get the more significant 32 bit int from a double. */
 
#define GET_HIGH_WORD(i,d) \
do { \
ieee_double_shape_type gh_u; \
gh_u.value = (d); \
(i) = gh_u.parts.msw; \
} while (0)
 
/* Get the less significant 32 bit int from a double. */
 
#define GET_LOW_WORD(i,d) \
do { \
ieee_double_shape_type gl_u; \
gl_u.value = (d); \
(i) = gl_u.parts.lsw; \
} while (0)
 
/* Set a double from two 32 bit ints. */
 
#define INSERT_WORDS(d,ix0,ix1) \
do { \
ieee_double_shape_type iw_u; \
iw_u.parts.msw = (ix0); \
iw_u.parts.lsw = (ix1); \
(d) = iw_u.value; \
} while (0)
 
/* Set the more significant 32 bits of a double from an int. */
 
#define SET_HIGH_WORD(d,v) \
do { \
ieee_double_shape_type sh_u; \
sh_u.value = (d); \
sh_u.parts.msw = (v); \
(d) = sh_u.value; \
} while (0)
 
/* Set the less significant 32 bits of a double from an int. */
 
#define SET_LOW_WORD(d,v) \
do { \
ieee_double_shape_type sl_u; \
sl_u.value = (d); \
sl_u.parts.lsw = (v); \
(d) = sl_u.value; \
} while (0)
 
/* A union which permits us to convert between a float and a 32 bit
int. */
 
typedef union
{
float value;
/* FIXME: Assumes 32 bit int. */
unsigned int word;
} ieee_float_shape_type;
 
/* Get a 32 bit int from a float. */
 
#define GET_FLOAT_WORD(i,d) \
do { \
ieee_float_shape_type gf_u; \
gf_u.value = (d); \
(i) = gf_u.word; \
} while (0)
 
/* Set a float from a 32 bit int. */
 
#define SET_FLOAT_WORD(d,i) \
do { \
ieee_float_shape_type sf_u; \
sf_u.word = (i); \
(d) = sf_u.value; \
} while (0)
 
/* ieee style elementary functions */
extern double __ieee754_sqrt __P((double));
extern double __ieee754_acos __P((double));
extern double __ieee754_acosh __P((double));
extern double __ieee754_log __P((double));
extern double __ieee754_atanh __P((double));
extern double __ieee754_asin __P((double));
extern double __ieee754_atan2 __P((double,double));
extern double __ieee754_exp __P((double));
extern double __ieee754_cosh __P((double));
extern double __ieee754_fmod __P((double,double));
extern double __ieee754_pow __P((double,double));
extern double __ieee754_lgamma_r __P((double,int *));
extern double __ieee754_gamma_r __P((double,int *));
extern double __ieee754_lgamma __P((double));
extern double __ieee754_gamma __P((double));
extern double __ieee754_log10 __P((double));
extern double __ieee754_sinh __P((double));
extern double __ieee754_hypot __P((double,double));
extern double __ieee754_j0 __P((double));
extern double __ieee754_j1 __P((double));
extern double __ieee754_y0 __P((double));
extern double __ieee754_y1 __P((double));
extern double __ieee754_jn __P((int,double));
extern double __ieee754_yn __P((int,double));
extern double __ieee754_remainder __P((double,double));
extern int __ieee754_rem_pio2 __P((double,double*));
extern double __ieee754_scalb __P((double,double));
 
/* fdlibm kernel function */
extern double __kernel_standard __P((double,double,int));
extern double __kernel_sin __P((double,double,int));
extern double __kernel_cos __P((double,double));
extern double __kernel_tan __P((double,double,int));
extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));
 
 
/* ieee style elementary float functions */
extern float __ieee754_sqrtf __P((float));
extern float __ieee754_acosf __P((float));
extern float __ieee754_acoshf __P((float));
extern float __ieee754_logf __P((float));
extern float __ieee754_atanhf __P((float));
extern float __ieee754_asinf __P((float));
extern float __ieee754_atan2f __P((float,float));
extern float __ieee754_expf __P((float));
extern float __ieee754_coshf __P((float));
extern float __ieee754_fmodf __P((float,float));
extern float __ieee754_powf __P((float,float));
extern float __ieee754_lgammaf_r __P((float,int *));
extern float __ieee754_gammaf_r __P((float,int *));
extern float __ieee754_lgammaf __P((float));
extern float __ieee754_gammaf __P((float));
extern float __ieee754_log10f __P((float));
extern float __ieee754_sinhf __P((float));
extern float __ieee754_hypotf __P((float,float));
extern float __ieee754_j0f __P((float));
extern float __ieee754_j1f __P((float));
extern float __ieee754_y0f __P((float));
extern float __ieee754_y1f __P((float));
extern float __ieee754_jnf __P((int,float));
extern float __ieee754_ynf __P((int,float));
extern float __ieee754_remainderf __P((float,float));
extern int __ieee754_rem_pio2f __P((float,float*));
extern float __ieee754_scalbf __P((float,float));
 
/* float versions of fdlibm kernel functions */
extern float __kernel_sinf __P((float,float,int));
extern float __kernel_cosf __P((float,float));
extern float __kernel_tanf __P((float,float,int));
extern int __kernel_rem_pio2f __P((float*,float*,int,int,int,const int*));
 
#endif /* _MATH_PRIVATE_H_ */
/shark/trunk/libc/arch/x86/libm/msun/src/w_scalb.c
0,0 → 1,60
/* @(#)w_scalb.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_scalb.c,v 1.2 1995/05/30 05:51:41 rgrimes Exp $";
#endif
 
/*
* wrapper scalb(double x, double fn) is provide for
* passing various standard test suite. One
* should use scalbn() instead.
*/
 
#include "math.h"
#include "math_private.h"
 
#include <arch/errno.h>
 
#ifdef __STDC__
#ifdef _SCALB_INT
double scalb(double x, int fn) /* wrapper scalb */
#else
double scalb(double x, double fn) /* wrapper scalb */
#endif
#else
double scalb(x,fn) /* wrapper scalb */
#ifdef _SCALB_INT
double x; int fn;
#else
double x,fn;
#endif
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_scalb(x,fn);
#else
double z;
z = __ieee754_scalb(x,fn);
if(_LIB_VERSION == _IEEE_) return z;
if(!(finite(z)||isnan(z))&&finite(x)) {
return __kernel_standard(x,(double)fn,32); /* scalb overflow */
}
if(z==0.0&&z!=x) {
return __kernel_standard(x,(double)fn,33); /* scalb underflow */
}
#ifndef _SCALB_INT
if(!finite(fn)) errno = ERANGE;
#endif
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/k_standa.c
0,0 → 1,786
/* @(#)k_standard.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: k_standard.c,v 1.2 1995/05/30 05:49:13 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
#include <arch/errno.h>
 
/* Undefine these if you're actually going to use the FreeBSD libc. */
#define _USE_WRITE
#define _NO_FFLUSH
 
#ifndef _USE_WRITE
#include <stdio.h> /* fputs(), stderr */
#define WRITE2(u,v) fputs(u, stderr)
#else /* !defined(_USE_WRITE) */
#include <arch/unistd.h> /* write */
#define WRITE2(u,v) write(2, u, v)
#undef fflush
#endif /* !defined(_USE_WRITE) */
 
#ifdef __STDC__
static const double zero = 0.0; /* used as const */
#else
static double zero = 0.0; /* used as const */
#endif
 
/*
* Standard conformance (non-IEEE) on exception cases.
* Mapping:
* 1 -- acos(|x|>1)
* 2 -- asin(|x|>1)
* 3 -- atan2(+-0,+-0)
* 4 -- hypot overflow
* 5 -- cosh overflow
* 6 -- exp overflow
* 7 -- exp underflow
* 8 -- y0(0)
* 9 -- y0(-ve)
* 10-- y1(0)
* 11-- y1(-ve)
* 12-- yn(0)
* 13-- yn(-ve)
* 14-- lgamma(finite) overflow
* 15-- lgamma(-integer)
* 16-- log(0)
* 17-- log(x<0)
* 18-- log10(0)
* 19-- log10(x<0)
* 20-- pow(0.0,0.0)
* 21-- pow(x,y) overflow
* 22-- pow(x,y) underflow
* 23-- pow(0,negative)
* 24-- pow(neg,non-integral)
* 25-- sinh(finite) overflow
* 26-- sqrt(negative)
* 27-- fmod(x,0)
* 28-- remainder(x,0)
* 29-- acosh(x<1)
* 30-- atanh(|x|>1)
* 31-- atanh(|x|=1)
* 32-- scalb overflow
* 33-- scalb underflow
* 34-- j0(|x|>X_TLOSS)
* 35-- y0(x>X_TLOSS)
* 36-- j1(|x|>X_TLOSS)
* 37-- y1(x>X_TLOSS)
* 38-- jn(|x|>X_TLOSS, n)
* 39-- yn(x>X_TLOSS, n)
* 40-- gamma(finite) overflow
* 41-- gamma(-integer)
* 42-- pow(NaN,0.0)
*/
 
 
#ifdef __STDC__
double __kernel_standard(double x, double y, int type)
#else
double __kernel_standard(x,y,type)
double x,y; int type;
#endif
{
struct exception exc;
#ifndef HUGE_VAL /* this is the only routine that uses HUGE_VAL */
#define HUGE_VAL inf
double inf = 0.0;
 
SET_HIGH_WORD(inf,0x7ff00000); /* set inf to infinite */
#endif
 
#if defined(_USE_WRITE) && !defined(_NO_FFLUSH)
(void) fflush(stdout);
#endif
exc.arg1 = x;
exc.arg2 = y;
switch(type) {
case 1:
case 101:
/* acos(|x|>1) */
exc.type = DOMAIN;
exc.name = type < 100 ? "acos" : "acosf";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if(_LIB_VERSION == _SVID_) {
(void) WRITE2("acos: DOMAIN error\n", 19);
}
errno = EDOM;
}
break;
case 2:
case 102:
/* asin(|x|>1) */
exc.type = DOMAIN;
exc.name = type < 100 ? "asin" : "asinf";
exc.retval = zero;
if(_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if(_LIB_VERSION == _SVID_) {
(void) WRITE2("asin: DOMAIN error\n", 19);
}
errno = EDOM;
}
break;
case 3:
case 103:
/* atan2(+-0,+-0) */
exc.arg1 = y;
exc.arg2 = x;
exc.type = DOMAIN;
exc.name = type < 100 ? "atan2" : "atan2f";
exc.retval = zero;
if(_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if(_LIB_VERSION == _SVID_) {
(void) WRITE2("atan2: DOMAIN error\n", 20);
}
errno = EDOM;
}
break;
case 4:
case 104:
/* hypot(finite,finite) overflow */
exc.type = OVERFLOW;
exc.name = type < 100 ? "hypot" : "hypotf";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 5:
case 105:
/* cosh(finite) overflow */
exc.type = OVERFLOW;
exc.name = type < 100 ? "cosh" : "coshf";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 6:
case 106:
/* exp(finite) overflow */
exc.type = OVERFLOW;
exc.name = type < 100 ? "exp" : "expf";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 7:
case 107:
/* exp(finite) underflow */
exc.type = UNDERFLOW;
exc.name = type < 100 ? "exp" : "expf";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 8:
case 108:
/* y0(0) = -inf */
exc.type = DOMAIN; /* should be SING for IEEE */
exc.name = type < 100 ? "y0" : "y0f";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("y0: DOMAIN error\n", 17);
}
errno = EDOM;
}
break;
case 9:
case 109:
/* y0(x<0) = NaN */
exc.type = DOMAIN;
exc.name = type < 100 ? "y0" : "y0f";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("y0: DOMAIN error\n", 17);
}
errno = EDOM;
}
break;
case 10:
case 110:
/* y1(0) = -inf */
exc.type = DOMAIN; /* should be SING for IEEE */
exc.name = type < 100 ? "y1" : "y1f";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("y1: DOMAIN error\n", 17);
}
errno = EDOM;
}
break;
case 11:
case 111:
/* y1(x<0) = NaN */
exc.type = DOMAIN;
exc.name = type < 100 ? "y1" : "y1f";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("y1: DOMAIN error\n", 17);
}
errno = EDOM;
}
break;
case 12:
case 112:
/* yn(n,0) = -inf */
exc.type = DOMAIN; /* should be SING for IEEE */
exc.name = type < 100 ? "yn" : "ynf";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("yn: DOMAIN error\n", 17);
}
errno = EDOM;
}
break;
case 13:
case 113:
/* yn(x<0) = NaN */
exc.type = DOMAIN;
exc.name = type < 100 ? "yn" : "ynf";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("yn: DOMAIN error\n", 17);
}
errno = EDOM;
}
break;
case 14:
case 114:
/* lgamma(finite) overflow */
exc.type = OVERFLOW;
exc.name = type < 100 ? "lgamma" : "lgammaf";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 15:
case 115:
/* lgamma(-integer) or lgamma(0) */
exc.type = SING;
exc.name = type < 100 ? "lgamma" : "lgammaf";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("lgamma: SING error\n", 19);
}
errno = EDOM;
}
break;
case 16:
case 116:
/* log(0) */
exc.type = SING;
exc.name = type < 100 ? "log" : "logf";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("log: SING error\n", 16);
}
errno = EDOM;
}
break;
case 17:
case 117:
/* log(x<0) */
exc.type = DOMAIN;
exc.name = type < 100 ? "log" : "logf";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("log: DOMAIN error\n", 18);
}
errno = EDOM;
}
break;
case 18:
case 118:
/* log10(0) */
exc.type = SING;
exc.name = type < 100 ? "log10" : "log10f";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("log10: SING error\n", 18);
}
errno = EDOM;
}
break;
case 19:
case 119:
/* log10(x<0) */
exc.type = DOMAIN;
exc.name = type < 100 ? "log10" : "log10f";
if (_LIB_VERSION == _SVID_)
exc.retval = -HUGE;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("log10: DOMAIN error\n", 20);
}
errno = EDOM;
}
break;
case 20:
case 120:
/* pow(0.0,0.0) */
/* error only if _LIB_VERSION == _SVID_ */
exc.type = DOMAIN;
exc.name = type < 100 ? "pow" : "powf";
exc.retval = zero;
if (_LIB_VERSION != _SVID_) exc.retval = 1.0;
else if (!matherr(&exc)) {
(void) WRITE2("pow(0,0): DOMAIN error\n", 23);
errno = EDOM;
}
break;
case 21:
case 121:
/* pow(x,y) overflow */
exc.type = OVERFLOW;
exc.name = type < 100 ? "pow" : "powf";
if (_LIB_VERSION == _SVID_) {
exc.retval = HUGE;
y *= 0.5;
if(x<zero&&rint(y)!=y) exc.retval = -HUGE;
} else {
exc.retval = HUGE_VAL;
y *= 0.5;
if(x<zero&&rint(y)!=y) exc.retval = -HUGE_VAL;
}
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 22:
case 122:
/* pow(x,y) underflow */
exc.type = UNDERFLOW;
exc.name = type < 100 ? "pow" : "powf";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 23:
case 123:
/* 0**neg */
exc.type = DOMAIN;
exc.name = type < 100 ? "pow" : "powf";
if (_LIB_VERSION == _SVID_)
exc.retval = zero;
else
exc.retval = -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("pow(0,neg): DOMAIN error\n", 25);
}
errno = EDOM;
}
break;
case 24:
case 124:
/* neg**non-integral */
exc.type = DOMAIN;
exc.name = type < 100 ? "pow" : "powf";
if (_LIB_VERSION == _SVID_)
exc.retval = zero;
else
exc.retval = zero/zero; /* X/Open allow NaN */
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("neg**non-integral: DOMAIN error\n", 32);
}
errno = EDOM;
}
break;
case 25:
case 125:
/* sinh(finite) overflow */
exc.type = OVERFLOW;
exc.name = type < 100 ? "sinh" : "sinhf";
if (_LIB_VERSION == _SVID_)
exc.retval = ( (x>zero) ? HUGE : -HUGE);
else
exc.retval = ( (x>zero) ? HUGE_VAL : -HUGE_VAL);
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 26:
case 126:
/* sqrt(x<0) */
exc.type = DOMAIN;
exc.name = type < 100 ? "sqrt" : "sqrtf";
if (_LIB_VERSION == _SVID_)
exc.retval = zero;
else
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("sqrt: DOMAIN error\n", 19);
}
errno = EDOM;
}
break;
case 27:
case 127:
/* fmod(x,0) */
exc.type = DOMAIN;
exc.name = type < 100 ? "fmod" : "fmodf";
if (_LIB_VERSION == _SVID_)
exc.retval = x;
else
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("fmod: DOMAIN error\n", 20);
}
errno = EDOM;
}
break;
case 28:
case 128:
/* remainder(x,0) */
exc.type = DOMAIN;
exc.name = type < 100 ? "remainder" : "remainderf";
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("remainder: DOMAIN error\n", 24);
}
errno = EDOM;
}
break;
case 29:
case 129:
/* acosh(x<1) */
exc.type = DOMAIN;
exc.name = type < 100 ? "acosh" : "acoshf";
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("acosh: DOMAIN error\n", 20);
}
errno = EDOM;
}
break;
case 30:
case 130:
/* atanh(|x|>1) */
exc.type = DOMAIN;
exc.name = type < 100 ? "atanh" : "atanhf";
exc.retval = zero/zero;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("atanh: DOMAIN error\n", 20);
}
errno = EDOM;
}
break;
case 31:
case 131:
/* atanh(|x|=1) */
exc.type = SING;
exc.name = type < 100 ? "atanh" : "atanhf";
exc.retval = x/zero; /* sign(x)*inf */
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("atanh: SING error\n", 18);
}
errno = EDOM;
}
break;
case 32:
case 132:
/* scalb overflow; SVID also returns +-HUGE_VAL */
exc.type = OVERFLOW;
exc.name = type < 100 ? "scalb" : "scalbf";
exc.retval = x > zero ? HUGE_VAL : -HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 33:
case 133:
/* scalb underflow */
exc.type = UNDERFLOW;
exc.name = type < 100 ? "scalb" : "scalbf";
exc.retval = copysign(zero,x);
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 34:
case 134:
/* j0(|x|>X_TLOSS) */
exc.type = TLOSS;
exc.name = type < 100 ? "j0" : "j0f";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
}
errno = ERANGE;
}
break;
case 35:
case 135:
/* y0(x>X_TLOSS) */
exc.type = TLOSS;
exc.name = type < 100 ? "y0" : "y0f";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
}
errno = ERANGE;
}
break;
case 36:
case 136:
/* j1(|x|>X_TLOSS) */
exc.type = TLOSS;
exc.name = type < 100 ? "j1" : "j1f";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
}
errno = ERANGE;
}
break;
case 37:
case 137:
/* y1(x>X_TLOSS) */
exc.type = TLOSS;
exc.name = type < 100 ? "y1" : "y1f";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
}
errno = ERANGE;
}
break;
case 38:
case 138:
/* jn(|x|>X_TLOSS) */
exc.type = TLOSS;
exc.name = type < 100 ? "jn" : "jnf";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
}
errno = ERANGE;
}
break;
case 39:
case 139:
/* yn(x>X_TLOSS) */
exc.type = TLOSS;
exc.name = type < 100 ? "yn" : "ynf";
exc.retval = zero;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2(exc.name, 2);
(void) WRITE2(": TLOSS error\n", 14);
}
errno = ERANGE;
}
break;
case 40:
case 140:
/* gamma(finite) overflow */
exc.type = OVERFLOW;
exc.name = type < 100 ? "gamma" : "gammaf";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = ERANGE;
else if (!matherr(&exc)) {
errno = ERANGE;
}
break;
case 41:
case 141:
/* gamma(-integer) or gamma(0) */
exc.type = SING;
exc.name = type < 100 ? "gamma" : "gammaf";
if (_LIB_VERSION == _SVID_)
exc.retval = HUGE;
else
exc.retval = HUGE_VAL;
if (_LIB_VERSION == _POSIX_)
errno = EDOM;
else if (!matherr(&exc)) {
if (_LIB_VERSION == _SVID_) {
(void) WRITE2("gamma: SING error\n", 18);
}
errno = EDOM;
}
break;
case 42:
case 142:
/* pow(NaN,0.0) */
/* error only if _LIB_VERSION == _SVID_ & _XOPEN_ */
exc.type = DOMAIN;
exc.name = type < 100 ? "pow" : "powf";
exc.retval = x;
if (_LIB_VERSION == _IEEE_ ||
_LIB_VERSION == _POSIX_) exc.retval = 1.0;
else if (!matherr(&exc)) {
errno = EDOM;
}
break;
}
return exc.retval;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_acosf.c
0,0 → 1,89
/* e_acosf.c -- float version of e_acos.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_acosf.c,v 1.2 1995/05/30 05:47:52 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float
#else
static float
#endif
one = 1.0000000000e+00, /* 0x3F800000 */
pi = 3.1415925026e+00, /* 0x40490fda */
pio2_hi = 1.5707962513e+00, /* 0x3fc90fda */
pio2_lo = 7.5497894159e-08, /* 0x33a22168 */
pS0 = 1.6666667163e-01, /* 0x3e2aaaab */
pS1 = -3.2556581497e-01, /* 0xbea6b090 */
pS2 = 2.0121252537e-01, /* 0x3e4e0aa8 */
pS3 = -4.0055535734e-02, /* 0xbd241146 */
pS4 = 7.9153501429e-04, /* 0x3a4f7f04 */
pS5 = 3.4793309169e-05, /* 0x3811ef08 */
qS1 = -2.4033949375e+00, /* 0xc019d139 */
qS2 = 2.0209457874e+00, /* 0x4001572d */
qS3 = -6.8828397989e-01, /* 0xbf303361 */
qS4 = 7.7038154006e-02; /* 0x3d9dc62e */
 
#ifdef __STDC__
float __ieee754_acosf(float x)
#else
float __ieee754_acosf(x)
float x;
#endif
{
float z,p,q,r,w,s,c,df;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix==0x3f800000) { /* |x|==1 */
if(hx>0) return 0.0; /* acos(1) = 0 */
else return pi+(float)2.0*pio2_lo; /* acos(-1)= pi */
} else if(ix>0x3f800000) { /* |x| >= 1 */
return (x-x)/(x-x); /* acos(|x|>1) is NaN */
}
if(ix<0x3f000000) { /* |x| < 0.5 */
if(ix<=0x23000000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/
z = x*x;
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
r = p/q;
return pio2_hi - (x - (pio2_lo-x*r));
} else if (hx<0) { /* x < -0.5 */
z = (one+x)*(float)0.5;
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
s = sqrtf(z);
r = p/q;
w = r*s-pio2_lo;
return pi - (float)2.0*(s+w);
} else { /* x > 0.5 */
int32_t idf;
z = (one-x)*(float)0.5;
s = sqrtf(z);
df = s;
GET_FLOAT_WORD(idf,df);
SET_FLOAT_WORD(df,idf&0xfffff000);
c = (z-df*df)/(s+df);
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
r = p/q;
w = r*s+c;
return (float)2.0*(df+w);
}
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_exp.c
0,0 → 1,167
/* @(#)e_exp.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_exp.c,v 1.3.2.1 1997/02/23 11:03:02 joerg Exp $";
#endif
 
/* __ieee754_exp(x)
* Returns the exponential of x.
*
* Method
* 1. Argument reduction:
* Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.
* Given x, find r and integer k such that
*
* x = k*ln2 + r, |r| <= 0.5*ln2.
*
* Here r will be represented as r = hi-lo for better
* accuracy.
*
* 2. Approximation of exp(r) by a special rational function on
* the interval [0,0.34658]:
* Write
* R(r**2) = r*(exp(r)+1)/(exp(r)-1) = 2 + r*r/6 - r**4/360 + ...
* We use a special Reme algorithm on [0,0.34658] to generate
* a polynomial of degree 5 to approximate R. The maximum error
* of this polynomial approximation is bounded by 2**-59. In
* other words,
* R(z) ~ 2.0 + P1*z + P2*z**2 + P3*z**3 + P4*z**4 + P5*z**5
* (where z=r*r, and the values of P1 to P5 are listed below)
* and
* | 5 | -59
* | 2.0+P1*z+...+P5*z - R(z) | <= 2
* | |
* The computation of exp(r) thus becomes
* 2*r
* exp(r) = 1 + -------
* R - r
* r*R1(r)
* = 1 + r + ----------- (for better accuracy)
* 2 - R1(r)
* where
* 2 4 10
* R1(r) = r - (P1*r + P2*r + ... + P5*r ).
*
* 3. Scale back to obtain exp(x):
* From step 1, we have
* exp(x) = 2^k * exp(r)
*
* Special cases:
* exp(INF) is INF, exp(NaN) is NaN;
* exp(-INF) is 0, and
* for finite argument, only exp(0)=1 is exact.
*
* Accuracy:
* according to an error analysis, the error is always less than
* 1 ulp (unit in the last place).
*
* Misc. info.
* For IEEE double
* if x > 7.09782712893383973096e+02 then exp(x) overflow
* if x < -7.45133219101941108420e+02 then exp(x) underflow
*
* Constants:
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
* to produce the hexadecimal values shown.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double
#else
static double
#endif
one = 1.0,
halF[2] = {0.5,-0.5,},
huge = 1.0e+300,
twom1000= 9.33263618503218878990e-302, /* 2**-1000=0x01700000,0*/
o_threshold= 7.09782712893383973096e+02, /* 0x40862E42, 0xFEFA39EF */
u_threshold= -7.45133219101941108420e+02, /* 0xc0874910, 0xD52D3051 */
ln2HI[2] ={ 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */
-6.93147180369123816490e-01,},/* 0xbfe62e42, 0xfee00000 */
ln2LO[2] ={ 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */
-1.90821492927058770002e-10,},/* 0xbdea39ef, 0x35793c76 */
invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */
P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
 
 
#ifdef __STDC__
double __generic___ieee754_exp(double x) /* default IEEE double exp */
#else
double __generic___ieee754_exp(x) /* default IEEE double exp */
double x;
#endif
{
double y,hi=0.0,lo=0.0,c,t;
int32_t k=0,xsb;
u_int32_t hx;
 
GET_HIGH_WORD(hx,x);
xsb = (hx>>31)&1; /* sign bit of x */
hx &= 0x7fffffff; /* high word of |x| */
 
/* filter out non-finite argument */
if(hx >= 0x40862E42) { /* if |x|>=709.78... */
if(hx>=0x7ff00000) {
u_int32_t lx;
GET_LOW_WORD(lx,x);
if(((hx&0xfffff)|lx)!=0)
return x+x; /* NaN */
else return (xsb==0)? x:0.0; /* exp(+-inf)={inf,0} */
}
if(x > o_threshold) return huge*huge; /* overflow */
if(x < u_threshold) return twom1000*twom1000; /* underflow */
}
 
/* argument reduction */
if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */
if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */
hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb;
} else {
k = invln2*x+halF[xsb];
t = k;
hi = x - t*ln2HI[0]; /* t*ln2HI is exact here */
lo = t*ln2LO[0];
}
x = hi - lo;
}
else if(hx < 0x3e300000) { /* when |x|<2**-28 */
if(huge+x>one) return one+x;/* trigger inexact */
}
else k = 0;
 
/* x is now in primary range */
t = x*x;
c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
if(k==0) return one-((x*c)/(c-2.0)-x);
else y = one-((lo-(x*c)/(2.0-c))-hi);
if(k >= -1021) {
u_int32_t hy;
GET_HIGH_WORD(hy,y);
SET_HIGH_WORD(y,hy+(k<<20)); /* add k to y's exponent */
return y;
} else {
u_int32_t hy;
GET_HIGH_WORD(hy,y);
SET_HIGH_WORD(y,hy+((k+1000)<<20)); /* add k to y's exponent */
return y*twom1000;
}
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_finite.c
0,0 → 1,35
/* @(#)s_finite.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_finite.c,v 1.2.6.1 1997/02/23 11:03:17 joerg Exp $";
#endif
 
/*
* finite(x) returns 1 is x is finite, else 0;
* no branching!
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
int __generic_finite(double x)
#else
int __generic_finite(x)
double x;
#endif
{
int32_t hx;
GET_HIGH_WORD(hx,x);
return (int)((u_int32_t)((hx&0x7fffffff)-0x7ff00000)>>31);
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_atan2f.c
0,0 → 1,47
/* w_atan2f.c -- float version of w_atan2.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_atan2f.c,v 1.2 1995/05/30 05:50:44 rgrimes Exp $";
#endif
 
/*
* wrapper atan2f(y,x)
*/
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
float atan2f(float y, float x) /* wrapper atan2f */
#else
float atan2f(y,x) /* wrapper atan2 */
float y,x;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_atan2f(y,x);
#else
float z;
z = __ieee754_atan2f(y,x);
if(_LIB_VERSION == _IEEE_||isnanf(x)||isnanf(y)) return z;
if(x==(float)0.0&&y==(float)0.0) {
/* atan2f(+-0,+-0) */
return (float)__kernel_standard((double)y,(double)x,103);
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_mather.c
0,0 → 1,30
/* @(#)s_matherr.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_matherr.c,v 1.2 1995/05/30 05:50:02 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
int matherr(struct exception *x)
#else
int matherr(x)
struct exception *x;
#endif
{
int n=0;
if(x->arg1!=x->arg1) return 0;
return n;
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_fabsf.c
0,0 → 1,38
/* s_fabsf.c -- float version of s_fabs.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_fabsf.c,v 1.2 1995/05/30 05:49:36 rgrimes Exp $";
#endif
 
/*
* fabsf(x) returns the absolute value of x.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
float fabsf(float x)
#else
float fabsf(x)
float x;
#endif
{
u_int32_t ix;
GET_FLOAT_WORD(ix,x);
SET_FLOAT_WORD(x,ix&0x7fffffff);
return x;
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_sign1.c
0,0 → 1,31
/* s_significandf.c -- float version of s_significand.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_significandf.c,v 1.2 1995/05/30 05:50:28 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
float significandf(float x)
#else
float significandf(x)
float x;
#endif
{
return __ieee754_scalbf(x,(float) -ilogbf(x));
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_floor.c
0,0 → 1,81
/* @(#)s_floor.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_floor.c,v 1.2.6.1 1997/02/23 11:03:18 joerg Exp $";
#endif
 
/*
* floor(x)
* Return x rounded toward -inf to integral value
* Method:
* Bit twiddling.
* Exception:
* Inexact flag raised if x not equal to floor(x).
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double huge = 1.0e300;
#else
static double huge = 1.0e300;
#endif
 
#ifdef __STDC__
double __generic_floor(double x)
#else
double __generic_floor(x)
double x;
#endif
{
int32_t i0,i1,j0;
u_int32_t i,j;
EXTRACT_WORDS(i0,i1,x);
j0 = ((i0>>20)&0x7ff)-0x3ff;
if(j0<20) {
if(j0<0) { /* raise inexact if x != 0 */
if(huge+x>0.0) {/* return 0*sign(x) if |x|<1 */
if(i0>=0) {i0=i1=0;}
else if(((i0&0x7fffffff)|i1)!=0)
{ i0=0xbff00000;i1=0;}
}
} else {
i = (0x000fffff)>>j0;
if(((i0&i)|i1)==0) return x; /* x is integral */
if(huge+x>0.0) { /* raise inexact flag */
if(i0<0) i0 += (0x00100000)>>j0;
i0 &= (~i); i1=0;
}
}
} else if (j0>51) {
if(j0==0x400) return x+x; /* inf or NaN */
else return x; /* x is integral */
} else {
i = ((u_int32_t)(0xffffffff))>>(j0-20);
if((i1&i)==0) return x; /* x is integral */
if(huge+x>0.0) { /* raise inexact flag */
if(i0<0) {
if(j0==20) i0+=1;
else {
j = i1+(1<<(52-j0));
if(j<i1) i0 +=1 ; /* got a carry */
i1=j;
}
}
i1 &= (~i);
}
}
INSERT_WORDS(x,i0,i1);
return x;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_sinh.c
0,0 → 1,86
/* @(#)e_sinh.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_sinh.c,v 1.3 1996/07/12 18:57:58 jkh Exp $";
#endif
 
/* __ieee754_sinh(x)
* Method :
* mathematically sinh(x) if defined to be (exp(x)-exp(-x))/2
* 1. Replace x by |x| (sinh(-x) = -sinh(x)).
* 2.
* E + E/(E+1)
* 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
* 2
*
* 22 <= x <= lnovft : sinh(x) := exp(x)/2
* lnovft <= x <= ln2ovft: sinh(x) := exp(x/2)/2 * exp(x/2)
* ln2ovft < x : sinh(x) := x*shuge (overflow)
*
* Special cases:
* sinh(x) is |x| if x is +INF, -INF, or NaN.
* only sinh(0)=0 is exact for finite x.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double one = 1.0, shuge = 1.0e307;
#else
static double one = 1.0, shuge = 1.0e307;
#endif
 
#ifdef __STDC__
double __ieee754_sinh(double x)
#else
double __ieee754_sinh(x)
double x;
#endif
{
double t,w,h;
int32_t ix,jx;
u_int32_t lx;
 
/* High word of |x|. */
GET_HIGH_WORD(jx,x);
ix = jx&0x7fffffff;
 
/* x is INF or NaN */
if(ix>=0x7ff00000) return x+x;
 
h = 0.5;
if (jx<0) h = -h;
/* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x40360000) { /* |x|<22 */
if (ix<0x3e300000) /* |x|<2**-28 */
if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
t = expm1(fabs(x));
if(ix<0x3ff00000) return h*(2.0*t-t*t/(t+one));
return h*(t+t/(t+one));
}
 
/* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */
if (ix < 0x40862E42) return h*__ieee754_exp(fabs(x));
 
/* |x| in [log(maxdouble), overflowthresold] */
GET_LOW_WORD(lx,x);
if (ix<0x408633CE || ((ix==0x408633ce)&&(lx<=(u_int32_t)0x8fb9f87d))) {
w = __ieee754_exp(0.5*fabs(x));
t = h*w;
return t*w;
}
 
/* |x| > overflowthresold, sinh(x) overflow */
return x*shuge;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_lgam1.c
0,0 → 1,312
/* @(#)er_lgamma.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_lgamma_r.c,v 1.2 1995/05/30 05:48:27 rgrimes Exp $";
#endif
 
/* __ieee754_lgamma_r(x, signgamp)
* Reentrant version of the logarithm of the Gamma function
* with user provide pointer for the sign of Gamma(x).
*
* Method:
* 1. Argument Reduction for 0 < x <= 8
* Since gamma(1+s)=s*gamma(s), for x in [0,8], we may
* reduce x to a number in [1.5,2.5] by
* lgamma(1+s) = log(s) + lgamma(s)
* for example,
* lgamma(7.3) = log(6.3) + lgamma(6.3)
* = log(6.3*5.3) + lgamma(5.3)
* = log(6.3*5.3*4.3*3.3*2.3) + lgamma(2.3)
* 2. Polynomial approximation of lgamma around its
* minimun ymin=1.461632144968362245 to maintain monotonicity.
* On [ymin-0.23, ymin+0.27] (i.e., [1.23164,1.73163]), use
* Let z = x-ymin;
* lgamma(x) = -1.214862905358496078218 + z^2*poly(z)
* where
* poly(z) is a 14 degree polynomial.
* 2. Rational approximation in the primary interval [2,3]
* We use the following approximation:
* s = x-2.0;
* lgamma(x) = 0.5*s + s*P(s)/Q(s)
* with accuracy
* |P/Q - (lgamma(x)-0.5s)| < 2**-61.71
* Our algorithms are based on the following observation
*
* zeta(2)-1 2 zeta(3)-1 3
* lgamma(2+s) = s*(1-Euler) + --------- * s - --------- * s + ...
* 2 3
*
* where Euler = 0.5771... is the Euler constant, which is very
* close to 0.5.
*
* 3. For x>=8, we have
* lgamma(x)~(x-0.5)log(x)-x+0.5*log(2pi)+1/(12x)-1/(360x**3)+....
* (better formula:
* lgamma(x)~(x-0.5)*(log(x)-1)-.5*(log(2pi)-1) + ...)
* Let z = 1/x, then we approximation
* f(z) = lgamma(x) - (x-0.5)(log(x)-1)
* by
* 3 5 11
* w = w0 + w1*z + w2*z + w3*z + ... + w6*z
* where
* |w - f(z)| < 2**-58.74
*
* 4. For negative x, since (G is gamma function)
* -x*G(-x)*G(x) = pi/sin(pi*x),
* we have
* G(x) = pi/(sin(pi*x)*(-x)*G(-x))
* since G(-x) is positive, sign(G(x)) = sign(sin(pi*x)) for x<0
* Hence, for x<0, signgam = sign(sin(pi*x)) and
* lgamma(x) = log(|Gamma(x)|)
* = log(pi/(|x*sin(pi*x)|)) - lgamma(-x);
* Note: one should avoid compute pi*(-x) directly in the
* computation of sin(pi*(-x)).
*
* 5. Special Cases
* lgamma(2+s) ~ s*(1-Euler) for tiny s
* lgamma(1)=lgamma(2)=0
* lgamma(x) ~ -log(x) for tiny x
* lgamma(0) = lgamma(inf) = inf
* lgamma(-integer) = +-inf
*
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double
#else
static double
#endif
two52= 4.50359962737049600000e+15, /* 0x43300000, 0x00000000 */
half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
a0 = 7.72156649015328655494e-02, /* 0x3FB3C467, 0xE37DB0C8 */
a1 = 3.22467033424113591611e-01, /* 0x3FD4A34C, 0xC4A60FAD */
a2 = 6.73523010531292681824e-02, /* 0x3FB13E00, 0x1A5562A7 */
a3 = 2.05808084325167332806e-02, /* 0x3F951322, 0xAC92547B */
a4 = 7.38555086081402883957e-03, /* 0x3F7E404F, 0xB68FEFE8 */
a5 = 2.89051383673415629091e-03, /* 0x3F67ADD8, 0xCCB7926B */
a6 = 1.19270763183362067845e-03, /* 0x3F538A94, 0x116F3F5D */
a7 = 5.10069792153511336608e-04, /* 0x3F40B6C6, 0x89B99C00 */
a8 = 2.20862790713908385557e-04, /* 0x3F2CF2EC, 0xED10E54D */
a9 = 1.08011567247583939954e-04, /* 0x3F1C5088, 0x987DFB07 */
a10 = 2.52144565451257326939e-05, /* 0x3EFA7074, 0x428CFA52 */
a11 = 4.48640949618915160150e-05, /* 0x3F07858E, 0x90A45837 */
tc = 1.46163214496836224576e+00, /* 0x3FF762D8, 0x6356BE3F */
tf = -1.21486290535849611461e-01, /* 0xBFBF19B9, 0xBCC38A42 */
/* tt = -(tail of tf) */
tt = -3.63867699703950536541e-18, /* 0xBC50C7CA, 0xA48A971F */
t0 = 4.83836122723810047042e-01, /* 0x3FDEF72B, 0xC8EE38A2 */
t1 = -1.47587722994593911752e-01, /* 0xBFC2E427, 0x8DC6C509 */
t2 = 6.46249402391333854778e-02, /* 0x3FB08B42, 0x94D5419B */
t3 = -3.27885410759859649565e-02, /* 0xBFA0C9A8, 0xDF35B713 */
t4 = 1.79706750811820387126e-02, /* 0x3F9266E7, 0x970AF9EC */
t5 = -1.03142241298341437450e-02, /* 0xBF851F9F, 0xBA91EC6A */
t6 = 6.10053870246291332635e-03, /* 0x3F78FCE0, 0xE370E344 */
t7 = -3.68452016781138256760e-03, /* 0xBF6E2EFF, 0xB3E914D7 */
t8 = 2.25964780900612472250e-03, /* 0x3F6282D3, 0x2E15C915 */
t9 = -1.40346469989232843813e-03, /* 0xBF56FE8E, 0xBF2D1AF1 */
t10 = 8.81081882437654011382e-04, /* 0x3F4CDF0C, 0xEF61A8E9 */
t11 = -5.38595305356740546715e-04, /* 0xBF41A610, 0x9C73E0EC */
t12 = 3.15632070903625950361e-04, /* 0x3F34AF6D, 0x6C0EBBF7 */
t13 = -3.12754168375120860518e-04, /* 0xBF347F24, 0xECC38C38 */
t14 = 3.35529192635519073543e-04, /* 0x3F35FD3E, 0xE8C2D3F4 */
u0 = -7.72156649015328655494e-02, /* 0xBFB3C467, 0xE37DB0C8 */
u1 = 6.32827064025093366517e-01, /* 0x3FE4401E, 0x8B005DFF */
u2 = 1.45492250137234768737e+00, /* 0x3FF7475C, 0xD119BD6F */
u3 = 9.77717527963372745603e-01, /* 0x3FEF4976, 0x44EA8450 */
u4 = 2.28963728064692451092e-01, /* 0x3FCD4EAE, 0xF6010924 */
u5 = 1.33810918536787660377e-02, /* 0x3F8B678B, 0xBF2BAB09 */
v1 = 2.45597793713041134822e+00, /* 0x4003A5D7, 0xC2BD619C */
v2 = 2.12848976379893395361e+00, /* 0x40010725, 0xA42B18F5 */
v3 = 7.69285150456672783825e-01, /* 0x3FE89DFB, 0xE45050AF */
v4 = 1.04222645593369134254e-01, /* 0x3FBAAE55, 0xD6537C88 */
v5 = 3.21709242282423911810e-03, /* 0x3F6A5ABB, 0x57D0CF61 */
s0 = -7.72156649015328655494e-02, /* 0xBFB3C467, 0xE37DB0C8 */
s1 = 2.14982415960608852501e-01, /* 0x3FCB848B, 0x36E20878 */
s2 = 3.25778796408930981787e-01, /* 0x3FD4D98F, 0x4F139F59 */
s3 = 1.46350472652464452805e-01, /* 0x3FC2BB9C, 0xBEE5F2F7 */
s4 = 2.66422703033638609560e-02, /* 0x3F9B481C, 0x7E939961 */
s5 = 1.84028451407337715652e-03, /* 0x3F5E26B6, 0x7368F239 */
s6 = 3.19475326584100867617e-05, /* 0x3F00BFEC, 0xDD17E945 */
r1 = 1.39200533467621045958e+00, /* 0x3FF645A7, 0x62C4AB74 */
r2 = 7.21935547567138069525e-01, /* 0x3FE71A18, 0x93D3DCDC */
r3 = 1.71933865632803078993e-01, /* 0x3FC601ED, 0xCCFBDF27 */
r4 = 1.86459191715652901344e-02, /* 0x3F9317EA, 0x742ED475 */
r5 = 7.77942496381893596434e-04, /* 0x3F497DDA, 0xCA41A95B */
r6 = 7.32668430744625636189e-06, /* 0x3EDEBAF7, 0xA5B38140 */
w0 = 4.18938533204672725052e-01, /* 0x3FDACFE3, 0x90C97D69 */
w1 = 8.33333333333329678849e-02, /* 0x3FB55555, 0x5555553B */
w2 = -2.77777777728775536470e-03, /* 0xBF66C16C, 0x16B02E5C */
w3 = 7.93650558643019558500e-04, /* 0x3F4A019F, 0x98CF38B6 */
w4 = -5.95187557450339963135e-04, /* 0xBF4380CB, 0x8C0FE741 */
w5 = 8.36339918996282139126e-04, /* 0x3F4B67BA, 0x4CDAD5D1 */
w6 = -1.63092934096575273989e-03; /* 0xBF5AB89D, 0x0B9E43E4 */
 
#ifdef __STDC__
static const double zero= 0.00000000000000000000e+00;
#else
static double zero= 0.00000000000000000000e+00;
#endif
 
#ifdef __STDC__
static double sin_pi(double x)
#else
static double sin_pi(x)
double x;
#endif
{
double y,z;
int n,ix;
 
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
 
if(ix<0x3fd00000) return __kernel_sin(pi*x,zero,0);
y = -x; /* x is assume negative */
 
/*
* argument reduction, make sure inexact flag not raised if input
* is an integer
*/
z = floor(y);
if(z!=y) { /* inexact anyway */
y *= 0.5;
y = 2.0*(y - floor(y)); /* y = |x| mod 2.0 */
n = (int) (y*4.0);
} else {
if(ix>=0x43400000) {
y = zero; n = 0; /* y must be even */
} else {
if(ix<0x43300000) z = y+two52; /* exact */
GET_LOW_WORD(n,z);
n &= 1;
y = n;
n<<= 2;
}
}
switch (n) {
case 0: y = __kernel_sin(pi*y,zero,0); break;
case 1:
case 2: y = __kernel_cos(pi*(0.5-y),zero); break;
case 3:
case 4: y = __kernel_sin(pi*(one-y),zero,0); break;
case 5:
case 6: y = -__kernel_cos(pi*(y-1.5),zero); break;
default: y = __kernel_sin(pi*(y-2.0),zero,0); break;
}
return -y;
}
 
 
#ifdef __STDC__
double __ieee754_lgamma_r(double x, int *signgamp)
#else
double __ieee754_lgamma_r(x,signgamp)
double x; int *signgamp;
#endif
{
double t,y,z,nadj,p,p1,p2,p3,q,r,w;
int i,hx,lx,ix;
 
EXTRACT_WORDS(hx,lx,x);
 
/* purge off +-inf, NaN, +-0, and negative arguments */
*signgamp = 1;
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) return x*x;
if((ix|lx)==0) return one/zero;
if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */
if(hx<0) {
*signgamp = -1;
return -__ieee754_log(-x);
} else return -__ieee754_log(x);
}
if(hx<0) {
if(ix>=0x43300000) /* |x|>=2**52, must be -integer */
return one/zero;
t = sin_pi(x);
if(t==zero) return one/zero; /* -integer */
nadj = __ieee754_log(pi/fabs(t*x));
if(t<zero) *signgamp = -1;
x = -x;
}
 
/* purge off 1 and 2 */
if((((ix-0x3ff00000)|lx)==0)||(((ix-0x40000000)|lx)==0)) r = 0;
/* for x < 2.0 */
else if(ix<0x40000000) {
if(ix<=0x3feccccc) { /* lgamma(x) = lgamma(x+1)-log(x) */
r = -__ieee754_log(x);
if(ix>=0x3FE76944) {y = one-x; i= 0;}
else if(ix>=0x3FCDA661) {y= x-(tc-one); i=1;}
else {y = x; i=2;}
} else {
r = zero;
if(ix>=0x3FFBB4C3) {y=2.0-x;i=0;} /* [1.7316,2] */
else if(ix>=0x3FF3B4C4) {y=x-tc;i=1;} /* [1.23,1.73] */
else {y=x-one;i=2;}
}
switch(i) {
case 0:
z = y*y;
p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*a10))));
p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*a11)))));
p = y*p1+p2;
r += (p-0.5*y); break;
case 1:
z = y*y;
w = z*y;
p1 = t0+w*(t3+w*(t6+w*(t9 +w*t12))); /* parallel comp */
p2 = t1+w*(t4+w*(t7+w*(t10+w*t13)));
p3 = t2+w*(t5+w*(t8+w*(t11+w*t14)));
p = z*p1-(tt-w*(p2+y*p3));
r += (tf + p); break;
case 2:
p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5)))));
p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5))));
r += (-0.5*y + p1/p2);
}
}
else if(ix<0x40200000) { /* x < 8.0 */
i = (int)x;
t = zero;
y = x-(double)i;
p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*s6))))));
q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*r6)))));
r = half*y+p/q;
z = one; /* lgamma(1+s) = log(s) + lgamma(s) */
switch(i) {
case 7: z *= (y+6.0); /* FALLTHRU */
case 6: z *= (y+5.0); /* FALLTHRU */
case 5: z *= (y+4.0); /* FALLTHRU */
case 4: z *= (y+3.0); /* FALLTHRU */
case 3: z *= (y+2.0); /* FALLTHRU */
r += __ieee754_log(z); break;
}
/* 8.0 <= x < 2**58 */
} else if (ix < 0x43900000) {
t = __ieee754_log(x);
z = one/x;
y = z*z;
w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6)))));
r = (x-half)*(t-one)+w;
} else
/* 2**58 <= x <= inf */
r = x*(__ieee754_log(x)-one);
if(hx<0) r = nadj - r;
return r;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_expf.c
0,0 → 1,103
/* e_expf.c -- float version of e_exp.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_expf.c,v 1.3 1996/07/12 18:57:56 jkh Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float
#else
static float
#endif
one = 1.0,
halF[2] = {0.5,-0.5,},
huge = 1.0e+30,
twom100 = 7.8886090522e-31, /* 2**-100=0x0d800000 */
o_threshold= 8.8721679688e+01, /* 0x42b17180 */
u_threshold= -1.0397208405e+02, /* 0xc2cff1b5 */
ln2HI[2] ={ 6.9313812256e-01, /* 0x3f317180 */
-6.9313812256e-01,}, /* 0xbf317180 */
ln2LO[2] ={ 9.0580006145e-06, /* 0x3717f7d1 */
-9.0580006145e-06,}, /* 0xb717f7d1 */
invln2 = 1.4426950216e+00, /* 0x3fb8aa3b */
P1 = 1.6666667163e-01, /* 0x3e2aaaab */
P2 = -2.7777778450e-03, /* 0xbb360b61 */
P3 = 6.6137559770e-05, /* 0x388ab355 */
P4 = -1.6533901999e-06, /* 0xb5ddea0e */
P5 = 4.1381369442e-08; /* 0x3331bb4c */
 
#ifdef __STDC__
float __ieee754_expf(float x) /* default IEEE double exp */
#else
float __ieee754_expf(x) /* default IEEE double exp */
float x;
#endif
{
float y,hi=0.0,lo=0.0,c,t;
int32_t k=0,xsb;
u_int32_t hx;
 
GET_FLOAT_WORD(hx,x);
xsb = (hx>>31)&1; /* sign bit of x */
hx &= 0x7fffffff; /* high word of |x| */
 
/* filter out non-finite argument */
if(hx >= 0x42b17218) { /* if |x|>=88.721... */
if(hx>0x7f800000)
return x+x; /* NaN */
if(hx==0x7f800000)
return (xsb==0)? x:0.0; /* exp(+-inf)={inf,0} */
if(x > o_threshold) return huge*huge; /* overflow */
if(x < u_threshold) return twom100*twom100; /* underflow */
}
 
/* argument reduction */
if(hx > 0x3eb17218) { /* if |x| > 0.5 ln2 */
if(hx < 0x3F851592) { /* and |x| < 1.5 ln2 */
hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb;
} else {
k = invln2*x+halF[xsb];
t = k;
hi = x - t*ln2HI[0]; /* t*ln2HI is exact here */
lo = t*ln2LO[0];
}
x = hi - lo;
}
else if(hx < 0x31800000) { /* when |x|<2**-28 */
if(huge+x>one) return one+x;/* trigger inexact */
}
else k = 0;
 
/* x is now in primary range */
t = x*x;
c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
if(k==0) return one-((x*c)/(c-(float)2.0)-x);
else y = one-((lo-(x*c)/((float)2.0-c))-hi);
if(k >= -125) {
u_int32_t hy;
GET_FLOAT_WORD(hy,y);
SET_FLOAT_WORD(y,hy+(k<<23)); /* add k to y's exponent */
return y;
} else {
u_int32_t hy;
GET_FLOAT_WORD(hy,y);
SET_FLOAT_WORD(y,hy+((k+100)<<23)); /* add k to y's exponent */
return y*twom100;
}
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_gamma_.c
0,0 → 1,46
/* @(#)wr_gamma.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_gamma_r.c,v 1.2 1995/05/30 05:51:06 rgrimes Exp $";
#endif
 
/*
* wrapper double gamma_r(double x, int *signgamp)
*/
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
double gamma_r(double x, int *signgamp) /* wrapper lgamma_r */
#else
double gamma_r(x,signgamp) /* wrapper lgamma_r */
double x; int *signgamp;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_gamma_r(x,signgamp);
#else
double y;
y = __ieee754_gamma_r(x,signgamp);
if(_LIB_VERSION == _IEEE_) return y;
if(!finite(y)&&finite(x)) {
if(floor(x)==x&&x<=0.0)
return __kernel_standard(x,x,41); /* gamma pole */
else
return __kernel_standard(x,x,40); /* gamma overflow */
} else
return y;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_rem1.c
0,0 → 1,196
/* e_rem_pio2f.c -- float version of e_rem_pio2.c
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_rem_pio2f.c,v 1.3 1995/05/30 05:48:38 rgrimes Exp $";
#endif
 
/* __ieee754_rem_pio2f(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2f()
*/
 
#include "math.h"
#include "math_private.h"
 
/*
* Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
*/
#ifdef __STDC__
static const int32_t two_over_pi[] = {
#else
static int32_t two_over_pi[] = {
#endif
0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC,
0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62,
0x95, 0x99, 0x3C, 0x43, 0x90, 0x41, 0xFE, 0x51, 0x63,
0xAB, 0xDE, 0xBB, 0xC5, 0x61, 0xB7, 0x24, 0x6E, 0x3A,
0x42, 0x4D, 0xD2, 0xE0, 0x06, 0x49, 0x2E, 0xEA, 0x09,
0xD1, 0x92, 0x1C, 0xFE, 0x1D, 0xEB, 0x1C, 0xB1, 0x29,
0xA7, 0x3E, 0xE8, 0x82, 0x35, 0xF5, 0x2E, 0xBB, 0x44,
0x84, 0xE9, 0x9C, 0x70, 0x26, 0xB4, 0x5F, 0x7E, 0x41,
0x39, 0x91, 0xD6, 0x39, 0x83, 0x53, 0x39, 0xF4, 0x9C,
0x84, 0x5F, 0x8B, 0xBD, 0xF9, 0x28, 0x3B, 0x1F, 0xF8,
0x97, 0xFF, 0xDE, 0x05, 0x98, 0x0F, 0xEF, 0x2F, 0x11,
0x8B, 0x5A, 0x0A, 0x6D, 0x1F, 0x6D, 0x36, 0x7E, 0xCF,
0x27, 0xCB, 0x09, 0xB7, 0x4F, 0x46, 0x3F, 0x66, 0x9E,
0x5F, 0xEA, 0x2D, 0x75, 0x27, 0xBA, 0xC7, 0xEB, 0xE5,
0xF1, 0x7B, 0x3D, 0x07, 0x39, 0xF7, 0x8A, 0x52, 0x92,
0xEA, 0x6B, 0xFB, 0x5F, 0xB1, 0x1F, 0x8D, 0x5D, 0x08,
0x56, 0x03, 0x30, 0x46, 0xFC, 0x7B, 0x6B, 0xAB, 0xF0,
0xCF, 0xBC, 0x20, 0x9A, 0xF4, 0x36, 0x1D, 0xA9, 0xE3,
0x91, 0x61, 0x5E, 0xE6, 0x1B, 0x08, 0x65, 0x99, 0x85,
0x5F, 0x14, 0xA0, 0x68, 0x40, 0x8D, 0xFF, 0xD8, 0x80,
0x4D, 0x73, 0x27, 0x31, 0x06, 0x06, 0x15, 0x56, 0xCA,
0x73, 0xA8, 0xC9, 0x60, 0xE2, 0x7B, 0xC0, 0x8C, 0x6B,
};
 
/* This array is like the one in e_rem_pio2.c, but the numbers are
single precision and the last 8 bits are forced to 0. */
#ifdef __STDC__
static const int32_t npio2_hw[] = {
#else
static int32_t npio2_hw[] = {
#endif
0x3fc90f00, 0x40490f00, 0x4096cb00, 0x40c90f00, 0x40fb5300, 0x4116cb00,
0x412fed00, 0x41490f00, 0x41623100, 0x417b5300, 0x418a3a00, 0x4196cb00,
0x41a35c00, 0x41afed00, 0x41bc7e00, 0x41c90f00, 0x41d5a000, 0x41e23100,
0x41eec200, 0x41fb5300, 0x4203f200, 0x420a3a00, 0x42108300, 0x4216cb00,
0x421d1400, 0x42235c00, 0x4229a500, 0x422fed00, 0x42363600, 0x423c7e00,
0x4242c700, 0x42490f00
};
 
/*
* invpio2: 24 bits of 2/pi
* pio2_1: first 17 bit of pi/2
* pio2_1t: pi/2 - pio2_1
* pio2_2: second 17 bit of pi/2
* pio2_2t: pi/2 - (pio2_1+pio2_2)
* pio2_3: third 17 bit of pi/2
* pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3)
*/
 
#ifdef __STDC__
static const float
#else
static float
#endif
zero = 0.0000000000e+00, /* 0x00000000 */
half = 5.0000000000e-01, /* 0x3f000000 */
two8 = 2.5600000000e+02, /* 0x43800000 */
invpio2 = 6.3661980629e-01, /* 0x3f22f984 */
pio2_1 = 1.5707855225e+00, /* 0x3fc90f80 */
pio2_1t = 1.0804334124e-05, /* 0x37354443 */
pio2_2 = 1.0804273188e-05, /* 0x37354400 */
pio2_2t = 6.0770999344e-11, /* 0x2e85a308 */
pio2_3 = 6.0770943833e-11, /* 0x2e85a300 */
pio2_3t = 6.1232342629e-17; /* 0x248d3132 */
 
#ifdef __STDC__
int32_t __ieee754_rem_pio2f(float x, float *y)
#else
int32_t __ieee754_rem_pio2f(x,y)
float x,y[];
#endif
{
float z,w,t,r,fn;
float tx[3];
int32_t e0,i,j,nx,n,ix,hx;
 
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix<=0x3f490fd8) /* |x| ~<= pi/4 , no need for reduction */
{y[0] = x; y[1] = 0; return 0;}
if(ix<0x4016cbe4) { /* |x| < 3pi/4, special case with n=+-1 */
if(hx>0) {
z = x - pio2_1;
if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */
y[0] = z - pio2_1t;
y[1] = (z-y[0])-pio2_1t;
} else { /* near pi/2, use 24+24+24 bit pi */
z -= pio2_2;
y[0] = z - pio2_2t;
y[1] = (z-y[0])-pio2_2t;
}
return 1;
} else { /* negative x */
z = x + pio2_1;
if((ix&0xfffffff0)!=0x3fc90fd0) { /* 24+24 bit pi OK */
y[0] = z + pio2_1t;
y[1] = (z-y[0])+pio2_1t;
} else { /* near pi/2, use 24+24+24 bit pi */
z += pio2_2;
y[0] = z + pio2_2t;
y[1] = (z-y[0])+pio2_2t;
}
return -1;
}
}
if(ix<=0x43490f80) { /* |x| ~<= 2^7*(pi/2), medium size */
t = fabsf(x);
n = (int32_t) (t*invpio2+half);
fn = (float)n;
r = t-fn*pio2_1;
w = fn*pio2_1t; /* 1st round good to 40 bit */
if(n<32&&(ix&0xffffff00)!=npio2_hw[n-1]) {
y[0] = r-w; /* quick check no cancellation */
} else {
u_int32_t high;
j = ix>>23;
y[0] = r-w;
GET_FLOAT_WORD(high,y[0]);
i = j-((high>>23)&0xff);
if(i>8) { /* 2nd iteration needed, good to 57 */
t = r;
w = fn*pio2_2;
r = t-w;
w = fn*pio2_2t-((t-r)-w);
y[0] = r-w;
GET_FLOAT_WORD(high,y[0]);
i = j-((high>>23)&0xff);
if(i>25) { /* 3rd iteration need, 74 bits acc */
t = r; /* will cover all possible cases */
w = fn*pio2_3;
r = t-w;
w = fn*pio2_3t-((t-r)-w);
y[0] = r-w;
}
}
}
y[1] = (r-y[0])-w;
if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;}
else return n;
}
/*
* all other (large) arguments
*/
if(ix>=0x7f800000) { /* x is inf or NaN */
y[0]=y[1]=x-x; return 0;
}
/* set z = scalbn(|x|,ilogb(x)-7) */
e0 = (ix>>23)-134; /* e0 = ilogb(z)-7; */
SET_FLOAT_WORD(z, ix - ((int32_t)(e0<<23)));
for(i=0;i<2;i++) {
tx[i] = (float)((int32_t)(z));
z = (z-tx[i])*two8;
}
tx[2] = z;
nx = 3;
while(tx[nx-1]==zero) nx--; /* skip zero term */
n = __kernel_rem_pio2f(tx,y,e0,nx,2,two_over_pi);
if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;}
return n;
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_fmod.c
0,0 → 1,43
/* @(#)w_fmod.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_fmod.c,v 1.2 1995/05/30 05:51:02 rgrimes Exp $";
#endif
 
/*
* wrapper fmod(x,y)
*/
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
double fmod(double x, double y) /* wrapper fmod */
#else
double fmod(x,y) /* wrapper fmod */
double x,y;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_fmod(x,y);
#else
double z;
z = __ieee754_fmod(x,y);
if(_LIB_VERSION == _IEEE_ ||isnan(y)||isnan(x)) return z;
if(y==0.0) {
return __kernel_standard(x,y,27); /* fmod(x,0) */
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_expm1.c
0,0 → 1,228
/* @(#)s_expm1.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_expm1.c,v 1.2 1995/05/30 05:49:33 rgrimes Exp $";
#endif
 
/* expm1(x)
* Returns exp(x)-1, the exponential of x minus 1.
*
* Method
* 1. Argument reduction:
* Given x, find r and integer k such that
*
* x = k*ln2 + r, |r| <= 0.5*ln2 ~ 0.34658
*
* Here a correction term c will be computed to compensate
* the error in r when rounded to a floating-point number.
*
* 2. Approximating expm1(r) by a special rational function on
* the interval [0,0.34658]:
* Since
* r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 - r^4/360 + ...
* we define R1(r*r) by
* r*(exp(r)+1)/(exp(r)-1) = 2+ r^2/6 * R1(r*r)
* That is,
* R1(r**2) = 6/r *((exp(r)+1)/(exp(r)-1) - 2/r)
* = 6/r * ( 1 + 2.0*(1/(exp(r)-1) - 1/r))
* = 1 - r^2/60 + r^4/2520 - r^6/100800 + ...
* We use a special Reme algorithm on [0,0.347] to generate
* a polynomial of degree 5 in r*r to approximate R1. The
* maximum error of this polynomial approximation is bounded
* by 2**-61. In other words,
* R1(z) ~ 1.0 + Q1*z + Q2*z**2 + Q3*z**3 + Q4*z**4 + Q5*z**5
* where Q1 = -1.6666666666666567384E-2,
* Q2 = 3.9682539681370365873E-4,
* Q3 = -9.9206344733435987357E-6,
* Q4 = 2.5051361420808517002E-7,
* Q5 = -6.2843505682382617102E-9;
* (where z=r*r, and the values of Q1 to Q5 are listed below)
* with error bounded by
* | 5 | -61
* | 1.0+Q1*z+...+Q5*z - R1(z) | <= 2
* | |
*
* expm1(r) = exp(r)-1 is then computed by the following
* specific way which minimize the accumulation rounding error:
* 2 3
* r r [ 3 - (R1 + R1*r/2) ]
* expm1(r) = r + --- + --- * [--------------------]
* 2 2 [ 6 - r*(3 - R1*r/2) ]
*
* To compensate the error in the argument reduction, we use
* expm1(r+c) = expm1(r) + c + expm1(r)*c
* ~ expm1(r) + c + r*c
* Thus c+r*c will be added in as the correction terms for
* expm1(r+c). Now rearrange the term to avoid optimization
* screw up:
* ( 2 2 )
* ({ ( r [ R1 - (3 - R1*r/2) ] ) } r )
* expm1(r+c)~r - ({r*(--- * [--------------------]-c)-c} - --- )
* ({ ( 2 [ 6 - r*(3 - R1*r/2) ] ) } 2 )
* ( )
*
* = r - E
* 3. Scale back to obtain expm1(x):
* From step 1, we have
* expm1(x) = either 2^k*[expm1(r)+1] - 1
* = or 2^k*[expm1(r) + (1-2^-k)]
* 4. Implementation notes:
* (A). To save one multiplication, we scale the coefficient Qi
* to Qi*2^i, and replace z by (x^2)/2.
* (B). To achieve maximum accuracy, we compute expm1(x) by
* (i) if x < -56*ln2, return -1.0, (raise inexact if x!=inf)
* (ii) if k=0, return r-E
* (iii) if k=-1, return 0.5*(r-E)-0.5
* (iv) if k=1 if r < -0.25, return 2*((r+0.5)- E)
* else return 1.0+2.0*(r-E);
* (v) if (k<-2||k>56) return 2^k(1-(E-r)) - 1 (or exp(x)-1)
* (vi) if k <= 20, return 2^k((1-2^-k)-(E-r)), else
* (vii) return 2^k(1-((E+2^-k)-r))
*
* Special cases:
* expm1(INF) is INF, expm1(NaN) is NaN;
* expm1(-INF) is -1, and
* for finite argument, only expm1(0)=0 is exact.
*
* Accuracy:
* according to an error analysis, the error is always less than
* 1 ulp (unit in the last place).
*
* Misc. info.
* For IEEE double
* if x > 7.09782712893383973096e+02 then expm1(x) overflow
*
* Constants:
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
* to produce the hexadecimal values shown.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double
#else
static double
#endif
one = 1.0,
huge = 1.0e+300,
tiny = 1.0e-300,
o_threshold = 7.09782712893383973096e+02,/* 0x40862E42, 0xFEFA39EF */
ln2_hi = 6.93147180369123816490e-01,/* 0x3fe62e42, 0xfee00000 */
ln2_lo = 1.90821492927058770002e-10,/* 0x3dea39ef, 0x35793c76 */
invln2 = 1.44269504088896338700e+00,/* 0x3ff71547, 0x652b82fe */
/* scaled coefficients related to expm1 */
Q1 = -3.33333333333331316428e-02, /* BFA11111 111110F4 */
Q2 = 1.58730158725481460165e-03, /* 3F5A01A0 19FE5585 */
Q3 = -7.93650757867487942473e-05, /* BF14CE19 9EAADBB7 */
Q4 = 4.00821782732936239552e-06, /* 3ED0CFCA 86E65239 */
Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
 
#ifdef __STDC__
double expm1(double x)
#else
double expm1(x)
double x;
#endif
{
double y,hi,lo,c,t,e,hxs,hfx,r1;
int32_t k,xsb;
u_int32_t hx;
 
GET_HIGH_WORD(hx,x);
xsb = hx&0x80000000; /* sign bit of x */
if(xsb==0) y=x; else y= -x; /* y = |x| */
hx &= 0x7fffffff; /* high word of |x| */
 
/* filter out huge and non-finite argument */
if(hx >= 0x4043687A) { /* if |x|>=56*ln2 */
if(hx >= 0x40862E42) { /* if |x|>=709.78... */
if(hx>=0x7ff00000) {
u_int32_t low;
GET_LOW_WORD(low,x);
if(((hx&0xfffff)|low)!=0)
return x+x; /* NaN */
else return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */
}
if(x > o_threshold) return huge*huge; /* overflow */
}
if(xsb!=0) { /* x < -56*ln2, return -1.0 with inexact */
if(x+tiny<0.0) /* raise inexact */
return tiny-one; /* return -1 */
}
}
 
/* argument reduction */
if(hx > 0x3fd62e42) { /* if |x| > 0.5 ln2 */
if(hx < 0x3FF0A2B2) { /* and |x| < 1.5 ln2 */
if(xsb==0)
{hi = x - ln2_hi; lo = ln2_lo; k = 1;}
else
{hi = x + ln2_hi; lo = -ln2_lo; k = -1;}
} else {
k = invln2*x+((xsb==0)?0.5:-0.5);
t = k;
hi = x - t*ln2_hi; /* t*ln2_hi is exact here */
lo = t*ln2_lo;
}
x = hi - lo;
c = (hi-x)-lo;
}
else if(hx < 0x3c900000) { /* when |x|<2**-54, return x */
t = huge+x; /* return x with inexact flags when x!=0 */
return x - (t-(huge+x));
}
else k = 0;
 
/* x is now in primary range */
hfx = 0.5*x;
hxs = x*hfx;
r1 = one+hxs*(Q1+hxs*(Q2+hxs*(Q3+hxs*(Q4+hxs*Q5))));
t = 3.0-r1*hfx;
e = hxs*((r1-t)/(6.0 - x*t));
if(k==0) return x - (x*e-hxs); /* c is 0 */
else {
e = (x*(e-c)-c);
e -= hxs;
if(k== -1) return 0.5*(x-e)-0.5;
if(k==1)
if(x < -0.25) return -2.0*(e-(x+0.5));
else return one+2.0*(x-e);
if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */
u_int32_t high;
y = one-(e-x);
GET_HIGH_WORD(high,y);
SET_HIGH_WORD(y,high+(k<<20)); /* add k to y's exponent */
return y-one;
}
t = one;
if(k<20) {
u_int32_t high;
SET_HIGH_WORD(t,0x3ff00000 - (0x200000>>k)); /* t=1-2^-k */
y = t-(e-x);
GET_HIGH_WORD(high,y);
SET_HIGH_WORD(y,high+(k<<20)); /* add k to y's exponent */
} else {
u_int32_t high;
SET_HIGH_WORD(t,((0x3ff-k)<<20)); /* 2^-k */
y = x-(e+t);
y += one;
GET_HIGH_WORD(high,y);
SET_HIGH_WORD(y,high+(k<<20)); /* add k to y's exponent */
}
}
return y;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_j0.c
0,0 → 1,487
/* @(#)e_j0.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_j0.c,v 1.2 1995/05/30 05:48:18 rgrimes Exp $";
#endif
 
/* __ieee754_j0(x), __ieee754_y0(x)
* Bessel function of the first and second kinds of order zero.
* Method -- j0(x):
* 1. For tiny x, we use j0(x) = 1 - x^2/4 + x^4/64 - ...
* 2. Reduce x to |x| since j0(x)=j0(-x), and
* for x in (0,2)
* j0(x) = 1-z/4+ z^2*R0/S0, where z = x*x;
* (precision: |j0-1+z/4-z^2R0/S0 |<2**-63.67 )
* for x in (2,inf)
* j0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)-q0(x)*sin(x0))
* where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
* as follow:
* cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
* = 1/sqrt(2) * (cos(x) + sin(x))
* sin(x0) = sin(x)cos(pi/4)-cos(x)sin(pi/4)
* = 1/sqrt(2) * (sin(x) - cos(x))
* (To avoid cancellation, use
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.)
*
* 3 Special cases
* j0(nan)= nan
* j0(0) = 1
* j0(inf) = 0
*
* Method -- y0(x):
* 1. For x<2.
* Since
* y0(x) = 2/pi*(j0(x)*(ln(x/2)+Euler) + x^2/4 - ...)
* therefore y0(x)-2/pi*j0(x)*ln(x) is an even function.
* We use the following function to approximate y0,
* y0(x) = U(z)/V(z) + (2/pi)*(j0(x)*ln(x)), z= x^2
* where
* U(z) = u00 + u01*z + ... + u06*z^6
* V(z) = 1 + v01*z + ... + v04*z^4
* with absolute approximation error bounded by 2**-72.
* Note: For tiny x, U/V = u0 and j0(x)~1, hence
* y0(tiny) = u0 + (2/pi)*ln(tiny), (choose tiny<2**-27)
* 2. For x>=2.
* y0(x) = sqrt(2/(pi*x))*(p0(x)*cos(x0)+q0(x)*sin(x0))
* where x0 = x-pi/4. It is better to compute sin(x0),cos(x0)
* by the method mentioned above.
* 3. Special cases: y0(0)=-inf, y0(x<0)=NaN, y0(inf)=0.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static double pzero(double), qzero(double);
#else
static double pzero(), qzero();
#endif
 
#ifdef __STDC__
static const double
#else
static double
#endif
huge = 1e300,
one = 1.0,
invsqrtpi= 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
tpi = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
/* R0/S0 on [0, 2.00] */
R02 = 1.56249999999999947958e-02, /* 0x3F8FFFFF, 0xFFFFFFFD */
R03 = -1.89979294238854721751e-04, /* 0xBF28E6A5, 0xB61AC6E9 */
R04 = 1.82954049532700665670e-06, /* 0x3EBEB1D1, 0x0C503919 */
R05 = -4.61832688532103189199e-09, /* 0xBE33D5E7, 0x73D63FCE */
S01 = 1.56191029464890010492e-02, /* 0x3F8FFCE8, 0x82C8C2A4 */
S02 = 1.16926784663337450260e-04, /* 0x3F1EA6D2, 0xDD57DBF4 */
S03 = 5.13546550207318111446e-07, /* 0x3EA13B54, 0xCE84D5A9 */
S04 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */
 
#ifdef __STDC__
static const double zero = 0.0;
#else
static double zero = 0.0;
#endif
 
#ifdef __STDC__
double __ieee754_j0(double x)
#else
double __ieee754_j0(x)
double x;
#endif
{
double z, s,c,ss,cc,r,u,v;
int32_t hx,ix;
 
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) return one/(x*x);
x = fabs(x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
s = sin(x);
c = cos(x);
ss = s-c;
cc = s+c;
if(ix<0x7fe00000) { /* make sure x+x not overflow */
z = -cos(x+x);
if ((s*c)<zero) cc = z/ss;
else ss = z/cc;
}
/*
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
if(ix>0x48000000) z = (invsqrtpi*cc)/sqrt(x);
else {
u = pzero(x); v = qzero(x);
z = invsqrtpi*(u*cc-v*ss)/sqrt(x);
}
return z;
}
if(ix<0x3f200000) { /* |x| < 2**-13 */
if(huge+x>one) { /* raise inexact if x != 0 */
if(ix<0x3e400000) return one; /* |x|<2**-27 */
else return one - 0.25*x*x;
}
}
z = x*x;
r = z*(R02+z*(R03+z*(R04+z*R05)));
s = one+z*(S01+z*(S02+z*(S03+z*S04)));
if(ix < 0x3FF00000) { /* |x| < 1.00 */
return one + z*(-0.25+(r/s));
} else {
u = 0.5*x;
return((one+u)*(one-u)+z*(r/s));
}
}
 
#ifdef __STDC__
static const double
#else
static double
#endif
u00 = -7.38042951086872317523e-02, /* 0xBFB2E4D6, 0x99CBD01F */
u01 = 1.76666452509181115538e-01, /* 0x3FC69D01, 0x9DE9E3FC */
u02 = -1.38185671945596898896e-02, /* 0xBF8C4CE8, 0xB16CFA97 */
u03 = 3.47453432093683650238e-04, /* 0x3F36C54D, 0x20B29B6B */
u04 = -3.81407053724364161125e-06, /* 0xBECFFEA7, 0x73D25CAD */
u05 = 1.95590137035022920206e-08, /* 0x3E550057, 0x3B4EABD4 */
u06 = -3.98205194132103398453e-11, /* 0xBDC5E43D, 0x693FB3C8 */
v01 = 1.27304834834123699328e-02, /* 0x3F8A1270, 0x91C9C71A */
v02 = 7.60068627350353253702e-05, /* 0x3F13ECBB, 0xF578C6C1 */
v03 = 2.59150851840457805467e-07, /* 0x3E91642D, 0x7FF202FD */
v04 = 4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */
 
#ifdef __STDC__
double __ieee754_y0(double x)
#else
double __ieee754_y0(x)
double x;
#endif
{
double z, s,c,ss,cc,u,v;
int32_t hx,ix,lx;
 
EXTRACT_WORDS(hx,lx,x);
ix = 0x7fffffff&hx;
/* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0 */
if(ix>=0x7ff00000) return one/(x+x*x);
if((ix|lx)==0) return -one/zero;
if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
/* y0(x) = sqrt(2/(pi*x))*(p0(x)*sin(x0)+q0(x)*cos(x0))
* where x0 = x-pi/4
* Better formula:
* cos(x0) = cos(x)cos(pi/4)+sin(x)sin(pi/4)
* = 1/sqrt(2) * (sin(x) + cos(x))
* sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
* = 1/sqrt(2) * (sin(x) - cos(x))
* To avoid cancellation, use
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.
*/
s = sin(x);
c = cos(x);
ss = s-c;
cc = s+c;
/*
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
if(ix<0x7fe00000) { /* make sure x+x not overflow */
z = -cos(x+x);
if ((s*c)<zero) cc = z/ss;
else ss = z/cc;
}
if(ix>0x48000000) z = (invsqrtpi*ss)/sqrt(x);
else {
u = pzero(x); v = qzero(x);
z = invsqrtpi*(u*ss+v*cc)/sqrt(x);
}
return z;
}
if(ix<=0x3e400000) { /* x < 2**-27 */
return(u00 + tpi*__ieee754_log(x));
}
z = x*x;
u = u00+z*(u01+z*(u02+z*(u03+z*(u04+z*(u05+z*u06)))));
v = one+z*(v01+z*(v02+z*(v03+z*v04)));
return(u/v + tpi*(__ieee754_j0(x)*__ieee754_log(x)));
}
 
/* The asymptotic expansions of pzero is
* 1 - 9/128 s^2 + 11025/98304 s^4 - ..., where s = 1/x.
* For x >= 2, We approximate pzero by
* pzero(x) = 1 + (R/S)
* where R = pR0 + pR1*s^2 + pR2*s^4 + ... + pR5*s^10
* S = 1 + pS0*s^2 + ... + pS4*s^10
* and
* | pzero(x)-1-R/S | <= 2 ** ( -60.26)
*/
#ifdef __STDC__
static const double pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#else
static double pR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#endif
0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
-7.03124999999900357484e-02, /* 0xBFB1FFFF, 0xFFFFFD32 */
-8.08167041275349795626e+00, /* 0xC02029D0, 0xB44FA779 */
-2.57063105679704847262e+02, /* 0xC0701102, 0x7B19E863 */
-2.48521641009428822144e+03, /* 0xC0A36A6E, 0xCD4DCAFC */
-5.25304380490729545272e+03, /* 0xC0B4850B, 0x36CC643D */
};
#ifdef __STDC__
static const double pS8[5] = {
#else
static double pS8[5] = {
#endif
1.16534364619668181717e+02, /* 0x405D2233, 0x07A96751 */
3.83374475364121826715e+03, /* 0x40ADF37D, 0x50596938 */
4.05978572648472545552e+04, /* 0x40E3D2BB, 0x6EB6B05F */
1.16752972564375915681e+05, /* 0x40FC810F, 0x8F9FA9BD */
4.76277284146730962675e+04, /* 0x40E74177, 0x4F2C49DC */
};
 
#ifdef __STDC__
static const double pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#else
static double pR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#endif
-1.14125464691894502584e-11, /* 0xBDA918B1, 0x47E495CC */
-7.03124940873599280078e-02, /* 0xBFB1FFFF, 0xE69AFBC6 */
-4.15961064470587782438e+00, /* 0xC010A370, 0xF90C6BBF */
-6.76747652265167261021e+01, /* 0xC050EB2F, 0x5A7D1783 */
-3.31231299649172967747e+02, /* 0xC074B3B3, 0x6742CC63 */
-3.46433388365604912451e+02, /* 0xC075A6EF, 0x28A38BD7 */
};
#ifdef __STDC__
static const double pS5[5] = {
#else
static double pS5[5] = {
#endif
6.07539382692300335975e+01, /* 0x404E6081, 0x0C98C5DE */
1.05125230595704579173e+03, /* 0x40906D02, 0x5C7E2864 */
5.97897094333855784498e+03, /* 0x40B75AF8, 0x8FBE1D60 */
9.62544514357774460223e+03, /* 0x40C2CCB8, 0xFA76FA38 */
2.40605815922939109441e+03, /* 0x40A2CC1D, 0xC70BE864 */
};
 
#ifdef __STDC__
static const double pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
#else
static double pR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
#endif
-2.54704601771951915620e-09, /* 0xBE25E103, 0x6FE1AA86 */
-7.03119616381481654654e-02, /* 0xBFB1FFF6, 0xF7C0E24B */
-2.40903221549529611423e+00, /* 0xC00345B2, 0xAEA48074 */
-2.19659774734883086467e+01, /* 0xC035F74A, 0x4CB94E14 */
-5.80791704701737572236e+01, /* 0xC04D0A22, 0x420A1A45 */
-3.14479470594888503854e+01, /* 0xC03F72AC, 0xA892D80F */
};
#ifdef __STDC__
static const double pS3[5] = {
#else
static double pS3[5] = {
#endif
3.58560338055209726349e+01, /* 0x4041ED92, 0x84077DD3 */
3.61513983050303863820e+02, /* 0x40769839, 0x464A7C0E */
1.19360783792111533330e+03, /* 0x4092A66E, 0x6D1061D6 */
1.12799679856907414432e+03, /* 0x40919FFC, 0xB8C39B7E */
1.73580930813335754692e+02, /* 0x4065B296, 0xFC379081 */
};
 
#ifdef __STDC__
static const double pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#else
static double pR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#endif
-8.87534333032526411254e-08, /* 0xBE77D316, 0xE927026D */
-7.03030995483624743247e-02, /* 0xBFB1FF62, 0x495E1E42 */
-1.45073846780952986357e+00, /* 0xBFF73639, 0x8A24A843 */
-7.63569613823527770791e+00, /* 0xC01E8AF3, 0xEDAFA7F3 */
-1.11931668860356747786e+01, /* 0xC02662E6, 0xC5246303 */
-3.23364579351335335033e+00, /* 0xC009DE81, 0xAF8FE70F */
};
#ifdef __STDC__
static const double pS2[5] = {
#else
static double pS2[5] = {
#endif
2.22202997532088808441e+01, /* 0x40363865, 0x908B5959 */
1.36206794218215208048e+02, /* 0x4061069E, 0x0EE8878F */
2.70470278658083486789e+02, /* 0x4070E786, 0x42EA079B */
1.53875394208320329881e+02, /* 0x40633C03, 0x3AB6FAFF */
1.46576176948256193810e+01, /* 0x402D50B3, 0x44391809 */
};
 
#ifdef __STDC__
static double pzero(double x)
#else
static double pzero(x)
double x;
#endif
{
#ifdef __STDC__
const double *p,*q;
#else
double *p,*q;
#endif
double z,r,s;
int32_t ix;
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
if(ix>=0x40200000) {p = pR8; q= pS8;}
else if(ix>=0x40122E8B){p = pR5; q= pS5;}
else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
else if(ix>=0x40000000){p = pR2; q= pS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
return one+ r/s;
}
 
 
/* For x >= 8, the asymptotic expansions of qzero is
* -1/8 s + 75/1024 s^3 - ..., where s = 1/x.
* We approximate pzero by
* qzero(x) = s*(-1.25 + (R/S))
* where R = qR0 + qR1*s^2 + qR2*s^4 + ... + qR5*s^10
* S = 1 + qS0*s^2 + ... + qS5*s^12
* and
* | qzero(x)/s +1.25-R/S | <= 2 ** ( -61.22)
*/
#ifdef __STDC__
static const double qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#else
static double qR8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#endif
0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
7.32421874999935051953e-02, /* 0x3FB2BFFF, 0xFFFFFE2C */
1.17682064682252693899e+01, /* 0x40278952, 0x5BB334D6 */
5.57673380256401856059e+02, /* 0x40816D63, 0x15301825 */
8.85919720756468632317e+03, /* 0x40C14D99, 0x3E18F46D */
3.70146267776887834771e+04, /* 0x40E212D4, 0x0E901566 */
};
#ifdef __STDC__
static const double qS8[6] = {
#else
static double qS8[6] = {
#endif
1.63776026895689824414e+02, /* 0x406478D5, 0x365B39BC */
8.09834494656449805916e+03, /* 0x40BFA258, 0x4E6B0563 */
1.42538291419120476348e+05, /* 0x41016652, 0x54D38C3F */
8.03309257119514397345e+05, /* 0x412883DA, 0x83A52B43 */
8.40501579819060512818e+05, /* 0x4129A66B, 0x28DE0B3D */
-3.43899293537866615225e+05, /* 0xC114FD6D, 0x2C9530C5 */
};
 
#ifdef __STDC__
static const double qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#else
static double qR5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#endif
1.84085963594515531381e-11, /* 0x3DB43D8F, 0x29CC8CD9 */
7.32421766612684765896e-02, /* 0x3FB2BFFF, 0xD172B04C */
5.83563508962056953777e+00, /* 0x401757B0, 0xB9953DD3 */
1.35111577286449829671e+02, /* 0x4060E392, 0x0A8788E9 */
1.02724376596164097464e+03, /* 0x40900CF9, 0x9DC8C481 */
1.98997785864605384631e+03, /* 0x409F17E9, 0x53C6E3A6 */
};
#ifdef __STDC__
static const double qS5[6] = {
#else
static double qS5[6] = {
#endif
8.27766102236537761883e+01, /* 0x4054B1B3, 0xFB5E1543 */
2.07781416421392987104e+03, /* 0x40A03BA0, 0xDA21C0CE */
1.88472887785718085070e+04, /* 0x40D267D2, 0x7B591E6D */
5.67511122894947329769e+04, /* 0x40EBB5E3, 0x97E02372 */
3.59767538425114471465e+04, /* 0x40E19118, 0x1F7A54A0 */
-5.35434275601944773371e+03, /* 0xC0B4EA57, 0xBEDBC609 */
};
 
#ifdef __STDC__
static const double qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
#else
static double qR3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
#endif
4.37741014089738620906e-09, /* 0x3E32CD03, 0x6ADECB82 */
7.32411180042911447163e-02, /* 0x3FB2BFEE, 0x0E8D0842 */
3.34423137516170720929e+00, /* 0x400AC0FC, 0x61149CF5 */
4.26218440745412650017e+01, /* 0x40454F98, 0x962DAEDD */
1.70808091340565596283e+02, /* 0x406559DB, 0xE25EFD1F */
1.66733948696651168575e+02, /* 0x4064D77C, 0x81FA21E0 */
};
#ifdef __STDC__
static const double qS3[6] = {
#else
static double qS3[6] = {
#endif
4.87588729724587182091e+01, /* 0x40486122, 0xBFE343A6 */
7.09689221056606015736e+02, /* 0x40862D83, 0x86544EB3 */
3.70414822620111362994e+03, /* 0x40ACF04B, 0xE44DFC63 */
6.46042516752568917582e+03, /* 0x40B93C6C, 0xD7C76A28 */
2.51633368920368957333e+03, /* 0x40A3A8AA, 0xD94FB1C0 */
-1.49247451836156386662e+02, /* 0xC062A7EB, 0x201CF40F */
};
 
#ifdef __STDC__
static const double qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#else
static double qR2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#endif
1.50444444886983272379e-07, /* 0x3E84313B, 0x54F76BDB */
7.32234265963079278272e-02, /* 0x3FB2BEC5, 0x3E883E34 */
1.99819174093815998816e+00, /* 0x3FFFF897, 0xE727779C */
1.44956029347885735348e+01, /* 0x402CFDBF, 0xAAF96FE5 */
3.16662317504781540833e+01, /* 0x403FAA8E, 0x29FBDC4A */
1.62527075710929267416e+01, /* 0x403040B1, 0x71814BB4 */
};
#ifdef __STDC__
static const double qS2[6] = {
#else
static double qS2[6] = {
#endif
3.03655848355219184498e+01, /* 0x403E5D96, 0xF7C07AED */
2.69348118608049844624e+02, /* 0x4070D591, 0xE4D14B40 */
8.44783757595320139444e+02, /* 0x408A6645, 0x22B3BF22 */
8.82935845112488550512e+02, /* 0x408B977C, 0x9C5CC214 */
2.12666388511798828631e+02, /* 0x406A9553, 0x0E001365 */
-5.31095493882666946917e+00, /* 0xC0153E6A, 0xF8B32931 */
};
 
#ifdef __STDC__
static double qzero(double x)
#else
static double qzero(x)
double x;
#endif
{
#ifdef __STDC__
const double *p,*q;
#else
double *p,*q;
#endif
double s,r,z;
int32_t ix;
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
if(ix>=0x40200000) {p = qR8; q= qS8;}
else if(ix>=0x40122E8B){p = qR5; q= qS5;}
else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
else if(ix>=0x40000000){p = qR2; q= qS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
return (-.125 + r/s)/x;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_powf.c
0,0 → 1,253
/* e_powf.c -- float version of e_pow.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_powf.c,v 1.2 1995/05/30 05:48:36 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float
#else
static float
#endif
bp[] = {1.0, 1.5,},
dp_h[] = { 0.0, 5.84960938e-01,}, /* 0x3f15c000 */
dp_l[] = { 0.0, 1.56322085e-06,}, /* 0x35d1cfdc */
zero = 0.0,
one = 1.0,
two = 2.0,
two24 = 16777216.0, /* 0x4b800000 */
huge = 1.0e30,
tiny = 1.0e-30,
/* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */
L1 = 6.0000002384e-01, /* 0x3f19999a */
L2 = 4.2857143283e-01, /* 0x3edb6db7 */
L3 = 3.3333334327e-01, /* 0x3eaaaaab */
L4 = 2.7272811532e-01, /* 0x3e8ba305 */
L5 = 2.3066075146e-01, /* 0x3e6c3255 */
L6 = 2.0697501302e-01, /* 0x3e53f142 */
P1 = 1.6666667163e-01, /* 0x3e2aaaab */
P2 = -2.7777778450e-03, /* 0xbb360b61 */
P3 = 6.6137559770e-05, /* 0x388ab355 */
P4 = -1.6533901999e-06, /* 0xb5ddea0e */
P5 = 4.1381369442e-08, /* 0x3331bb4c */
lg2 = 6.9314718246e-01, /* 0x3f317218 */
lg2_h = 6.93145752e-01, /* 0x3f317200 */
lg2_l = 1.42860654e-06, /* 0x35bfbe8c */
ovt = 4.2995665694e-08, /* -(128-log2(ovfl+.5ulp)) */
cp = 9.6179670095e-01, /* 0x3f76384f =2/(3ln2) */
cp_h = 9.6179199219e-01, /* 0x3f763800 =head of cp */
cp_l = 4.7017383622e-06, /* 0x369dc3a0 =tail of cp_h */
ivln2 = 1.4426950216e+00, /* 0x3fb8aa3b =1/ln2 */
ivln2_h = 1.4426879883e+00, /* 0x3fb8aa00 =16b 1/ln2*/
ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
 
#ifdef __STDC__
float __ieee754_powf(float x, float y)
#else
float __ieee754_powf(x,y)
float x, y;
#endif
{
float z,ax,z_h,z_l,p_h,p_l;
float y1,t1,t2,r,s,t,u,v,w;
int32_t i,j,k,yisint,n;
int32_t hx,hy,ix,iy,is;
 
GET_FLOAT_WORD(hx,x);
GET_FLOAT_WORD(hy,y);
ix = hx&0x7fffffff; iy = hy&0x7fffffff;
 
/* y==zero: x**0 = 1 */
if(iy==0) return one;
 
/* +-NaN return x+y */
if(ix > 0x7f800000 ||
iy > 0x7f800000)
return x+y;
 
/* determine if y is an odd int when x < 0
* yisint = 0 ... y is not an integer
* yisint = 1 ... y is an odd int
* yisint = 2 ... y is an even int
*/
yisint = 0;
if(hx<0) {
if(iy>=0x4b800000) yisint = 2; /* even integer y */
else if(iy>=0x3f800000) {
k = (iy>>23)-0x7f; /* exponent */
j = iy>>(23-k);
if((j<<(23-k))==iy) yisint = 2-(j&1);
}
}
 
/* special value of y */
if (iy==0x7f800000) { /* y is +-inf */
if (ix==0x3f800000)
return y - y; /* inf**+-1 is NaN */
else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */
return (hy>=0)? y: zero;
else /* (|x|<1)**-,+inf = inf,0 */
return (hy<0)?-y: zero;
}
if(iy==0x3f800000) { /* y is +-1 */
if(hy<0) return one/x; else return x;
}
if(hy==0x40000000) return x*x; /* y is 2 */
if(hy==0x3f000000) { /* y is 0.5 */
if(hx>=0) /* x >= +0 */
return sqrtf(x);
}
 
ax = fabsf(x);
/* special value of x */
if(ix==0x7f800000||ix==0||ix==0x3f800000){
z = ax; /*x is +-0,+-inf,+-1*/
if(hy<0) z = one/z; /* z = (1/|x|) */
if(hx<0) {
if(((ix-0x3f800000)|yisint)==0) {
z = (z-z)/(z-z); /* (-1)**non-int is NaN */
} else if(yisint==1)
z = -z; /* (x<0)**odd = -(|x|**odd) */
}
return z;
}
 
/* (x<0)**(non-int) is NaN */
if(((((u_int32_t)hx>>31)-1)|yisint)==0) return (x-x)/(x-x);
 
/* |y| is huge */
if(iy>0x4d000000) { /* if |y| > 2**27 */
/* over/underflow if x is not close to one */
if(ix<0x3f7ffff8) return (hy<0)? huge*huge:tiny*tiny;
if(ix>0x3f800007) return (hy>0)? huge*huge:tiny*tiny;
/* now |1-x| is tiny <= 2**-20, suffice to compute
log(x) by x-x^2/2+x^3/3-x^4/4 */
t = x-1; /* t has 20 trailing zeros */
w = (t*t)*((float)0.5-t*((float)0.333333333333-t*(float)0.25));
u = ivln2_h*t; /* ivln2_h has 16 sig. bits */
v = t*ivln2_l-w*ivln2;
t1 = u+v;
GET_FLOAT_WORD(is,t1);
SET_FLOAT_WORD(t1,is&0xfffff000);
t2 = v-(t1-u);
} else {
float s2,s_h,s_l,t_h,t_l;
n = 0;
/* take care subnormal number */
if(ix<0x00800000)
{ax *= two24; n -= 24; GET_FLOAT_WORD(ix,ax); }
n += ((ix)>>23)-0x7f;
j = ix&0x007fffff;
/* determine interval */
ix = j|0x3f800000; /* normalize ix */
if(j<=0x1cc471) k=0; /* |x|<sqrt(3/2) */
else if(j<0x5db3d7) k=1; /* |x|<sqrt(3) */
else {k=0;n+=1;ix -= 0x00800000;}
SET_FLOAT_WORD(ax,ix);
 
/* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */
u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */
v = one/(ax+bp[k]);
s = u*v;
s_h = s;
GET_FLOAT_WORD(is,s_h);
SET_FLOAT_WORD(s_h,is&0xfffff000);
/* t_h=ax+bp[k] High */
SET_FLOAT_WORD(t_h,((ix>>1)|0x20000000)+0x0040000+(k<<21));
t_l = ax - (t_h-bp[k]);
s_l = v*((u-s_h*t_h)-s_h*t_l);
/* compute log(ax) */
s2 = s*s;
r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6)))));
r += s_l*(s_h+s);
s2 = s_h*s_h;
t_h = (float)3.0+s2+r;
GET_FLOAT_WORD(is,t_h);
SET_FLOAT_WORD(t_h,is&0xfffff000);
t_l = r-((t_h-(float)3.0)-s2);
/* u+v = s*(1+...) */
u = s_h*t_h;
v = s_l*t_h+t_l*s;
/* 2/(3log2)*(s+...) */
p_h = u+v;
GET_FLOAT_WORD(is,p_h);
SET_FLOAT_WORD(p_h,is&0xfffff000);
p_l = v-(p_h-u);
z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */
z_l = cp_l*p_h+p_l*cp+dp_l[k];
/* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */
t = (float)n;
t1 = (((z_h+z_l)+dp_h[k])+t);
GET_FLOAT_WORD(is,t1);
SET_FLOAT_WORD(t1,is&0xfffff000);
t2 = z_l-(((t1-t)-dp_h[k])-z_h);
}
 
s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
if(((((u_int32_t)hx>>31)-1)|(yisint-1))==0)
s = -one; /* (-ve)**(odd int) */
 
/* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */
GET_FLOAT_WORD(is,y);
SET_FLOAT_WORD(y1,is&0xfffff000);
p_l = (y-y1)*t1+y*t2;
p_h = y1*t1;
z = p_l+p_h;
GET_FLOAT_WORD(j,z);
if (j>0x43000000) /* if z > 128 */
return s*huge*huge; /* overflow */
else if (j==0x43000000) { /* if z == 128 */
if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */
}
else if ((j&0x7fffffff)>0x43160000) /* z <= -150 */
return s*tiny*tiny; /* underflow */
else if (j==0xc3160000){ /* z == -150 */
if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */
}
/*
* compute 2**(p_h+p_l)
*/
i = j&0x7fffffff;
k = (i>>23)-0x7f;
n = 0;
if(i>0x3f000000) { /* if |z| > 0.5, set n = [z+0.5] */
n = j+(0x00800000>>(k+1));
k = ((n&0x7fffffff)>>23)-0x7f; /* new k for n */
SET_FLOAT_WORD(t,n&~(0x007fffff>>k));
n = ((n&0x007fffff)|0x00800000)>>(23-k);
if(j<0) n = -n;
p_h -= t;
}
t = p_l+p_h;
GET_FLOAT_WORD(is,t);
SET_FLOAT_WORD(t,is&0xfffff000);
u = t*lg2_h;
v = (p_l-(t-p_h))*lg2+t*lg2_l;
z = u+v;
w = v-(z-u);
t = z*z;
t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
r = (z*t1)/(t1-two)-(w+z*w);
z = one-(r-z);
GET_FLOAT_WORD(j,z);
j += (n<<23);
if((j>>23)<=0) z = scalbnf(z,n); /* subnormal output */
else SET_FLOAT_WORD(z,j);
return s*z;
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_acosf.c
0,0 → 1,47
/* w_acosf.c -- float version of w_acos.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_acosf.c,v 1.2 1995/05/30 05:50:38 rgrimes Exp $";
#endif
 
/*
* wrap_acosf(x)
*/
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
float acosf(float x) /* wrapper acosf */
#else
float acosf(x) /* wrapper acosf */
float x;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_acosf(x);
#else
float z;
z = __ieee754_acosf(x);
if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z;
if(fabsf(x)>(float)1.0) {
/* acosf(|x|>1) */
return (float)__kernel_standard((double)x,(double)x,101);
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_j1f.c
0,0 → 1,444
/* e_j1f.c -- float version of e_j1.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_j1f.c,v 1.2 1995/05/30 05:48:23 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static float ponef(float), qonef(float);
#else
static float ponef(), qonef();
#endif
 
#ifdef __STDC__
static const float
#else
static float
#endif
huge = 1e30,
one = 1.0,
invsqrtpi= 5.6418961287e-01, /* 0x3f106ebb */
tpi = 6.3661974669e-01, /* 0x3f22f983 */
/* R0/S0 on [0,2] */
r00 = -6.2500000000e-02, /* 0xbd800000 */
r01 = 1.4070566976e-03, /* 0x3ab86cfd */
r02 = -1.5995563444e-05, /* 0xb7862e36 */
r03 = 4.9672799207e-08, /* 0x335557d2 */
s01 = 1.9153760746e-02, /* 0x3c9ce859 */
s02 = 1.8594678841e-04, /* 0x3942fab6 */
s03 = 1.1771846857e-06, /* 0x359dffc2 */
s04 = 5.0463624390e-09, /* 0x31ad6446 */
s05 = 1.2354227016e-11; /* 0x2d59567e */
 
#ifdef __STDC__
static const float zero = 0.0;
#else
static float zero = 0.0;
#endif
 
#ifdef __STDC__
float __ieee754_j1f(float x)
#else
float __ieee754_j1f(x)
float x;
#endif
{
float z, s,c,ss,cc,r,u,v,y;
int32_t hx,ix;
 
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7f800000) return one/x;
y = fabsf(x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
s = sinf(y);
c = cosf(y);
ss = -s-c;
cc = s-c;
if(ix<0x7f000000) { /* make sure y+y not overflow */
z = cosf(y+y);
if ((s*c)>zero) cc = z/ss;
else ss = z/cc;
}
/*
* j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
if(ix>0x80000000) z = (invsqrtpi*cc)/sqrtf(y);
else {
u = ponef(y); v = qonef(y);
z = invsqrtpi*(u*cc-v*ss)/sqrtf(y);
}
if(hx<0) return -z;
else return z;
}
if(ix<0x32000000) { /* |x|<2**-27 */
if(huge+x>one) return (float)0.5*x;/* inexact if x!=0 necessary */
}
z = x*x;
r = z*(r00+z*(r01+z*(r02+z*r03)));
s = one+z*(s01+z*(s02+z*(s03+z*(s04+z*s05))));
r *= x;
return(x*(float)0.5+r/s);
}
 
#ifdef __STDC__
static const float U0[5] = {
#else
static float U0[5] = {
#endif
-1.9605709612e-01, /* 0xbe48c331 */
5.0443872809e-02, /* 0x3d4e9e3c */
-1.9125689287e-03, /* 0xbafaaf2a */
2.3525259166e-05, /* 0x37c5581c */
-9.1909917899e-08, /* 0xb3c56003 */
};
#ifdef __STDC__
static const float V0[5] = {
#else
static float V0[5] = {
#endif
1.9916731864e-02, /* 0x3ca3286a */
2.0255257550e-04, /* 0x3954644b */
1.3560879779e-06, /* 0x35b602d4 */
6.2274145840e-09, /* 0x31d5f8eb */
1.6655924903e-11, /* 0x2d9281cf */
};
 
#ifdef __STDC__
float __ieee754_y1f(float x)
#else
float __ieee754_y1f(x)
float x;
#endif
{
float z, s,c,ss,cc,u,v;
int32_t hx,ix;
 
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
/* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
if(ix>=0x7f800000) return one/(x+x*x);
if(ix==0) return -one/zero;
if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
s = sinf(x);
c = cosf(x);
ss = -s-c;
cc = s-c;
if(ix<0x7f000000) { /* make sure x+x not overflow */
z = cosf(x+x);
if ((s*c)>zero) cc = z/ss;
else ss = z/cc;
}
/* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x0)+q1(x)*cos(x0))
* where x0 = x-3pi/4
* Better formula:
* cos(x0) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
* = 1/sqrt(2) * (sin(x) - cos(x))
* sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
* = -1/sqrt(2) * (cos(x) + sin(x))
* To avoid cancellation, use
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.
*/
if(ix>0x48000000) z = (invsqrtpi*ss)/sqrtf(x);
else {
u = ponef(x); v = qonef(x);
z = invsqrtpi*(u*ss+v*cc)/sqrtf(x);
}
return z;
}
if(ix<=0x24800000) { /* x < 2**-54 */
return(-tpi/x);
}
z = x*x;
u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4])));
v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4]))));
return(x*(u/v) + tpi*(__ieee754_j1f(x)*__ieee754_logf(x)-one/x));
}
 
/* For x >= 8, the asymptotic expansions of pone is
* 1 + 15/128 s^2 - 4725/2^15 s^4 - ..., where s = 1/x.
* We approximate pone by
* pone(x) = 1 + (R/S)
* where R = pr0 + pr1*s^2 + pr2*s^4 + ... + pr5*s^10
* S = 1 + ps0*s^2 + ... + ps4*s^10
* and
* | pone(x)-1-R/S | <= 2 ** ( -60.06)
*/
 
#ifdef __STDC__
static const float pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#else
static float pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#endif
0.0000000000e+00, /* 0x00000000 */
1.1718750000e-01, /* 0x3df00000 */
1.3239480972e+01, /* 0x4153d4ea */
4.1205184937e+02, /* 0x43ce06a3 */
3.8747453613e+03, /* 0x45722bed */
7.9144794922e+03, /* 0x45f753d6 */
};
#ifdef __STDC__
static const float ps8[5] = {
#else
static float ps8[5] = {
#endif
1.1420736694e+02, /* 0x42e46a2c */
3.6509309082e+03, /* 0x45642ee5 */
3.6956207031e+04, /* 0x47105c35 */
9.7602796875e+04, /* 0x47bea166 */
3.0804271484e+04, /* 0x46f0a88b */
};
 
#ifdef __STDC__
static const float pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#else
static float pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#endif
1.3199052094e-11, /* 0x2d68333f */
1.1718749255e-01, /* 0x3defffff */
6.8027510643e+00, /* 0x40d9b023 */
1.0830818176e+02, /* 0x42d89dca */
5.1763616943e+02, /* 0x440168b7 */
5.2871520996e+02, /* 0x44042dc6 */
};
#ifdef __STDC__
static const float ps5[5] = {
#else
static float ps5[5] = {
#endif
5.9280597687e+01, /* 0x426d1f55 */
9.9140142822e+02, /* 0x4477d9b1 */
5.3532670898e+03, /* 0x45a74a23 */
7.8446904297e+03, /* 0x45f52586 */
1.5040468750e+03, /* 0x44bc0180 */
};
 
#ifdef __STDC__
static const float pr3[6] = {
#else
static float pr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
#endif
3.0250391081e-09, /* 0x314fe10d */
1.1718686670e-01, /* 0x3defffab */
3.9329774380e+00, /* 0x407bb5e7 */
3.5119403839e+01, /* 0x420c7a45 */
9.1055007935e+01, /* 0x42b61c2a */
4.8559066772e+01, /* 0x42423c7c */
};
#ifdef __STDC__
static const float ps3[5] = {
#else
static float ps3[5] = {
#endif
3.4791309357e+01, /* 0x420b2a4d */
3.3676245117e+02, /* 0x43a86198 */
1.0468714600e+03, /* 0x4482dbe3 */
8.9081134033e+02, /* 0x445eb3ed */
1.0378793335e+02, /* 0x42cf936c */
};
 
#ifdef __STDC__
static const float pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#else
static float pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#endif
1.0771083225e-07, /* 0x33e74ea8 */
1.1717621982e-01, /* 0x3deffa16 */
2.3685150146e+00, /* 0x401795c0 */
1.2242610931e+01, /* 0x4143e1bc */
1.7693971634e+01, /* 0x418d8d41 */
5.0735230446e+00, /* 0x40a25a4d */
};
#ifdef __STDC__
static const float ps2[5] = {
#else
static float ps2[5] = {
#endif
2.1436485291e+01, /* 0x41ab7dec */
1.2529022980e+02, /* 0x42fa9499 */
2.3227647400e+02, /* 0x436846c7 */
1.1767937469e+02, /* 0x42eb5bd7 */
8.3646392822e+00, /* 0x4105d590 */
};
 
#ifdef __STDC__
static float ponef(float x)
#else
static float ponef(x)
float x;
#endif
{
#ifdef __STDC__
const float *p,*q;
#else
float *p,*q;
#endif
float z,r,s;
int32_t ix;
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
if(ix>=0x41000000) {p = pr8; q= ps8;}
else if(ix>=0x40f71c58){p = pr5; q= ps5;}
else if(ix>=0x4036db68){p = pr3; q= ps3;}
else if(ix>=0x40000000){p = pr2; q= ps2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
return one+ r/s;
}
 
 
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
* We approximate pone by
* qone(x) = s*(0.375 + (R/S))
* where R = qr1*s^2 + qr2*s^4 + ... + qr5*s^10
* S = 1 + qs1*s^2 + ... + qs6*s^12
* and
* | qone(x)/s -0.375-R/S | <= 2 ** ( -61.13)
*/
 
#ifdef __STDC__
static const float qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#else
static float qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#endif
0.0000000000e+00, /* 0x00000000 */
-1.0253906250e-01, /* 0xbdd20000 */
-1.6271753311e+01, /* 0xc1822c8d */
-7.5960174561e+02, /* 0xc43de683 */
-1.1849806641e+04, /* 0xc639273a */
-4.8438511719e+04, /* 0xc73d3683 */
};
#ifdef __STDC__
static const float qs8[6] = {
#else
static float qs8[6] = {
#endif
1.6139537048e+02, /* 0x43216537 */
7.8253862305e+03, /* 0x45f48b17 */
1.3387534375e+05, /* 0x4802bcd6 */
7.1965775000e+05, /* 0x492fb29c */
6.6660125000e+05, /* 0x4922be94 */
-2.9449025000e+05, /* 0xc88fcb48 */
};
 
#ifdef __STDC__
static const float qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#else
static float qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#endif
-2.0897993405e-11, /* 0xadb7d219 */
-1.0253904760e-01, /* 0xbdd1fffe */
-8.0564479828e+00, /* 0xc100e736 */
-1.8366960144e+02, /* 0xc337ab6b */
-1.3731937256e+03, /* 0xc4aba633 */
-2.6124443359e+03, /* 0xc523471c */
};
#ifdef __STDC__
static const float qs5[6] = {
#else
static float qs5[6] = {
#endif
8.1276550293e+01, /* 0x42a28d98 */
1.9917987061e+03, /* 0x44f8f98f */
1.7468484375e+04, /* 0x468878f8 */
4.9851425781e+04, /* 0x4742bb6d */
2.7948074219e+04, /* 0x46da5826 */
-4.7191835938e+03, /* 0xc5937978 */
};
 
#ifdef __STDC__
static const float qr3[6] = {
#else
static float qr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
#endif
-5.0783124372e-09, /* 0xb1ae7d4f */
-1.0253783315e-01, /* 0xbdd1ff5b */
-4.6101160049e+00, /* 0xc0938612 */
-5.7847221375e+01, /* 0xc267638e */
-2.2824453735e+02, /* 0xc3643e9a */
-2.1921012878e+02, /* 0xc35b35cb */
};
#ifdef __STDC__
static const float qs3[6] = {
#else
static float qs3[6] = {
#endif
4.7665153503e+01, /* 0x423ea91e */
6.7386511230e+02, /* 0x4428775e */
3.3801528320e+03, /* 0x45534272 */
5.5477290039e+03, /* 0x45ad5dd5 */
1.9031191406e+03, /* 0x44ede3d0 */
-1.3520118713e+02, /* 0xc3073381 */
};
 
#ifdef __STDC__
static const float qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#else
static float qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#endif
-1.7838172539e-07, /* 0xb43f8932 */
-1.0251704603e-01, /* 0xbdd1f475 */
-2.7522056103e+00, /* 0xc0302423 */
-1.9663616180e+01, /* 0xc19d4f16 */
-4.2325313568e+01, /* 0xc2294d1f */
-2.1371921539e+01, /* 0xc1aaf9b2 */
};
#ifdef __STDC__
static const float qs2[6] = {
#else
static float qs2[6] = {
#endif
2.9533363342e+01, /* 0x41ec4454 */
2.5298155212e+02, /* 0x437cfb47 */
7.5750280762e+02, /* 0x443d602e */
7.3939318848e+02, /* 0x4438d92a */
1.5594900513e+02, /* 0x431bf2f2 */
-4.9594988823e+00, /* 0xc09eb437 */
};
 
#ifdef __STDC__
static float qonef(float x)
#else
static float qonef(x)
float x;
#endif
{
#ifdef __STDC__
const float *p,*q;
#else
float *p,*q;
#endif
float s,r,z;
int32_t ix;
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
if(ix>=0x40200000) {p = qr8; q= qs8;}
else if(ix>=0x40f71c58){p = qr5; q= qs5;}
else if(ix>=0x4036db68){p = qr3; q= qs3;}
else if(ix>=0x40000000){p = qr2; q= qs2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
return ((float).375 + r/s)/x;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_log10.c
0,0 → 1,98
/* @(#)e_log10.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_log10.c,v 1.3.6.1 1997/02/23 11:03:06 joerg Exp $";
#endif
 
/* __ieee754_log10(x)
* Return the base 10 logarithm of x
*
* Method :
* Let log10_2hi = leading 40 bits of log10(2) and
* log10_2lo = log10(2) - log10_2hi,
* ivln10 = 1/log(10) rounded.
* Then
* n = ilogb(x),
* if(n<0) n = n+1;
* x = scalbn(x,-n);
* log10(x) := n*log10_2hi + (n*log10_2lo + ivln10*log(x))
*
* Note 1:
* To guarantee log10(10**n)=n, where 10**n is normal, the rounding
* mode must set to Round-to-Nearest.
* Note 2:
* [1/log(10)] rounded to 53 bits has error .198 ulps;
* log10 is monotonic at all binary break points.
*
* Special cases:
* log10(x) is NaN with signal if x < 0;
* log10(+INF) is +INF with no signal; log10(0) is -INF with signal;
* log10(NaN) is that NaN with no signal;
* log10(10**N) = N for N=0,1,...,22.
*
* Constants:
* The hexadecimal values are the intended ones for the following constants.
* The decimal values may be used, provided that the compiler will convert
* from decimal to binary accurately enough to produce the hexadecimal values
* shown.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double
#else
static double
#endif
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
ivln10 = 4.34294481903251816668e-01, /* 0x3FDBCB7B, 0x1526E50E */
log10_2hi = 3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */
log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */
 
#ifdef __STDC__
static const double zero = 0.0;
#else
static double zero = 0.0;
#endif
 
#ifdef __STDC__
double __generic___ieee754_log10(double x)
#else
double __generic___ieee754_log10(x)
double x;
#endif
{
double y,z;
int32_t i,k,hx;
u_int32_t lx;
 
EXTRACT_WORDS(hx,lx,x);
 
k=0;
if (hx < 0x00100000) { /* x < 2**-1022 */
if (((hx&0x7fffffff)|lx)==0)
return -two54/zero; /* log(+-0)=-inf */
if (hx<0) return (x-x)/zero; /* log(-#) = NaN */
k -= 54; x *= two54; /* subnormal number, scale up x */
GET_HIGH_WORD(hx,x);
}
if (hx >= 0x7ff00000) return x+x;
k += (hx>>20)-1023;
i = ((u_int32_t)k&0x80000000)>>31;
hx = (hx&0x000fffff)|((0x3ff-i)<<20);
y = (double)(k+i);
SET_HIGH_WORD(x,hx);
z = y*log10_2lo + ivln10*__ieee754_log(x);
return z+y*log10_2hi;
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_lgam1.c
0,0 → 1,46
/* @(#)wr_lgamma.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_lgamma_r.c,v 1.2 1995/05/30 05:51:29 rgrimes Exp $";
#endif
 
/*
* wrapper double lgamma_r(double x, int *signgamp)
*/
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
double lgamma_r(double x, int *signgamp) /* wrapper lgamma_r */
#else
double lgamma_r(x,signgamp) /* wrapper lgamma_r */
double x; int *signgamp;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_lgamma_r(x,signgamp);
#else
double y;
y = __ieee754_lgamma_r(x,signgamp);
if(_LIB_VERSION == _IEEE_) return y;
if(!finite(y)&&finite(x)) {
if(floor(x)==x&&x<=0.0)
return __kernel_standard(x,x,15); /* lgamma pole */
else
return __kernel_standard(x,x,14); /* lgamma overflow */
} else
return y;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_jn.c
0,0 → 1,42
/* @(#)w_jn.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_jn.c,v 1.2.6.1 1997/03/03 14:21:06 bde Exp $";
#endif
 
/*
* wrapper jn(int n, double x)
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
double jn(int n, double x) /* wrapper jn */
#else
double jn(n,x) /* wrapper jn */
double x; int n;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_jn(n,x);
#else
double z;
z = __ieee754_jn(n,x);
if(_LIB_VERSION == _IEEE_ || isnan(x) ) return z;
if(fabs(x)>X_TLOSS) {
return __kernel_standard((double)n,x,38); /* jn(|x|>X_TLOSS,n) */
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_isnanf.c
0,0 → 1,40
/* s_isnanf.c -- float version of s_isnan.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_isnanf.c,v 1.2 1995/05/30 05:49:48 rgrimes Exp $";
#endif
 
/*
* isnanf(x) returns 1 is x is nan, else 0;
* no branching!
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
int isnanf(float x)
#else
int isnanf(x)
float x;
#endif
{
int32_t ix;
GET_FLOAT_WORD(ix,x);
ix &= 0x7fffffff;
ix = 0x7f800000 - ix;
return (int)(((u_int32_t)(ix))>>31);
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_lgamma.c
0,0 → 1,36
/* @(#)e_lgamma.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_lgamma.c,v 1.2 1995/05/30 05:48:26 rgrimes Exp $";
#endif
 
/* __ieee754_lgamma(x)
* Return the logarithm of the Gamma function of x.
*
* Method: call __ieee754_lgamma_r
*/
 
#include "math.h"
#include "math_private.h"
 
extern int signgam;
 
#ifdef __STDC__
double __ieee754_lgamma(double x)
#else
double __ieee754_lgamma(x)
double x;
#endif
{
return __ieee754_lgamma_r(x,&signgam);
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_ceilf.c
0,0 → 1,61
/* s_ceilf.c -- float version of s_ceil.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_ceilf.c,v 1.2 1995/05/30 05:49:26 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float huge = 1.0e30;
#else
static float huge = 1.0e30;
#endif
 
#ifdef __STDC__
float ceilf(float x)
#else
float ceilf(x)
float x;
#endif
{
int32_t i0,j0;
u_int32_t i;
 
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f;
if(j0<23) {
if(j0<0) { /* raise inexact if x != 0 */
if(huge+x>(float)0.0) {/* return 0*sign(x) if |x|<1 */
if(i0<0) {i0=0x80000000;}
else if(i0!=0) { i0=0x3f800000;}
}
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) return x; /* x is integral */
if(huge+x>(float)0.0) { /* raise inexact flag */
if(i0>0) i0 += (0x00800000)>>j0;
i0 &= (~i);
}
}
} else {
if(j0==0x80) return x+x; /* inf or NaN */
else return x; /* x is integral */
}
SET_FLOAT_WORD(x,i0);
return x;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_asinf.c
0,0 → 1,92
/* e_asinf.c -- float version of e_asin.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_asinf.c,v 1.3 1996/07/12 18:57:47 jkh Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float
#else
static float
#endif
one = 1.0000000000e+00, /* 0x3F800000 */
huge = 1.000e+30,
pio2_hi = 1.5707962513e+00, /* 0x3fc90fda */
pio2_lo = 7.5497894159e-08, /* 0x33a22168 */
pio4_hi = 7.8539818525e-01, /* 0x3f490fdb */
/* coefficient for R(x^2) */
pS0 = 1.6666667163e-01, /* 0x3e2aaaab */
pS1 = -3.2556581497e-01, /* 0xbea6b090 */
pS2 = 2.0121252537e-01, /* 0x3e4e0aa8 */
pS3 = -4.0055535734e-02, /* 0xbd241146 */
pS4 = 7.9153501429e-04, /* 0x3a4f7f04 */
pS5 = 3.4793309169e-05, /* 0x3811ef08 */
qS1 = -2.4033949375e+00, /* 0xc019d139 */
qS2 = 2.0209457874e+00, /* 0x4001572d */
qS3 = -6.8828397989e-01, /* 0xbf303361 */
qS4 = 7.7038154006e-02; /* 0x3d9dc62e */
 
#ifdef __STDC__
float __ieee754_asinf(float x)
#else
float __ieee754_asinf(x)
float x;
#endif
{
float t=0.0,w,p,q,c,r,s;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix==0x3f800000) {
/* asin(1)=+-pi/2 with inexact */
return x*pio2_hi+x*pio2_lo;
} else if(ix> 0x3f800000) { /* |x|>= 1 */
return (x-x)/(x-x); /* asin(|x|>1) is NaN */
} else if (ix<0x3f000000) { /* |x|<0.5 */
if(ix<0x32000000) { /* if |x| < 2**-27 */
if(huge+x>one) return x;/* return x with inexact if x!=0*/
} else
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
return x+x*w;
}
/* 1> |x|>= 0.5 */
w = one-fabsf(x);
t = w*(float)0.5;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
s = sqrtf(t);
if(ix>=0x3F79999A) { /* if |x| > 0.975 */
w = p/q;
t = pio2_hi-((float)2.0*(s+s*w)-pio2_lo);
} else {
int32_t iw;
w = s;
GET_FLOAT_WORD(iw,w);
SET_FLOAT_WORD(w,iw&0xfffff000);
c = (t-w*w)/(s+w);
r = p/q;
p = (float)2.0*s*r-(pio2_lo-(float)2.0*c);
q = pio4_hi-(float)2.0*w;
t = pio4_hi-(p-q);
}
if(hx>0) return t; else return -t;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_atanhf.c
0,0 → 1,58
/* e_atanhf.c -- float version of e_atanh.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_atanhf.c,v 1.2 1995/05/30 05:48:04 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float one = 1.0, huge = 1e30;
#else
static float one = 1.0, huge = 1e30;
#endif
 
#ifdef __STDC__
static const float zero = 0.0;
#else
static float zero = 0.0;
#endif
 
#ifdef __STDC__
float __ieee754_atanhf(float x)
#else
float __ieee754_atanhf(x)
float x;
#endif
{
float t;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if (ix>0x3f800000) /* |x|>1 */
return (x-x)/(x-x);
if(ix==0x3f800000)
return x/zero;
if(ix<0x31800000&&(huge+x)>zero) return x; /* x<2**-28 */
SET_FLOAT_WORD(x,ix);
if(ix<0x3f000000) { /* x < 0.5 */
t = x+x;
t = (float)0.5*log1pf(t+t*x/(one-x));
} else
t = (float)0.5*log1pf((x+x)/(one-x));
if(hx>=0) return t; else return -t;
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_atan.c
0,0 → 1,139
/* @(#)s_atan.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_atan.c,v 1.2.6.1 1997/02/23 11:03:13 joerg Exp $";
#endif
 
/* atan(x)
* Method
* 1. Reduce x to positive by atan(x) = -atan(-x).
* 2. According to the integer k=4t+0.25 chopped, t=x, the argument
* is further reduced to one of the following intervals and the
* arctangent of t is evaluated by the corresponding formula:
*
* [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...)
* [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) )
* [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) )
* [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) )
* [39/16,INF] atan(x) = atan(INF) + atan( -1/t )
*
* Constants:
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
* to produce the hexadecimal values shown.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double atanhi[] = {
#else
static double atanhi[] = {
#endif
4.63647609000806093515e-01, /* atan(0.5)hi 0x3FDDAC67, 0x0561BB4F */
7.85398163397448278999e-01, /* atan(1.0)hi 0x3FE921FB, 0x54442D18 */
9.82793723247329054082e-01, /* atan(1.5)hi 0x3FEF730B, 0xD281F69B */
1.57079632679489655800e+00, /* atan(inf)hi 0x3FF921FB, 0x54442D18 */
};
 
#ifdef __STDC__
static const double atanlo[] = {
#else
static double atanlo[] = {
#endif
2.26987774529616870924e-17, /* atan(0.5)lo 0x3C7A2B7F, 0x222F65E2 */
3.06161699786838301793e-17, /* atan(1.0)lo 0x3C81A626, 0x33145C07 */
1.39033110312309984516e-17, /* atan(1.5)lo 0x3C700788, 0x7AF0CBBD */
6.12323399573676603587e-17, /* atan(inf)lo 0x3C91A626, 0x33145C07 */
};
 
#ifdef __STDC__
static const double aT[] = {
#else
static double aT[] = {
#endif
3.33333333333329318027e-01, /* 0x3FD55555, 0x5555550D */
-1.99999999998764832476e-01, /* 0xBFC99999, 0x9998EBC4 */
1.42857142725034663711e-01, /* 0x3FC24924, 0x920083FF */
-1.11111104054623557880e-01, /* 0xBFBC71C6, 0xFE231671 */
9.09088713343650656196e-02, /* 0x3FB745CD, 0xC54C206E */
-7.69187620504482999495e-02, /* 0xBFB3B0F2, 0xAF749A6D */
6.66107313738753120669e-02, /* 0x3FB10D66, 0xA0D03D51 */
-5.83357013379057348645e-02, /* 0xBFADDE2D, 0x52DEFD9A */
4.97687799461593236017e-02, /* 0x3FA97B4B, 0x24760DEB */
-3.65315727442169155270e-02, /* 0xBFA2B444, 0x2C6A6C2F */
1.62858201153657823623e-02, /* 0x3F90AD3A, 0xE322DA11 */
};
 
#ifdef __STDC__
static const double
#else
static double
#endif
one = 1.0,
huge = 1.0e300;
 
#ifdef __STDC__
double __generic_atan(double x)
#else
double __generic_atan(x)
double x;
#endif
{
double w,s1,s2,z;
int32_t ix,hx,id;
 
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x44100000) { /* if |x| >= 2^66 */
u_int32_t low;
GET_LOW_WORD(low,x);
if(ix>0x7ff00000||
(ix==0x7ff00000&&(low!=0)))
return x+x; /* NaN */
if(hx>0) return atanhi[3]+atanlo[3];
else return -atanhi[3]-atanlo[3];
} if (ix < 0x3fdc0000) { /* |x| < 0.4375 */
if (ix < 0x3e200000) { /* |x| < 2^-29 */
if(huge+x>one) return x; /* raise inexact */
}
id = -1;
} else {
x = fabs(x);
if (ix < 0x3ff30000) { /* |x| < 1.1875 */
if (ix < 0x3fe60000) { /* 7/16 <=|x|<11/16 */
id = 0; x = (2.0*x-one)/(2.0+x);
} else { /* 11/16<=|x|< 19/16 */
id = 1; x = (x-one)/(x+one);
}
} else {
if (ix < 0x40038000) { /* |x| < 2.4375 */
id = 2; x = (x-1.5)/(one+1.5*x);
} else { /* 2.4375 <= |x| < 2^66 */
id = 3; x = -1.0/x;
}
}}
/* end of argument reduction */
z = x*x;
w = z*z;
/* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */
s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10])))));
s2 = w*(aT[1]+w*(aT[3]+w*(aT[5]+w*(aT[7]+w*aT[9]))));
if (id<0) return x - x*(s1+s2);
else {
z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x);
return (hx<0)? -z:z;
}
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_log10.c
0,0 → 1,46
/* @(#)w_log10.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_log10.c,v 1.2 1995/05/30 05:51:34 rgrimes Exp $";
#endif
 
/*
* wrapper log10(X)
*/
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
double log10(double x) /* wrapper log10 */
#else
double log10(x) /* wrapper log10 */
double x;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_log10(x);
#else
double z;
z = __ieee754_log10(x);
if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
if(x<=0.0) {
if(x==0.0)
return __kernel_standard(x,x,18); /* log10(0) */
else
return __kernel_standard(x,x,19); /* log10(x<0) */
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_modff.c
0,0 → 1,64
/* s_modff.c -- float version of s_modf.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_modff.c,v 1.2 1995/05/30 05:50:08 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float one = 1.0;
#else
static float one = 1.0;
#endif
 
#ifdef __STDC__
float modff(float x, float *iptr)
#else
float modff(x, iptr)
float x,*iptr;
#endif
{
int32_t i0,j0;
u_int32_t i;
GET_FLOAT_WORD(i0,x);
j0 = ((i0>>23)&0xff)-0x7f; /* exponent of x */
if(j0<23) { /* integer part in x */
if(j0<0) { /* |x|<1 */
SET_FLOAT_WORD(*iptr,i0&0x80000000); /* *iptr = +-0 */
return x;
} else {
i = (0x007fffff)>>j0;
if((i0&i)==0) { /* x is integral */
u_int32_t ix;
*iptr = x;
GET_FLOAT_WORD(ix,x);
SET_FLOAT_WORD(x,ix&0x80000000); /* return +-0 */
return x;
} else {
SET_FLOAT_WORD(*iptr,i0&(~i));
return x - *iptr;
}
}
} else { /* no fraction part */
u_int32_t ix;
*iptr = x*one;
GET_FLOAT_WORD(ix,x);
SET_FLOAT_WORD(x,ix&0x80000000); /* return +-0 */
return x;
}
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_log10f.c
0,0 → 1,51
/* w_log10f.c -- float version of w_log10.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_log10f.c,v 1.2 1995/05/30 05:51:35 rgrimes Exp $";
#endif
 
/*
* wrapper log10f(X)
*/
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
float log10f(float x) /* wrapper log10f */
#else
float log10f(x) /* wrapper log10f */
float x;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_log10f(x);
#else
float z;
z = __ieee754_log10f(x);
if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z;
if(x<=(float)0.0) {
if(x==(float)0.0)
/* log10(0) */
return (float)__kernel_standard((double)x,(double)x,118);
else
/* log10(x<0) */
return (float)__kernel_standard((double)x,(double)x,119);
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_ilogb.c
0,0 → 1,50
/* @(#)s_ilogb.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_ilogb.c,v 1.2.6.1 1997/02/23 11:03:19 joerg Exp $";
#endif
 
/* ilogb(double x)
* return the binary exponent of non-zero x
* ilogb(0) = 0x80000001
* ilogb(inf/NaN) = 0x7fffffff (no signal is raised)
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
int __generic_ilogb(double x)
#else
int __generic_ilogb(x)
double x;
#endif
{
int32_t hx,lx,ix;
 
EXTRACT_WORDS(hx,lx,x);
hx &= 0x7fffffff;
if(hx<0x00100000) {
if((hx|lx)==0)
return 0x80000001; /* ilogb(0) = 0x80000001 */
else /* subnormal x */
if(hx==0) {
for (ix = -1043; lx>0; lx<<=1) ix -=1;
} else {
for (ix = -1022,hx<<=11; hx>0; hx<<=1) ix -=1;
}
return ix;
}
else if (hx<0x7ff00000) return (hx>>20)-1023;
else return 0x7fffffff;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_remain.c
0,0 → 1,80
/* @(#)e_remainder.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_remainder.c,v 1.2.6.1 1997/02/23 11:03:07 joerg Exp $";
#endif
 
/* __ieee754_remainder(x,p)
* Return :
* returns x REM p = x - [x/p]*p as if in infinite
* precise arithmetic, where [x/p] is the (infinite bit)
* integer nearest x/p (in half way case choose the even one).
* Method :
* Based on fmod() return x-[x/p]chopped*p exactlp.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double zero = 0.0;
#else
static double zero = 0.0;
#endif
 
 
#ifdef __STDC__
double __generic___ieee754_remainder(double x, double p)
#else
double __generic___ieee754_remainder(x,p)
double x,p;
#endif
{
int32_t hx,hp;
u_int32_t sx,lx,lp;
double p_half;
 
EXTRACT_WORDS(hx,lx,x);
EXTRACT_WORDS(hp,lp,p);
sx = hx&0x80000000;
hp &= 0x7fffffff;
hx &= 0x7fffffff;
 
/* purge off exception values */
if((hp|lp)==0) return (x*p)/(x*p); /* p = 0 */
if((hx>=0x7ff00000)|| /* x not finite */
((hp>=0x7ff00000)&& /* p is NaN */
(((hp-0x7ff00000)|lp)!=0)))
return (x*p)/(x*p);
 
 
if (hp<=0x7fdfffff) x = __ieee754_fmod(x,p+p); /* now x < 2p */
if (((hx-hp)|(lx-lp))==0) return zero*x;
x = fabs(x);
p = fabs(p);
if (hp<0x00200000) {
if(x+x>p) {
x-=p;
if(x+x>=p) x -= p;
}
} else {
p_half = 0.5*p;
if(x>p_half) {
x-=p;
if(x>=p_half) x -= p;
}
}
GET_HIGH_WORD(hx,x);
SET_HIGH_WORD(x,hx^sx);
return x;
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_asin.c
0,0 → 1,44
/* @(#)w_asin.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_asin.c,v 1.2 1995/05/30 05:50:41 rgrimes Exp $";
#endif
 
/*
* wrapper asin(x)
*/
 
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
double asin(double x) /* wrapper asin */
#else
double asin(x) /* wrapper asin */
double x;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_asin(x);
#else
double z;
z = __ieee754_asin(x);
if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
if(fabs(x)>1.0) {
return __kernel_standard(x,x,2); /* asin(|x|>1) */
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_jnf.c
0,0 → 1,212
/* e_jnf.c -- float version of e_jn.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_jnf.c,v 1.3 1995/05/30 05:48:25 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float
#else
static float
#endif
invsqrtpi= 5.6418961287e-01, /* 0x3f106ebb */
two = 2.0000000000e+00, /* 0x40000000 */
one = 1.0000000000e+00; /* 0x3F800000 */
 
#ifdef __STDC__
static const float zero = 0.0000000000e+00;
#else
static float zero = 0.0000000000e+00;
#endif
 
#ifdef __STDC__
float __ieee754_jnf(int n, float x)
#else
float __ieee754_jnf(n,x)
int n; float x;
#endif
{
int32_t i,hx,ix, sgn;
float a, b, temp, di;
float z, w;
 
/* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x)
* Thus, J(-n,x) = J(n,-x)
*/
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
/* if J(n,NaN) is NaN */
if(ix>0x7f800000) return x+x;
if(n<0){
n = -n;
x = -x;
hx ^= 0x80000000;
}
if(n==0) return(__ieee754_j0f(x));
if(n==1) return(__ieee754_j1f(x));
sgn = (n&1)&(hx>>31); /* even n -- 0, odd n -- sign(x) */
x = fabsf(x);
if(ix==0||ix>=0x7f800000) /* if x is 0 or inf */
b = zero;
else if((float)n<=x) {
/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
a = __ieee754_j0f(x);
b = __ieee754_j1f(x);
for(i=1;i<n;i++){
temp = b;
b = b*((float)(i+i)/x) - a; /* avoid underflow */
a = temp;
}
} else {
if(ix<0x30800000) { /* x < 2**-29 */
/* x is tiny, return the first Taylor expansion of J(n,x)
* J(n,x) = 1/n!*(x/2)^n - ...
*/
if(n>33) /* underflow */
b = zero;
else {
temp = x*(float)0.5; b = temp;
for (a=one,i=2;i<=n;i++) {
a *= (float)i; /* a = n! */
b *= temp; /* b = (x/2)^n */
}
b = b/a;
}
} else {
/* use backward recurrence */
/* x x^2 x^2
* J(n,x)/J(n-1,x) = ---- ------ ------ .....
* 2n - 2(n+1) - 2(n+2)
*
* 1 1 1
* (for large x) = ---- ------ ------ .....
* 2n 2(n+1) 2(n+2)
* -- - ------ - ------ -
* x x x
*
* Let w = 2n/x and h=2/x, then the above quotient
* is equal to the continued fraction:
* 1
* = -----------------------
* 1
* w - -----------------
* 1
* w+h - ---------
* w+2h - ...
*
* To determine how many terms needed, let
* Q(0) = w, Q(1) = w(w+h) - 1,
* Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
* When Q(k) > 1e4 good for single
* When Q(k) > 1e9 good for double
* When Q(k) > 1e17 good for quadruple
*/
/* determine k */
float t,v;
float q0,q1,h,tmp; int32_t k,m;
w = (n+n)/(float)x; h = (float)2.0/(float)x;
q0 = w; z = w+h; q1 = w*z - (float)1.0; k=1;
while(q1<(float)1.0e9) {
k += 1; z += h;
tmp = z*q1 - q0;
q0 = q1;
q1 = tmp;
}
m = n+n;
for(t=zero, i = 2*(n+k); i>=m; i -= 2) t = one/(i/x-t);
a = t;
b = one;
/* estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
* Hence, if n*(log(2n/x)) > ...
* single 8.8722839355e+01
* double 7.09782712893383973096e+02
* long double 1.1356523406294143949491931077970765006170e+04
* then recurrent value may overflow and the result is
* likely underflow to zero
*/
tmp = n;
v = two/x;
tmp = tmp*__ieee754_logf(fabsf(v*tmp));
if(tmp<(float)8.8721679688e+01) {
for(i=n-1,di=(float)(i+i);i>0;i--){
temp = b;
b *= di;
b = b/x - a;
a = temp;
di -= two;
}
} else {
for(i=n-1,di=(float)(i+i);i>0;i--){
temp = b;
b *= di;
b = b/x - a;
a = temp;
di -= two;
/* scale b to avoid spurious overflow */
if(b>(float)1e10) {
a /= b;
t /= b;
b = one;
}
}
}
b = (t*__ieee754_j0f(x)/b);
}
}
if(sgn==1) return -b; else return b;
}
 
#ifdef __STDC__
float __ieee754_ynf(int n, float x)
#else
float __ieee754_ynf(n,x)
int n; float x;
#endif
{
int32_t i,hx,ix,ib;
int32_t sign;
float a, b, temp;
 
GET_FLOAT_WORD(hx,x);
ix = 0x7fffffff&hx;
/* if Y(n,NaN) is NaN */
if(ix>0x7f800000) return x+x;
if(ix==0) return -one/zero;
if(hx<0) return zero/zero;
sign = 1;
if(n<0){
n = -n;
sign = 1 - ((n&1)<<1);
}
if(n==0) return(__ieee754_y0f(x));
if(n==1) return(sign*__ieee754_y1f(x));
if(ix==0x7f800000) return zero;
 
a = __ieee754_y0f(x);
b = __ieee754_y1f(x);
/* quit if b is -inf */
GET_FLOAT_WORD(ib,b);
for(i=1;i<n&&ib!=0xff800000;i++){
temp = b;
b = ((float)(i+i)/x)*b - a;
GET_FLOAT_WORD(ib,b);
a = temp;
}
if(sign>0) return b; else return -b;
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_asinf.c
0,0 → 1,48
/* w_asinf.c -- float version of w_asin.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_asinf.c,v 1.2 1995/05/30 05:50:42 rgrimes Exp $";
#endif
 
/*
* wrapper asinf(x)
*/
 
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
float asinf(float x) /* wrapper asinf */
#else
float asinf(x) /* wrapper asinf */
float x;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_asinf(x);
#else
float z;
z = __ieee754_asinf(x);
if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z;
if(fabsf(x)>(float)1.0) {
/* asinf(|x|>1) */
return (float)__kernel_standard((double)x,(double)x,102);
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_fmod.c
0,0 → 1,140
/* @(#)e_fmod.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_fmod.c,v 1.2.6.1 1997/02/23 11:03:03 joerg Exp $";
#endif
 
/*
* __ieee754_fmod(x,y)
* Return x mod y in exact arithmetic
* Method: shift and subtract
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double one = 1.0, Zero[] = {0.0, -0.0,};
#else
static double one = 1.0, Zero[] = {0.0, -0.0,};
#endif
 
#ifdef __STDC__
double __generic___ieee754_fmod(double x, double y)
#else
double __generic___ieee754_fmod(x,y)
double x,y ;
#endif
{
int32_t n,hx,hy,hz,ix,iy,sx,i;
u_int32_t lx,ly,lz;
 
EXTRACT_WORDS(hx,lx,x);
EXTRACT_WORDS(hy,ly,y);
sx = hx&0x80000000; /* sign of x */
hx ^=sx; /* |x| */
hy &= 0x7fffffff; /* |y| */
 
/* purge off exception values */
if((hy|ly)==0||(hx>=0x7ff00000)|| /* y=0,or x not finite */
((hy|((ly|-ly)>>31))>0x7ff00000)) /* or y is NaN */
return (x*y)/(x*y);
if(hx<=hy) {
if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
if(lx==ly)
return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/
}
 
/* determine ix = ilogb(x) */
if(hx<0x00100000) { /* subnormal x */
if(hx==0) {
for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
} else {
for (ix = -1022,i=(hx<<11); i>0; i<<=1) ix -=1;
}
} else ix = (hx>>20)-1023;
 
/* determine iy = ilogb(y) */
if(hy<0x00100000) { /* subnormal y */
if(hy==0) {
for (iy = -1043, i=ly; i>0; i<<=1) iy -=1;
} else {
for (iy = -1022,i=(hy<<11); i>0; i<<=1) iy -=1;
}
} else iy = (hy>>20)-1023;
 
/* set up {hx,lx}, {hy,ly} and align y to x */
if(ix >= -1022)
hx = 0x00100000|(0x000fffff&hx);
else { /* subnormal x, shift x to normal */
n = -1022-ix;
if(n<=31) {
hx = (hx<<n)|(lx>>(32-n));
lx <<= n;
} else {
hx = lx<<(n-32);
lx = 0;
}
}
if(iy >= -1022)
hy = 0x00100000|(0x000fffff&hy);
else { /* subnormal y, shift y to normal */
n = -1022-iy;
if(n<=31) {
hy = (hy<<n)|(ly>>(32-n));
ly <<= n;
} else {
hy = ly<<(n-32);
ly = 0;
}
}
 
/* fix point fmod */
n = ix - iy;
while(n--) {
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz<0){hx = hx+hx+(lx>>31); lx = lx+lx;}
else {
if((hz|lz)==0) /* return sign(x)*0 */
return Zero[(u_int32_t)sx>>31];
hx = hz+hz+(lz>>31); lx = lz+lz;
}
}
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz>=0) {hx=hz;lx=lz;}
 
/* convert back to floating value and restore the sign */
if((hx|lx)==0) /* return sign(x)*0 */
return Zero[(u_int32_t)sx>>31];
while(hx<0x00100000) { /* normalize x */
hx = hx+hx+(lx>>31); lx = lx+lx;
iy -= 1;
}
if(iy>= -1022) { /* normalize output */
hx = ((hx-0x00100000)|((iy+1023)<<20));
INSERT_WORDS(x,hx|sx,lx);
} else { /* subnormal output */
n = -1022 - iy;
if(n<=20) {
lx = (lx>>n)|((u_int32_t)hx<<(32-n));
hx >>= n;
} else if (n<=31) {
lx = (hx<<(32-n))|(lx>>n); hx = sx;
} else {
lx = hx>>(n-32); hx = sx;
}
INSERT_WORDS(x,hx|sx,lx);
x *= one; /* create necessary signal */
}
return x; /* exact output */
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_asinhf.c
0,0 → 1,57
/* s_asinhf.c -- float version of s_asinh.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_asinhf.c,v 1.2 1995/05/30 05:49:19 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float
#else
static float
#endif
one = 1.0000000000e+00, /* 0x3F800000 */
ln2 = 6.9314718246e-01, /* 0x3f317218 */
huge= 1.0000000000e+30;
 
#ifdef __STDC__
float asinhf(float x)
#else
float asinhf(x)
float x;
#endif
{
float t,w;
int32_t hx,ix;
GET_FLOAT_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7f800000) return x+x; /* x is inf or NaN */
if(ix< 0x31800000) { /* |x|<2**-28 */
if(huge+x>one) return x; /* return x inexact except 0 */
}
if(ix>0x4d800000) { /* |x| > 2**28 */
w = __ieee754_logf(fabsf(x))+ln2;
} else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */
t = fabsf(x);
w = __ieee754_logf((float)2.0*t+one/(sqrtf(x*x+one)+t));
} else { /* 2.0 > |x| > 2**-28 */
t = x*x;
w =log1pf(fabsf(x)+t/(one+sqrtf(one+t)));
}
if(hx>0) return w; else return -w;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_atanh.c
0,0 → 1,74
/* @(#)e_atanh.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_atanh.c,v 1.2 1995/05/30 05:48:01 rgrimes Exp $";
#endif
 
/* __ieee754_atanh(x)
* Method :
* 1.Reduced x to positive by atanh(-x) = -atanh(x)
* 2.For x>=0.5
* 1 2x x
* atanh(x) = --- * log(1 + -------) = 0.5 * log1p(2 * --------)
* 2 1 - x 1 - x
*
* For x<0.5
* atanh(x) = 0.5*log1p(2x+2x*x/(1-x))
*
* Special cases:
* atanh(x) is NaN if |x| > 1 with signal;
* atanh(NaN) is that NaN with no signal;
* atanh(+-1) is +-INF with signal.
*
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double one = 1.0, huge = 1e300;
#else
static double one = 1.0, huge = 1e300;
#endif
 
#ifdef __STDC__
static const double zero = 0.0;
#else
static double zero = 0.0;
#endif
 
#ifdef __STDC__
double __ieee754_atanh(double x)
#else
double __ieee754_atanh(x)
double x;
#endif
{
double t;
int32_t hx,ix;
u_int32_t lx;
EXTRACT_WORDS(hx,lx,x);
ix = hx&0x7fffffff;
if ((ix|((lx|(-lx))>>31))>0x3ff00000) /* |x|>1 */
return (x-x)/(x-x);
if(ix==0x3ff00000)
return x/zero;
if(ix<0x3e300000&&(huge+x)>zero) return x; /* x<2**-28 */
SET_HIGH_WORD(x,ix);
if(ix<0x3fe00000) { /* x < 0.5 */
t = x+x;
t = 0.5*log1p(t+t*x/(one-x));
} else
t = 0.5*log1p((x+x)/(one-x));
if(hx>=0) return t; else return -t;
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_sqrtf.c
0,0 → 1,97
/* e_sqrtf.c -- float version of e_sqrt.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_sqrtf.c,v 1.2 1995/05/30 05:48:52 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float one = 1.0, tiny=1.0e-30;
#else
static float one = 1.0, tiny=1.0e-30;
#endif
 
#ifdef __STDC__
float __ieee754_sqrtf(float x)
#else
float __ieee754_sqrtf(x)
float x;
#endif
{
float z;
int32_t sign = (int)0x80000000;
int32_t ix,s,q,m,t,i;
u_int32_t r;
 
GET_FLOAT_WORD(ix,x);
 
/* take care of Inf and NaN */
if((ix&0x7f800000)==0x7f800000) {
return x*x+x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf
sqrt(-inf)=sNaN */
}
/* take care of zero */
if(ix<=0) {
if((ix&(~sign))==0) return x;/* sqrt(+-0) = +-0 */
else if(ix<0)
return (x-x)/(x-x); /* sqrt(-ve) = sNaN */
}
/* normalize x */
m = (ix>>23);
if(m==0) { /* subnormal x */
for(i=0;(ix&0x00800000)==0;i++) ix<<=1;
m -= i-1;
}
m -= 127; /* unbias exponent */
ix = (ix&0x007fffff)|0x00800000;
if(m&1) /* odd m, double x to make it even */
ix += ix;
m >>= 1; /* m = [m/2] */
 
/* generate sqrt(x) bit by bit */
ix += ix;
q = s = 0; /* q = sqrt(x) */
r = 0x01000000; /* r = moving bit from right to left */
 
while(r!=0) {
t = s+r;
if(t<=ix) {
s = t+r;
ix -= t;
q += r;
}
ix += ix;
r>>=1;
}
 
/* use floating add to find out rounding direction */
if(ix!=0) {
z = one-tiny; /* trigger inexact flag */
if (z>=one) {
z = one+tiny;
if (z>one)
q += 2;
else
q += (q&1);
}
}
ix = (q>>1)+0x3f000000;
ix += (m <<23);
SET_FLOAT_WORD(z,ix);
return z;
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_j0f.c
0,0 → 1,45
/* w_j0f.c -- float version of w_j0.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_j0f.c,v 1.2.6.1 1997/03/03 14:21:05 bde Exp $";
#endif
 
/*
* wrapper j0f(float x)
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
float j0f(float x) /* wrapper j0f */
#else
float j0f(x) /* wrapper j0f */
float x;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_j0f(x);
#else
float z = __ieee754_j0f(x);
if(_LIB_VERSION == _IEEE_ || isnanf(x)) return z;
if(fabsf(x)>(float)X_TLOSS) {
/* j0f(|x|>X_TLOSS) */
return (float)__kernel_standard((double)x,(double)x,134);
} else
return z;
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_lgam2.c
0,0 → 1,39
/* e_lgammaf.c -- float version of e_lgamma.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_lgammaf.c,v 1.2 1995/05/30 05:48:28 rgrimes Exp $";
#endif
 
/* __ieee754_lgammaf(x)
* Return the logarithm of the Gamma function of x.
*
* Method: call __ieee754_lgammaf_r
*/
 
#include "math.h"
#include "math_private.h"
 
extern int signgam;
 
#ifdef __STDC__
float __ieee754_lgammaf(float x)
#else
float __ieee754_lgammaf(x)
float x;
#endif
{
return __ieee754_lgammaf_r(x,&signgam);
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_modf.c
0,0 → 1,83
/* @(#)s_modf.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_modf.c,v 1.2 1995/05/30 05:50:04 rgrimes Exp $";
#endif
 
/*
* modf(double x, double *iptr)
* return fraction part of x, and return x's integral part in *iptr.
* Method:
* Bit twiddling.
*
* Exception:
* No exception.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const double one = 1.0;
#else
static double one = 1.0;
#endif
 
#ifdef __STDC__
double modf(double x, double *iptr)
#else
double modf(x, iptr)
double x,*iptr;
#endif
{
int32_t i0,i1,j0;
u_int32_t i;
EXTRACT_WORDS(i0,i1,x);
j0 = ((i0>>20)&0x7ff)-0x3ff; /* exponent of x */
if(j0<20) { /* integer part in high x */
if(j0<0) { /* |x|<1 */
INSERT_WORDS(*iptr,i0&0x80000000,0); /* *iptr = +-0 */
return x;
} else {
i = (0x000fffff)>>j0;
if(((i0&i)|i1)==0) { /* x is integral */
u_int32_t high;
*iptr = x;
GET_HIGH_WORD(high,x);
INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
return x;
} else {
INSERT_WORDS(*iptr,i0&(~i),0);
return x - *iptr;
}
}
} else if (j0>51) { /* no fraction part */
u_int32_t high;
*iptr = x*one;
GET_HIGH_WORD(high,x);
INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
return x;
} else { /* fraction part in low x */
i = ((u_int32_t)(0xffffffff))>>(j0-20);
if((i1&i)==0) { /* x is integral */
u_int32_t high;
*iptr = x;
GET_HIGH_WORD(high,x);
INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
return x;
} else {
INSERT_WORDS(*iptr,i0,i1&(~i));
return x - *iptr;
}
}
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_rem2.c
0,0 → 1,73
/* e_remainderf.c -- float version of e_remainder.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_remainderf.c,v 1.2 1995/05/30 05:48:40 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static const float zero = 0.0;
#else
static float zero = 0.0;
#endif
 
 
#ifdef __STDC__
float __ieee754_remainderf(float x, float p)
#else
float __ieee754_remainderf(x,p)
float x,p;
#endif
{
int32_t hx,hp;
u_int32_t sx;
float p_half;
 
GET_FLOAT_WORD(hx,x);
GET_FLOAT_WORD(hp,p);
sx = hx&0x80000000;
hp &= 0x7fffffff;
hx &= 0x7fffffff;
 
/* purge off exception values */
if(hp==0) return (x*p)/(x*p); /* p = 0 */
if((hx>=0x7f800000)|| /* x not finite */
((hp>0x7f800000))) /* p is NaN */
return (x*p)/(x*p);
 
 
if (hp<=0x7effffff) x = __ieee754_fmodf(x,p+p); /* now x < 2p */
if ((hx-hp)==0) return zero*x;
x = fabsf(x);
p = fabsf(p);
if (hp<0x01000000) {
if(x+x>p) {
x-=p;
if(x+x>=p) x -= p;
}
} else {
p_half = (float)0.5*p;
if(x>p_half) {
x-=p;
if(x>=p_half) x -= p;
}
}
GET_FLOAT_WORD(hx,x);
SET_FLOAT_WORD(x,hx^sx);
return x;
}
/shark/trunk/libc/arch/x86/libm/msun/src/s_cbrt.c
0,0 → 1,93
/* @(#)s_cbrt.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: s_cbrt.c,v 1.2 1995/05/30 05:49:22 rgrimes Exp $";
#endif
 
#include "math.h"
#include "math_private.h"
 
/* cbrt(x)
* Return cube root of x
*/
#ifdef __STDC__
static const u_int32_t
#else
static u_int32_t
#endif
B1 = 715094163, /* B1 = (682-0.03306235651)*2**20 */
B2 = 696219795; /* B2 = (664-0.03306235651)*2**20 */
 
#ifdef __STDC__
static const double
#else
static double
#endif
C = 5.42857142857142815906e-01, /* 19/35 = 0x3FE15F15, 0xF15F15F1 */
D = -7.05306122448979611050e-01, /* -864/1225 = 0xBFE691DE, 0x2532C834 */
E = 1.41428571428571436819e+00, /* 99/70 = 0x3FF6A0EA, 0x0EA0EA0F */
F = 1.60714285714285720630e+00, /* 45/28 = 0x3FF9B6DB, 0x6DB6DB6E */
G = 3.57142857142857150787e-01; /* 5/14 = 0x3FD6DB6D, 0xB6DB6DB7 */
 
#ifdef __STDC__
double cbrt(double x)
#else
double cbrt(x)
double x;
#endif
{
int32_t hx;
double r,s,t=0.0,w;
u_int32_t sign;
u_int32_t high,low;
 
GET_HIGH_WORD(hx,x);
sign=hx&0x80000000; /* sign= sign(x) */
hx ^=sign;
if(hx>=0x7ff00000) return(x+x); /* cbrt(NaN,INF) is itself */
GET_LOW_WORD(low,x);
if((hx|low)==0)
return(x); /* cbrt(0) is itself */
 
SET_HIGH_WORD(x,hx); /* x <- |x| */
/* rough cbrt to 5 bits */
if(hx<0x00100000) /* subnormal number */
{SET_HIGH_WORD(t,0x43500000); /* set t= 2**54 */
t*=x; GET_HIGH_WORD(high,t); SET_HIGH_WORD(t,high/3+B2);
}
else
SET_HIGH_WORD(t,hx/3+B1);
 
 
/* new cbrt to 23 bits, may be implemented in single precision */
r=t*t/x;
s=C+r*t;
t*=G+F/(s+E+D/s);
 
/* chopped to 20 bits and make it larger than cbrt(x) */
GET_HIGH_WORD(high,t);
INSERT_WORDS(t,high+0x00000001,0);
 
 
/* one step newton iteration to 53 bits with error less than 0.667 ulps */
s=t*t; /* t*t is exact */
r=x/s;
w=t+t;
r=(r-t)/(w+r); /* r-s is exact */
t=t+t*r;
 
/* retore the sign bit */
GET_HIGH_WORD(high,t);
SET_HIGH_WORD(t,high|sign);
return(t);
}
/shark/trunk/libc/arch/x86/libm/msun/src/w_logf.c
0,0 → 1,48
/* w_logf.c -- float version of w_log.c.
* Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
*/
 
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: w_logf.c,v 1.2 1995/05/30 05:51:36 rgrimes Exp $";
#endif
 
/*
* wrapper logf(x)
*/
 
#include "math.h"
#include "math_private.h"
 
 
#ifdef __STDC__
float logf(float x) /* wrapper logf */
#else
float logf(x) /* wrapper logf */
float x;
#endif
{
#ifdef _IEEE_LIBM
return __ieee754_logf(x);
#else
float z;
z = __ieee754_logf(x);
if(_LIB_VERSION == _IEEE_ || isnanf(x) || x > (float)0.0) return z;
if(x==(float)0.0)
/* logf(0) */
return (float)__kernel_standard((double)x,(double)x,116);
else
/* logf(x<0) */
return (float)__kernel_standard((double)x,(double)x,117);
#endif
}
/shark/trunk/libc/arch/x86/libm/msun/src/e_j1.c
0,0 → 1,486
/* @(#)e_j1.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
 
#ifndef lint
static char rcsid[] = "$\Id: e_j1.c,v 1.2 1995/05/30 05:48:20 rgrimes Exp $";
#endif
 
/* __ieee754_j1(x), __ieee754_y1(x)
* Bessel function of the first and second kinds of order zero.
* Method -- j1(x):
* 1. For tiny x, we use j1(x) = x/2 - x^3/16 + x^5/384 - ...
* 2. Reduce x to |x| since j1(x)=-j1(-x), and
* for x in (0,2)
* j1(x) = x/2 + x*z*R0/S0, where z = x*x;
* (precision: |j1/x - 1/2 - R0/S0 |<2**-61.51 )
* for x in (2,inf)
* j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
* where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
* as follow:
* cos(x1) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
* = 1/sqrt(2) * (sin(x) - cos(x))
* sin(x1) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
* = -1/sqrt(2) * (sin(x) + cos(x))
* (To avoid cancellation, use
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.)
*
* 3 Special cases
* j1(nan)= nan
* j1(0) = 0
* j1(inf) = 0
*
* Method -- y1(x):
* 1. screen out x<=0 cases: y1(0)=-inf, y1(x<0)=NaN
* 2. For x<2.
* Since
* y1(x) = 2/pi*(j1(x)*(ln(x/2)+Euler)-1/x-x/2+5/64*x^3-...)
* therefore y1(x)-2/pi*j1(x)*ln(x)-1/x is an odd function.
* We use the following function to approximate y1,
* y1(x) = x*U(z)/V(z) + (2/pi)*(j1(x)*ln(x)-1/x), z= x^2
* where for x in [0,2] (abs err less than 2**-65.89)
* U(z) = U0[0] + U0[1]*z + ... + U0[4]*z^4
* V(z) = 1 + v0[0]*z + ... + v0[4]*z^5
* Note: For tiny x, 1/x dominate y1 and hence
* y1(tiny) = -2/pi/tiny, (choose tiny<2**-54)
* 3. For x>=2.
* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x1)+q1(x)*cos(x1))
* where x1 = x-3*pi/4. It is better to compute sin(x1),cos(x1)
* by method mentioned above.
*/
 
#include "math.h"
#include "math_private.h"
 
#ifdef __STDC__
static double pone(double), qone(double);
#else
static double pone(), qone();
#endif
 
#ifdef __STDC__
static const double
#else
static double
#endif
huge = 1e300,
one = 1.0,
invsqrtpi= 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
tpi = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
/* R0/S0 on [0,2] */
r00 = -6.25000000000000000000e-02, /* 0xBFB00000, 0x00000000 */
r01 = 1.40705666955189706048e-03, /* 0x3F570D9F, 0x98472C61 */
r02 = -1.59955631084035597520e-05, /* 0xBEF0C5C6, 0xBA169668 */
r03 = 4.96727999609584448412e-08, /* 0x3E6AAAFA, 0x46CA0BD9 */
s01 = 1.91537599538363460805e-02, /* 0x3F939D0B, 0x12637E53 */
s02 = 1.85946785588630915560e-04, /* 0x3F285F56, 0xB9CDF664 */
s03 = 1.17718464042623683263e-06, /* 0x3EB3BFF8, 0x333F8498 */
s04 = 5.04636257076217042715e-09, /* 0x3E35AC88, 0xC97DFF2C */
s05 = 1.23542274426137913908e-11; /* 0x3DAB2ACF, 0xCFB97ED8 */
 
#ifdef __STDC__
static const double zero = 0.0;
#else
static double zero = 0.0;
#endif
 
#ifdef __STDC__
double __ieee754_j1(double x)
#else
double __ieee754_j1(x)
double x;
#endif
{
double z, s,c,ss,cc,r,u,v,y;
int32_t hx,ix;
 
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) return one/x;
y = fabs(x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
s = sin(y);
c = cos(y);
ss = -s-c;
cc = s-c;
if(ix<0x7fe00000) { /* make sure y+y not overflow */
z = cos(y+y);
if ((s*c)>zero) cc = z/ss;
else ss = z/cc;
}
/*
* j1(x) = 1/sqrt(pi) * (P(1,x)*cc - Q(1,x)*ss) / sqrt(x)
* y1(x) = 1/sqrt(pi) * (P(1,x)*ss + Q(1,x)*cc) / sqrt(x)
*/
if(ix>0x48000000) z = (invsqrtpi*cc)/sqrt(y);
else {
u = pone(y); v = qone(y);
z = invsqrtpi*(u*cc-v*ss)/sqrt(y);
}
if(hx<0) return -z;
else return z;
}
if(ix<0x3e400000) { /* |x|<2**-27 */
if(huge+x>one) return 0.5*x;/* inexact if x!=0 necessary */
}
z = x*x;
r = z*(r00+z*(r01+z*(r02+z*r03)));
s = one+z*(s01+z*(s02+z*(s03+z*(s04+z*s05))));
r *= x;
return(x*0.5+r/s);
}
 
#ifdef __STDC__
static const double U0[5] = {
#else
static double U0[5] = {
#endif
-1.96057090646238940668e-01, /* 0xBFC91866, 0x143CBC8A */
5.04438716639811282616e-02, /* 0x3FA9D3C7, 0x76292CD1 */
-1.91256895875763547298e-03, /* 0xBF5F55E5, 0x4844F50F */
2.35252600561610495928e-05, /* 0x3EF8AB03, 0x8FA6B88E */
-9.19099158039878874504e-08, /* 0xBE78AC00, 0x569105B8 */
};
#ifdef __STDC__
static const double V0[5] = {
#else
static double V0[5] = {
#endif
1.99167318236649903973e-02, /* 0x3F94650D, 0x3F4DA9F0 */
2.02552581025135171496e-04, /* 0x3F2A8C89, 0x6C257764 */
1.35608801097516229404e-06, /* 0x3EB6C05A, 0x894E8CA6 */
6.22741452364621501295e-09, /* 0x3E3ABF1D, 0x5BA69A86 */
1.66559246207992079114e-11, /* 0x3DB25039, 0xDACA772A */
};
 
#ifdef __STDC__
double __ieee754_y1(double x)
#else
double __ieee754_y1(x)
double x;
#endif
{
double z, s,c,ss,cc,u,v;
int32_t hx,ix,lx;
 
EXTRACT_WORDS(hx,lx,x);
ix = 0x7fffffff&hx;
/* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
if(ix>=0x7ff00000) return one/(x+x*x);
if((ix|lx)==0) return -one/zero;
if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
s = sin(x);
c = cos(x);
ss = -s-c;
cc = s-c;
if(ix<0x7fe00000) { /* make sure x+x not overflow */
z = cos(x+x);
if ((s*c)>zero) cc = z/ss;
else ss = z/cc;
}
/* y1(x) = sqrt(2/(pi*x))*(p1(x)*sin(x0)+q1(x)*cos(x0))
* where x0 = x-3pi/4
* Better formula:
* cos(x0) = cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
* = 1/sqrt(2) * (sin(x) - cos(x))
* sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
* = -1/sqrt(2) * (cos(x) + sin(x))
* To avoid cancellation, use
* sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
* to compute the worse one.
*/
if(ix>0x48000000) z = (invsqrtpi*ss)/sqrt(x);
else {
u = pone(x); v = qone(x);
z = invsqrtpi*(u*ss+v*cc)/sqrt(x);
}
return z;
}
if(ix<=0x3c900000) { /* x < 2**-54 */
return(-tpi/x);
}
z = x*x;
u = U0[0]+z*(U0[1]+z*(U0[2]+z*(U0[3]+z*U0[4])));
v = one+z*(V0[0]+z*(V0[1]+z*(V0[2]+z*(V0[3]+z*V0[4]))));
return(x*(u/v) + tpi*(__ieee754_j1(x)*__ieee754_log(x)-one/x));
}
 
/* For x >= 8, the asymptotic expansions of pone is
* 1 + 15/128 s^2 - 4725/2^15 s^4 - ..., where s = 1/x.
* We approximate pone by
* pone(x) = 1 + (R/S)
* where R = pr0 + pr1*s^2 + pr2*s^4 + ... + pr5*s^10
* S = 1 + ps0*s^2 + ... + ps4*s^10
* and
* | pone(x)-1-R/S | <= 2 ** ( -60.06)
*/
 
#ifdef __STDC__
static const double pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#else
static double pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#endif
0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
1.17187499999988647970e-01, /* 0x3FBDFFFF, 0xFFFFFCCE */
1.32394806593073575129e+01, /* 0x402A7A9D, 0x357F7FCE */
4.12051854307378562225e+02, /* 0x4079C0D4, 0x652EA590 */
3.87474538913960532227e+03, /* 0x40AE457D, 0xA3A532CC */
7.91447954031891731574e+03, /* 0x40BEEA7A, 0xC32782DD */
};
#ifdef __STDC__
static const double ps8[5] = {
#else
static double ps8[5] = {
#endif
1.14207370375678408436e+02, /* 0x405C8D45, 0x8E656CAC */
3.65093083420853463394e+03, /* 0x40AC85DC, 0x964D274F */
3.69562060269033463555e+04, /* 0x40E20B86, 0x97C5BB7F */
9.76027935934950801311e+04, /* 0x40F7D42C, 0xB28F17BB */
3.08042720627888811578e+04, /* 0x40DE1511, 0x697A0B2D */
};
 
#ifdef __STDC__
static const double pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#else
static double pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#endif
1.31990519556243522749e-11, /* 0x3DAD0667, 0xDAE1CA7D */
1.17187493190614097638e-01, /* 0x3FBDFFFF, 0xE2C10043 */
6.80275127868432871736e+00, /* 0x401B3604, 0x6E6315E3 */
1.08308182990189109773e+02, /* 0x405B13B9, 0x452602ED */
5.17636139533199752805e+02, /* 0x40802D16, 0xD052D649 */
5.28715201363337541807e+02, /* 0x408085B8, 0xBB7E0CB7 */
};
#ifdef __STDC__
static const double ps5[5] = {
#else
static double ps5[5] = {
#endif
5.92805987221131331921e+01, /* 0x404DA3EA, 0xA8AF633D */
9.91401418733614377743e+02, /* 0x408EFB36, 0x1B066701 */
5.35326695291487976647e+03, /* 0x40B4E944, 0x5706B6FB */
7.84469031749551231769e+03, /* 0x40BEA4B0, 0xB8A5BB15 */
1.50404688810361062679e+03, /* 0x40978030, 0x036F5E51 */
};
 
#ifdef __STDC__
static const double pr3[6] = {
#else
static double pr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
#endif
3.02503916137373618024e-09, /* 0x3E29FC21, 0xA7AD9EDD */
1.17186865567253592491e-01, /* 0x3FBDFFF5, 0x5B21D17B */
3.93297750033315640650e+00, /* 0x400F76BC, 0xE85EAD8A */
3.51194035591636932736e+01, /* 0x40418F48, 0x9DA6D129 */
9.10550110750781271918e+01, /* 0x4056C385, 0x4D2C1837 */
4.85590685197364919645e+01, /* 0x4048478F, 0x8EA83EE5 */
};
#ifdef __STDC__
static const double ps3[5] = {
#else
static double ps3[5] = {
#endif
3.47913095001251519989e+01, /* 0x40416549, 0xA134069C */
3.36762458747825746741e+02, /* 0x40750C33, 0x07F1A75F */
1.04687139975775130551e+03, /* 0x40905B7C, 0x5037D523 */
8.90811346398256432622e+02, /* 0x408BD67D, 0xA32E31E9 */
1.03787932439639277504e+02, /* 0x4059F26D, 0x7C2EED53 */
};
 
#ifdef __STDC__
static const double pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#else
static double pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
#endif
1.07710830106873743082e-07, /* 0x3E7CE9D4, 0xF65544F4 */
1.17176219462683348094e-01, /* 0x3FBDFF42, 0xBE760D83 */
2.36851496667608785174e+00, /* 0x4002F2B7, 0xF98FAEC0 */
1.22426109148261232917e+01, /* 0x40287C37, 0x7F71A964 */
1.76939711271687727390e+01, /* 0x4031B1A8, 0x177F8EE2 */
5.07352312588818499250e+00, /* 0x40144B49, 0xA574C1FE */
};
#ifdef __STDC__
static const double ps2[5] = {
#else
static double ps2[5] = {
#endif
2.14364859363821409488e+01, /* 0x40356FBD, 0x8AD5ECDC */
1.25290227168402751090e+02, /* 0x405F5293, 0x14F92CD5 */
2.32276469057162813669e+02, /* 0x406D08D8, 0xD5A2DBD9 */
1.17679373287147100768e+02, /* 0x405D6B7A, 0xDA1884A9 */
8.36463893371618283368e+00, /* 0x4020BAB1, 0xF44E5192 */
};
 
#ifdef __STDC__
static double pone(double x)
#else
static double pone(x)
double x;
#endif
{
#ifdef __STDC__
const double *p,*q;
#else
double *p,*q;
#endif
double z,r,s;
int32_t ix;
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
if(ix>=0x40200000) {p = pr8; q= ps8;}
else if(ix>=0x40122E8B){p = pr5; q= ps5;}
else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
else if(ix>=0x40000000){p = pr2; q= ps2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
return one+ r/s;
}
 
 
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
* We approximate pone by
* qone(x) = s*(0.375 + (R/S))
* where R = qr1*s^2 + qr2*s^4 + ... + qr5*s^10
* S = 1 + qs1*s^2 + ... + qs6*s^12
* and
* | qone(x)/s -0.375-R/S | <= 2 ** ( -61.13)
*/
 
#ifdef __STDC__
static const double qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#else
static double qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
#endif
0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
-1.02539062499992714161e-01, /* 0xBFBA3FFF, 0xFFFFFDF3 */
-1.62717534544589987888e+01, /* 0xC0304591, 0xA26779F7 */
-7.59601722513950107896e+02, /* 0xC087BCD0, 0x53E4B576 */
-1.18498066702429587167e+04, /* 0xC0C724E7, 0x40F87415 */
-4.84385124285750353010e+04, /* 0xC0E7A6D0, 0x65D09C6A */
};
#ifdef __STDC__
static const double qs8[6] = {
#else
static double qs8[6] = {
#endif
1.61395369700722909556e+02, /* 0x40642CA6, 0xDE5BCDE5 */
7.82538599923348465381e+03, /* 0x40BE9162, 0xD0D88419 */
1.33875336287249578163e+05, /* 0x4100579A, 0xB0B75E98 */
7.19657723683240939863e+05, /* 0x4125F653, 0x72869C19 */
6.66601232617776375264e+05, /* 0x412457D2, 0x7719AD5C */
-2.94490264303834643215e+05, /* 0xC111F969, 0x0EA5AA18 */
};
 
#ifdef __STDC__
static const double qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#else
static double qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
#endif
-2.08979931141764104297e-11, /* 0xBDB6FA43, 0x1AA1A098 */
-1.02539050241375426231e-01, /* 0xBFBA3FFF, 0xCB597FEF */
-8.05644828123936029840e+00, /* 0xC0201CE6, 0xCA03AD4B */
-1.83669607474888380239e+02, /* 0xC066F56D, 0x6CA7B9B0 */
-1.37319376065508163265e+03, /* 0xC09574C6, 0x6931734F */
-2.61244440453215656817e+03, /* 0xC0A468E3, 0x88FDA79D */
};
#ifdef __STDC__
static const double qs5[6] = {
#else
static double qs5[6] = {
#endif
8.12765501384335777857e+01, /* 0x405451B2, 0xFF5A11B2 */
1.99179873460485964642e+03, /* 0x409F1F31, 0xE77BF839 */
1.74684851924908907677e+04, /* 0x40D10F1F, 0x0D64CE29 */
4.98514270910352279316e+04, /* 0x40E8576D, 0xAABAD197 */
2.79480751638918118260e+04, /* 0x40DB4B04, 0xCF7C364B */
-4.71918354795128470869e+03, /* 0xC0B26F2E, 0xFCFFA004 */
};
 
#ifdef __STDC__
static const double qr3[6] = {
#else
static double qr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
#endif
-5.07831226461766561369e-09, /* 0xBE35CFA9, 0xD38FC84F */
-1.02537829820837089745e-01, /* 0xBFBA3FEB, 0x51AEED54 */
-4.61011581139473403113e+00, /* 0xC01270C2, 0x3302D9FF */
-5.78472216562783643212e+01, /* 0xC04CEC71, 0xC25D16DA */
-2.28244540737631695038e+02, /* 0xC06C87D3, 0x4718D55F */
-2.19210128478909325622e+02, /* 0xC06B66B9, 0x5F5C1BF6 */
};
#ifdef __STDC__
static const double qs3[6] = {
#else
static double qs3[6] = {
#endif
4.76651550323729509273e+01, /* 0x4047D523, 0xCCD367E4 */
6.73865112676699709482e+02, /* 0x40850EEB, 0xC031EE3E */
3.38015286679526343505e+03, /* 0x40AA684E, 0x448E7C9A */
5.54772909720722782367e+03, /* 0x40B5ABBA, 0xA61D54A6 */
1.90311919338810798763e+03, /* 0x409DBC7A, 0x0DD4DF4B */
-1.35201191444307340817e+02, /* 0xC060E670, 0x290A311F */
};
 
#ifdef __STDC__
static const