Joren's new library make system (minus Makefiles)

This commit is contained in:
Ben Gras
2006-01-16 15:44:55 +00:00
parent c461b0c63d
commit 34d445c0af
113 changed files with 1500 additions and 4225 deletions

View File

@@ -1,26 +0,0 @@
# Makefile for lib/math.
CFLAGS = -O -D_MINIX -D_POSIX_SOURCE
LIBRARIES = libc
libc_OBJECTS = \
asin.o \
atan.o \
atan2.o \
ceil.o \
exp.o \
fabs.o \
floor.o \
fmod.o \
hugeval.o \
log.o \
log10.o \
pow.o \
sin.o \
sinh.o \
sqrt.o \
tan.o \
tanh.o \
include ../Makefile.inc

26
lib/math/Makefile.in Normal file
View File

@@ -0,0 +1,26 @@
# Makefile for lib/math.
CFLAGS="-O -D_MINIX -D_POSIX_SOURCE"
LIBRARIES=libc
libc_FILES=" \
asin.c \
atan.c \
atan2.c \
ceil.c \
exp.c \
fabs.c \
floor.c \
fmod.c \
hugeval.c \
log.c \
log10.c \
pow.c \
sin.c \
sinh.c \
sqrt.c \
tan.c \
tanh.c"
TYPE=both

View File

@@ -1,35 +0,0 @@
#
.sect .text; .sect .rom; .sect .data; .sect .bss
.extern _frexp
.sect .text
_frexp:
#if __i386
push ebp
mov ebp, esp
push 12(ebp)
push 8(ebp)
mov eax, esp
add eax, -4
push eax
call .fef8
mov eax, 16(ebp)
pop (eax)
pop eax
pop edx
leave
ret
#else /* i86 */
push bp
mov bp, sp
lea bx, 4(bp)
mov cx, #8
call .loi
mov ax, sp
add ax, #-2
push ax
call .fef8
mov bx, 12(bp)
pop (bx)
call .ret8
jmp .cret
#endif

View File

@@ -1,11 +0,0 @@
int __IsNan(double d)
{
#if defined(vax) || defined(pdp)
#else
float f = d;
if ((*((long *) &f) & 0x7f800000) == 0x7f800000 &&
(*((long *) &f) & 0x007fffff) != 0) return 1;
#endif
return 0;
}

View File

@@ -1,55 +0,0 @@
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Header$ */
#include <math.h>
#include <float.h>
#include <errno.h>
double
ldexp(double fl, int exp)
{
int sign = 1;
int currexp;
if (__IsNan(fl)) {
errno = EDOM;
return fl;
}
if (fl == 0.0) return 0.0;
if (fl<0) {
fl = -fl;
sign = -1;
}
if (fl > DBL_MAX) { /* for infinity */
errno = ERANGE;
return sign * fl;
}
fl = frexp(fl,&currexp);
exp += currexp;
if (exp > 0) {
if (exp > DBL_MAX_EXP) {
errno = ERANGE;
return sign * HUGE_VAL;
}
while (exp>30) {
fl *= (double) (1L << 30);
exp -= 30;
}
fl *= (double) (1L << exp);
}
else {
/* number need not be normalized */
if (exp < DBL_MIN_EXP - DBL_MANT_DIG) {
return 0.0;
}
while (exp<-30) {
fl /= (double) (1L << 30);
exp += 30;
}
fl /= (double) (1L << -exp);
}
return sign * fl;
}

View File

@@ -1,49 +0,0 @@
#
.sect .text; .sect .rom; .sect .data; .sect .bss
.extern _modf
.sect .text
_modf:
#if __i386
push ebp
mov ebp, esp
push 12(ebp)
push 8(ebp)
push 1
push 4
call .cif8
mov eax, esp
push eax
call .fif8
pop ecx
mov edx, 16(ebp)
pop ecx
pop ebx
mov 0(edx), ecx
mov 4(edx), ebx
pop eax
pop edx
leave
ret
#else /* i86 */
push bp
mov bp, sp
lea bx, 4(bp)
mov cx, #8
call .loi
mov dx, #1
push dx
push dx
push dx
mov ax, #2
push ax
call .cif8
mov ax, sp
push ax
call .fif8
pop bx
mov bx, 12(bp)
mov cx, #8
call .sti
call .ret8
jmp .cret
#endif