History

20120305-2004

forsyth committed 14 years ago

Commit a602a621 parent 24c2bbd20 files · +142 −116Browse files

Unified · Split

20 files
  1. CHANGES +4 −0
  2. Plan9/include/lib9x.h +20 −0
  3. include/version.h +1 −1
  4. libmath/dtoa.c +7 −2
  5. libmath/fdlibm/fdlibm.h +95 −98
  6. mkfiles/mkfile-Inferno-386 +1 −1
  7. mkfiles/mkfile-Inferno-68000 +1 −1
  8. mkfiles/mkfile-Inferno-arm +1 −1
  9. mkfiles/mkfile-Inferno-mips +1 −1
  10. mkfiles/mkfile-Inferno-power +1 −1
  11. mkfiles/mkfile-Inferno-sparc +1 −1
  12. mkfiles/mkfile-Inferno-spim +1 −1
  13. mkfiles/mkfile-Inferno-thumb +1 −1
  14. mkfiles/mkfile-Plan9-386 +1 −1
  15. mkfiles/mkfile-Plan9-68020 +1 −1
  16. mkfiles/mkfile-Plan9-amd64 +1 −1
  17. mkfiles/mkfile-Plan9-arm +1 −1
  18. mkfiles/mkfile-Plan9-mips +1 −1
  19. mkfiles/mkfile-Plan9-power +1 −1
  20. mkfiles/mkfile-Plan9-sparc +1 −1
CHANGES+4−0
@@ -1,3 +1,7 @@
120120305
2 add -I$ROOT/(Plan9|Inferno)/include to CFLAGS in mkfiles/^(mkfile-Plan9* mkfile-Inferno*)
3 change specific object type to $OBJTYPE in the same
4 libmath/fdlibm/fdlibm.h and libmath/dtoa.c, if USE_FPdbleword defined, use FPdbleword to crack doubles into integers
120120304520120304
2 rabin(2) added (preliminary)6 rabin(2) added (preliminary)
320120213720120213
Plan9/include/lib9x.h+20−0
@@ -0,0 +1,20 @@
1#include <u.h>
2typedef usize size_t;
3
4#define Runeerror xRuneerror
5#define Rendez xRendez
6#include <libc.h>
7#undef Runeerror
8#undef Rendez
9
10
11enum
12{
13 Runeerror = 0x80, /* decoding error in UTF */
14};
15/*
16 * Extensions for Inferno to basic libc.h
17 */
18
19#define setbinmode()
20#define USE_FPdbleword
include/version.h+1−1
@@ -1 +1 @@
1#define VERSION "Fourth Edition (20120304)"1#define VERSION "Fourth Edition (20120305)"
libmath/dtoa.c+7−2
@@ -26,13 +26,18 @@ · 25 unmodified lines
26 26
27#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000;27#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000;
28 28
29#ifdef USE_FPdbleword
30#define word0(x) ((unsigned long *)&x)->hi
31#define word1(x) ((unsigned long *)&x)->lo
32#else
29#ifdef __LITTLE_ENDIAN33#ifdef __LITTLE_ENDIAN
30#define word0(x) ((unsigned long *)&x)[1]34#define word0(x) ((FPdbleword*)&x)[1]
31#define word1(x) ((unsigned long *)&x)[0]35#define word1(x) ((FPdbleword*)&x)[0]
32#else36#else
33#define word0(x) ((unsigned long *)&x)[0]37#define word0(x) ((unsigned long *)&x)[0]
34#define word1(x) ((unsigned long *)&x)[1]38#define word1(x) ((unsigned long *)&x)[1]
35#endif39#endif
40#endif
36 41
37/* #define P DBL_MANT_DIG */42/* #define P DBL_MANT_DIG */
38/* Ten_pmax = floor(P*log(2)/log(5)) */43/* Ten_pmax = floor(P*log(2)/log(5)) */
libmath/fdlibm/fdlibm.h+95−98
@@ -14,6 +14,12 @@ · 13 unmodified lines
14 */14 */
15 15
16 16
17#ifdef USE_FPdbleword
18#define __HI(x) (int)((FPdbleword*)&x)->hi
19#define __LO(x) (int)((FPdbleword*)&x)->lo
20#define __HIp(x) (int)((FPdbleword*)x)->hi
21#define __LOp(x) (int)((FPdbleword*)x)->lo
22#else
17#ifdef __LITTLE_ENDIAN23#ifdef __LITTLE_ENDIAN
18#define __HI(x) *(1+(int*)&x)24#define __HI(x) *(1+(int*)&x)
19#define __LO(x) *(int*)&x25#define __LO(x) *(int*)&x
@@ -25,129 +31,120 @@ · 5 unmodified lines
25#define __HIp(x) *(int*)x31#define __HIp(x) *(int*)x
26#define __LOp(x) *(1+(int*)x)32#define __LOp(x) *(1+(int*)x)
27#endif33#endif
28
29/* Many GNU includes use the same define */
30#ifndef __P
31#define __P(p) p
32#endif34#endif
33 35
34/*36/*
35 * ANSI/POSIX37 * ANSI/POSIX
36 */38 */
37 39extern double acos(double);
38/*40extern double asin(double);
39 * ANSI/POSIX41extern double atan(double);
40 */42extern double atan2(double, double);
41extern double acos __P((double));43extern double cos(double);
42extern double asin __P((double));44extern double sin(double);
43extern double atan __P((double));45extern double tan(double);
44extern double atan2 __P((double, double));46
45extern double cos __P((double));47extern double cosh(double);
46extern double sin __P((double));48extern double sinh(double);
47extern double tan __P((double));49extern double tanh(double);
48 50
49extern double cosh __P((double));51extern double exp(double);
50extern double sinh __P((double));52extern double frexp(double, int *);
51extern double tanh __P((double));53extern double ldexp(double, int);
52 54extern double log(double);
53extern double exp __P((double));55extern double log10(double);
54extern double frexp __P((double, int *));56extern double modf(double, double *);
55extern double ldexp __P((double, int));57
56extern double log __P((double));58extern double pow(double, double);
57extern double log10 __P((double));59extern double sqrt(double);
58extern double modf __P((double, double *));60
59 61extern double ceil(double);
60extern double pow __P((double, double));62extern double fabs(double);
61extern double sqrt __P((double));63extern double floor(double);
62 64extern double fmod(double, double);
63extern double ceil __P((double));65
64extern double fabs __P((double));66extern double erf(double);
65extern double floor __P((double));67extern double erfc(double);
66extern double fmod __P((double, double));68extern double gamma(double);
67 69extern double hypot(double, double);
68extern double erf __P((double));70extern int finite(double);
69extern double erfc __P((double));71extern double j0(double);
70extern double gamma __P((double));72extern double j1(double);
71extern double hypot __P((double, double));73extern double jn(int, double);
72extern int isnan __P((double));74extern double lgamma(double);
73extern int finite __P((double));75extern double y0(double);
74extern double j0 __P((double));76extern double y1(double);
75extern double j1 __P((double));77extern double yn(int, double);
76extern double jn __P((int, double));78
77extern double lgamma __P((double));79extern double acosh(double);
78extern double y0 __P((double));80extern double asinh(double);
79extern double y1 __P((double));81extern double atanh(double);
80extern double yn __P((int, double));82extern double cbrt(double);
81 83extern double logb(double);
82extern double acosh __P((double));84extern double nextafter(double, double);
83extern double asinh __P((double));85extern double remainder(double, double);
84extern double atanh __P((double));86extern double scalb(double, double);
85extern double cbrt __P((double));
86extern double logb __P((double));
87extern double nextafter __P((double, double));
88extern double remainder __P((double, double));
89extern double scalb __P((double, double));
90 87
91/*88/*
92 * IEEE Test Vector89 * IEEE Test Vector
93 */90 */
94extern double significand __P((double));91extern double significand(double);
95 92
96/*93/*
97 * Functions callable from C, intended to support IEEE arithmetic.94 * Functions callable from C, intended to support IEEE arithmetic.
98 */95 */
99extern double copysign __P((double, double));96extern double copysign(double, double);
100extern int ilogb __P((double));97extern int ilogb(double);
101extern double rint __P((double));98extern double rint(double);
102extern double scalbn __P((double, int));99extern double scalbn(double, int);
103 100
104/*101/*
105 * BSD math library entry points102 * BSD math library entry points
106 */103 */
107extern double expm1 __P((double));104extern double expm1(double);
108extern double log1p __P((double));105extern double log1p(double);
109 106
110/*107/*
111 * Reentrant version of gamma & lgamma; passes signgam back by reference108 * Reentrant version of gamma & lgamma; passes signgam back by reference
112 * as the second argument; user must allocate space for signgam.109 * as the second argument; user must allocate space for signgam.
113 */110 */
114#ifdef _REENTRANT111#ifdef _REENTRANT
115extern double gamma_r __P((double, int *));112extern double gamma_r(double, int *);
116extern double lgamma_r __P((double, int *));113extern double lgamma_r(double, int *);
117#endif /* _REENTRANT */114#endif /* _REENTRANT */
118 115
119/* ieee style elementary functions */116/* ieee style elementary functions */
120extern double __ieee754_sqrt __P((double)); 117extern double __ieee754_sqrt(double);
121extern double __ieee754_acos __P((double)); 118extern double __ieee754_acos(double);
122extern double __ieee754_acosh __P((double)); 119extern double __ieee754_acosh(double);
123extern double __ieee754_log __P((double)); 120extern double __ieee754_log(double);
124extern double __ieee754_atanh __P((double)); 121extern double __ieee754_atanh(double);
125extern double __ieee754_asin __P((double)); 122extern double __ieee754_asin(double);
126extern double __ieee754_atan2 __P((double,double)); 123extern double __ieee754_atan2(double,double);
127extern double __ieee754_exp __P((double));124extern double __ieee754_exp(double);
128extern double __ieee754_cosh __P((double));125extern double __ieee754_cosh(double);
129extern double __ieee754_fmod __P((double,double));126extern double __ieee754_fmod(double,double);
130extern double __ieee754_pow __P((double,double));127extern double __ieee754_pow(double,double);
131extern double __ieee754_lgamma_r __P((double,int *));128extern double __ieee754_lgamma_r(double,int *);
132extern double __ieee754_gamma_r __P((double,int *));129extern double __ieee754_gamma_r(double,int *);
133extern double __ieee754_lgamma __P((double));130extern double __ieee754_lgamma(double);
134extern double __ieee754_gamma __P((double));131extern double __ieee754_gamma(double);
135extern double __ieee754_log10 __P((double));132extern double __ieee754_log10(double);
136extern double __ieee754_sinh __P((double));133extern double __ieee754_sinh(double);
137extern double __ieee754_hypot __P((double,double));134extern double __ieee754_hypot(double,double);
138extern double __ieee754_j0 __P((double));135extern double __ieee754_j0(double);
139extern double __ieee754_j1 __P((double));136extern double __ieee754_j1(double);
140extern double __ieee754_y0 __P((double));137extern double __ieee754_y0(double);
141extern double __ieee754_y1 __P((double));138extern double __ieee754_y1(double);
142extern double __ieee754_jn __P((int,double));139extern double __ieee754_jn(int,double);
143extern double __ieee754_yn __P((int,double));140extern double __ieee754_yn(int,double);
144extern double __ieee754_remainder __P((double,double));141extern double __ieee754_remainder(double,double);
145extern int __ieee754_rem_pio2 __P((double,double*));142extern int __ieee754_rem_pio2(double,double*);
146extern double __ieee754_scalb __P((double,int));143extern double __ieee754_scalb(double,int);
147 144
148/* fdlibm kernel function */145/* fdlibm kernel function */
149extern double __kernel_standard __P((double,double,int)); 146extern double __kernel_standard(double,double,int);
150extern double __kernel_sin __P((double,double,int));147extern double __kernel_sin(double,double,int);
151extern double __kernel_cos __P((double,double));148extern double __kernel_cos(double,double);
152extern double __kernel_tan __P((double,double,int));149extern double __kernel_tan(double,double,int);
153extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));150extern int __kernel_rem_pio2(double*,double*,int,int,int,const int*);
mkfiles/mkfile-Inferno-386+1−1
@@ -12,7 +12,7 @@ AS= 8a · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= 8c14CC= 8c
15CFLAGS= -wFVT -I$ROOT/Inferno/386/include -I$ROOT/include15CFLAGS= -wFVT -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= 8l18LD= 8l
mkfiles/mkfile-Inferno-68000+1−1
@@ -12,7 +12,7 @@ AS= 1a · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= 1c14CC= 1c
15CFLAGS= -N -wFV -I$ROOT/Inferno/68000/include -I$ROOT/include15CFLAGS= -N -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= 1l18LD= 1l
mkfiles/mkfile-Inferno-arm+1−1
@@ -12,7 +12,7 @@ AS= 5a · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= 5c14CC= 5c
15CFLAGS= -wFV -I$ROOT/Inferno/arm/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= 5l18LD= 5l
mkfiles/mkfile-Inferno-mips+1−1
@@ -12,7 +12,7 @@ AS= va · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= vc14CC= vc
15CFLAGS= -wFV -I$ROOT/Inferno/mips/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= vl18LD= vl
mkfiles/mkfile-Inferno-power+1−1
@@ -12,7 +12,7 @@ AS= qa · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= qc14CC= qc
15CFLAGS= -wFV -I$ROOT/Inferno/power/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= ql18LD= ql
mkfiles/mkfile-Inferno-sparc+1−1
@@ -12,7 +12,7 @@ AS= ka · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= kc14CC= kc
15CFLAGS= -wFV -I$ROOT/Inferno/sparc/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= kl18LD= kl
mkfiles/mkfile-Inferno-spim+1−1
@@ -12,7 +12,7 @@ AS= 0a · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= 0c14CC= 0c
15CFLAGS= -w -I$ROOT/Inferno/spim/include -I$ROOT/include15CFLAGS= -w -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= 0l18LD= 0l
mkfiles/mkfile-Inferno-thumb+1−1
@@ -12,7 +12,7 @@ AS=5a -t · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= tc14CC= tc
15CFLAGS= -wFV -I$ROOT/Inferno/arm/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD=5l18LD=5l
mkfiles/mkfile-Plan9-386+1−1
@@ -12,7 +12,7 @@ AS= 8a · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= 8c14CC= 8c
15CFLAGS= -wFVT -I$ROOT/Plan9/386/include -I$ROOT/include15CFLAGS= -wFVT -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= 8l18LD= 8l
mkfiles/mkfile-Plan9-68020+1−1
@@ -12,7 +12,7 @@ AS= 2a · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= 2c14CC= 2c
15CFLAGS= -wFV -I$ROOT/Plan9/68020/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= 2l18LD= 2l
mkfiles/mkfile-Plan9-amd64+1−1
@@ -12,7 +12,7 @@ AS= 6a · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= 6c14CC= 6c
15CFLAGS= -wFV -I$ROOT/Plan9/amd64/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= 6l18LD= 6l
mkfiles/mkfile-Plan9-arm+1−1
@@ -12,7 +12,7 @@ AS= 5a · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= 5c14CC= 5c
15CFLAGS= -wFV -I$ROOT/Plan9/arm/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= 5l18LD= 5l
mkfiles/mkfile-Plan9-mips+1−1
@@ -12,7 +12,7 @@ AS= va · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= vc14CC= vc
15CFLAGS= -wFV -I$ROOT/Plan9/mips/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= vl18LD= vl
mkfiles/mkfile-Plan9-power+1−1
@@ -12,7 +12,7 @@ AS= qa · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= qc14CC= qc
15CFLAGS= -wFV -I$ROOT/Plan9/power/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= ql18LD= ql
mkfiles/mkfile-Plan9-sparc+1−1
@@ -12,7 +12,7 @@ AS= ka · 11 unmodified lines
12ASFLAGS=12ASFLAGS=
13 13
14CC= kc14CC= kc
15CFLAGS= -wFV -I$ROOT/Plan9/sparc/include -I$ROOT/include15CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
16ANSICPP= -p16ANSICPP= -p
17 17
18LD= kl18LD= kl

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t