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 @@
1+20120305
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
15 20120304
26 rabin(2) added (preliminary)
37 20120213
Plan9/include/lib9x.h+20−0
@@ -0,0 +1,20 @@
1+#include <u.h>
2+typedef usize size_t;
3+
4+#define Runeerror xRuneerror
5+#define Rendez xRendez
6+#include <libc.h>
7+#undef Runeerror
8+#undef Rendez
9+
10+
11+enum
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
2626
2727 #define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000;
2828
29+#ifdef USE_FPdbleword
30+#define word0(x) ((unsigned long *)&x)->hi
31+#define word1(x) ((unsigned long *)&x)->lo
32+#else
2933 #ifdef __LITTLE_ENDIAN
30−#define word0(x) ((unsigned long *)&x)[1]
31−#define word1(x) ((unsigned long *)&x)[0]
34+#define word0(x) ((FPdbleword*)&x)[1]
35+#define word1(x) ((FPdbleword*)&x)[0]
3236 #else
3337 #define word0(x) ((unsigned long *)&x)[0]
3438 #define word1(x) ((unsigned long *)&x)[1]
3539 #endif
40+#endif
3641
3742 /* #define P DBL_MANT_DIG */
3843 /* Ten_pmax = floor(P*log(2)/log(5)) */
libmath/fdlibm/fdlibm.h+95−98
@@ -14,6 +14,12 @@ · 13 unmodified lines
1414 */
1515
1616
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
1723 #ifdef __LITTLE_ENDIAN
1824 #define __HI(x) *(1+(int*)&x)
1925 #define __LO(x) *(int*)&x
@@ -25,129 +31,120 @@ · 5 unmodified lines
2531 #define __HIp(x) *(int*)x
2632 #define __LOp(x) *(1+(int*)x)
2733 #endif
28−
29−/* Many GNU includes use the same define */
30−#ifndef __P
31−#define __P(p) p
3234 #endif
3335
3436 /*
3537 * ANSI/POSIX
3638 */
37−
38−/*
39− * ANSI/POSIX
40− */
41−extern double acos __P((double));
42−extern double asin __P((double));
43−extern double atan __P((double));
44−extern double atan2 __P((double, double));
45−extern double cos __P((double));
46−extern double sin __P((double));
47−extern double tan __P((double));
48−
49−extern double cosh __P((double));
50−extern double sinh __P((double));
51−extern double tanh __P((double));
52−
53−extern double exp __P((double));
54−extern double frexp __P((double, int *));
55−extern double ldexp __P((double, int));
56−extern double log __P((double));
57−extern double log10 __P((double));
58−extern double modf __P((double, double *));
59−
60−extern double pow __P((double, double));
61−extern double sqrt __P((double));
62−
63−extern double ceil __P((double));
64−extern double fabs __P((double));
65−extern double floor __P((double));
66−extern double fmod __P((double, double));
67−
68−extern double erf __P((double));
69−extern double erfc __P((double));
70−extern double gamma __P((double));
71−extern double hypot __P((double, double));
72−extern int isnan __P((double));
73−extern int finite __P((double));
74−extern double j0 __P((double));
75−extern double j1 __P((double));
76−extern double jn __P((int, double));
77−extern double lgamma __P((double));
78−extern double y0 __P((double));
79−extern double y1 __P((double));
80−extern double yn __P((int, double));
81−
82−extern double acosh __P((double));
83−extern double asinh __P((double));
84−extern double atanh __P((double));
85−extern double cbrt __P((double));
86−extern double logb __P((double));
87−extern double nextafter __P((double, double));
88−extern double remainder __P((double, double));
89−extern double scalb __P((double, double));
39+extern double acos(double);
40+extern double asin(double);
41+extern double atan(double);
42+extern double atan2(double, double);
43+extern double cos(double);
44+extern double sin(double);
45+extern double tan(double);
46+
47+extern double cosh(double);
48+extern double sinh(double);
49+extern double tanh(double);
50+
51+extern double exp(double);
52+extern double frexp(double, int *);
53+extern double ldexp(double, int);
54+extern double log(double);
55+extern double log10(double);
56+extern double modf(double, double *);
57+
58+extern double pow(double, double);
59+extern double sqrt(double);
60+
61+extern double ceil(double);
62+extern double fabs(double);
63+extern double floor(double);
64+extern double fmod(double, double);
65+
66+extern double erf(double);
67+extern double erfc(double);
68+extern double gamma(double);
69+extern double hypot(double, double);
70+extern int finite(double);
71+extern double j0(double);
72+extern double j1(double);
73+extern double jn(int, double);
74+extern double lgamma(double);
75+extern double y0(double);
76+extern double y1(double);
77+extern double yn(int, double);
78+
79+extern double acosh(double);
80+extern double asinh(double);
81+extern double atanh(double);
82+extern double cbrt(double);
83+extern double logb(double);
84+extern double nextafter(double, double);
85+extern double remainder(double, double);
86+extern double scalb(double, double);
9087
9188 /*
9289 * IEEE Test Vector
9390 */
94−extern double significand __P((double));
91+extern double significand(double);
9592
9693 /*
9794 * Functions callable from C, intended to support IEEE arithmetic.
9895 */
99−extern double copysign __P((double, double));
100−extern int ilogb __P((double));
101−extern double rint __P((double));
102−extern double scalbn __P((double, int));
96+extern double copysign(double, double);
97+extern int ilogb(double);
98+extern double rint(double);
99+extern double scalbn(double, int);
103100
104101 /*
105102 * BSD math library entry points
106103 */
107−extern double expm1 __P((double));
108−extern double log1p __P((double));
104+extern double expm1(double);
105+extern double log1p(double);
109106
110107 /*
111108 * Reentrant version of gamma & lgamma; passes signgam back by reference
112109 * as the second argument; user must allocate space for signgam.
113110 */
114111 #ifdef _REENTRANT
115−extern double gamma_r __P((double, int *));
116−extern double lgamma_r __P((double, int *));
112+extern double gamma_r(double, int *);
113+extern double lgamma_r(double, int *);
117114 #endif /* _REENTRANT */
118115
119116 /* ieee style elementary functions */
120−extern double __ieee754_sqrt __P((double));
121−extern double __ieee754_acos __P((double));
122−extern double __ieee754_acosh __P((double));
123−extern double __ieee754_log __P((double));
124−extern double __ieee754_atanh __P((double));
125−extern double __ieee754_asin __P((double));
126−extern double __ieee754_atan2 __P((double,double));
127−extern double __ieee754_exp __P((double));
128−extern double __ieee754_cosh __P((double));
129−extern double __ieee754_fmod __P((double,double));
130−extern double __ieee754_pow __P((double,double));
131−extern double __ieee754_lgamma_r __P((double,int *));
132−extern double __ieee754_gamma_r __P((double,int *));
133−extern double __ieee754_lgamma __P((double));
134−extern double __ieee754_gamma __P((double));
135−extern double __ieee754_log10 __P((double));
136−extern double __ieee754_sinh __P((double));
137−extern double __ieee754_hypot __P((double,double));
138−extern double __ieee754_j0 __P((double));
139−extern double __ieee754_j1 __P((double));
140−extern double __ieee754_y0 __P((double));
141−extern double __ieee754_y1 __P((double));
142−extern double __ieee754_jn __P((int,double));
143−extern double __ieee754_yn __P((int,double));
144−extern double __ieee754_remainder __P((double,double));
145−extern int __ieee754_rem_pio2 __P((double,double*));
146−extern double __ieee754_scalb __P((double,int));
117+extern double __ieee754_sqrt(double);
118+extern double __ieee754_acos(double);
119+extern double __ieee754_acosh(double);
120+extern double __ieee754_log(double);
121+extern double __ieee754_atanh(double);
122+extern double __ieee754_asin(double);
123+extern double __ieee754_atan2(double,double);
124+extern double __ieee754_exp(double);
125+extern double __ieee754_cosh(double);
126+extern double __ieee754_fmod(double,double);
127+extern double __ieee754_pow(double,double);
128+extern double __ieee754_lgamma_r(double,int *);
129+extern double __ieee754_gamma_r(double,int *);
130+extern double __ieee754_lgamma(double);
131+extern double __ieee754_gamma(double);
132+extern double __ieee754_log10(double);
133+extern double __ieee754_sinh(double);
134+extern double __ieee754_hypot(double,double);
135+extern double __ieee754_j0(double);
136+extern double __ieee754_j1(double);
137+extern double __ieee754_y0(double);
138+extern double __ieee754_y1(double);
139+extern double __ieee754_jn(int,double);
140+extern double __ieee754_yn(int,double);
141+extern double __ieee754_remainder(double,double);
142+extern int __ieee754_rem_pio2(double,double*);
143+extern double __ieee754_scalb(double,int);
147144
148145 /* fdlibm kernel function */
149−extern double __kernel_standard __P((double,double,int));
150−extern double __kernel_sin __P((double,double,int));
151−extern double __kernel_cos __P((double,double));
152−extern double __kernel_tan __P((double,double,int));
153−extern int __kernel_rem_pio2 __P((double*,double*,int,int,int,const int*));
146+extern double __kernel_standard(double,double,int);
147+extern double __kernel_sin(double,double,int);
148+extern double __kernel_cos(double,double);
149+extern double __kernel_tan(double,double,int);
150+extern 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
1212 ASFLAGS=
1313
1414 CC= 8c
15−CFLAGS= -wFVT -I$ROOT/Inferno/386/include -I$ROOT/include
15+CFLAGS= -wFVT -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 8l
mkfiles/mkfile-Inferno-68000+1−1
@@ -12,7 +12,7 @@ AS= 1a · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= 1c
15−CFLAGS= -N -wFV -I$ROOT/Inferno/68000/include -I$ROOT/include
15+CFLAGS= -N -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 1l
mkfiles/mkfile-Inferno-arm+1−1
@@ -12,7 +12,7 @@ AS= 5a · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= 5c
15−CFLAGS= -wFV -I$ROOT/Inferno/arm/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 5l
mkfiles/mkfile-Inferno-mips+1−1
@@ -12,7 +12,7 @@ AS= va · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= vc
15−CFLAGS= -wFV -I$ROOT/Inferno/mips/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= vl
mkfiles/mkfile-Inferno-power+1−1
@@ -12,7 +12,7 @@ AS= qa · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= qc
15−CFLAGS= -wFV -I$ROOT/Inferno/power/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= ql
mkfiles/mkfile-Inferno-sparc+1−1
@@ -12,7 +12,7 @@ AS= ka · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= kc
15−CFLAGS= -wFV -I$ROOT/Inferno/sparc/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= kl
mkfiles/mkfile-Inferno-spim+1−1
@@ -12,7 +12,7 @@ AS= 0a · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= 0c
15−CFLAGS= -w -I$ROOT/Inferno/spim/include -I$ROOT/include
15+CFLAGS= -w -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 0l
mkfiles/mkfile-Inferno-thumb+1−1
@@ -12,7 +12,7 @@ AS=5a -t · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= tc
15−CFLAGS= -wFV -I$ROOT/Inferno/arm/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Inferno/$OBJTYPE/include -I$ROOT/Inferno/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD=5l
mkfiles/mkfile-Plan9-386+1−1
@@ -12,7 +12,7 @@ AS= 8a · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= 8c
15−CFLAGS= -wFVT -I$ROOT/Plan9/386/include -I$ROOT/include
15+CFLAGS= -wFVT -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 8l
mkfiles/mkfile-Plan9-68020+1−1
@@ -12,7 +12,7 @@ AS= 2a · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= 2c
15−CFLAGS= -wFV -I$ROOT/Plan9/68020/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 2l
mkfiles/mkfile-Plan9-amd64+1−1
@@ -12,7 +12,7 @@ AS= 6a · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= 6c
15−CFLAGS= -wFV -I$ROOT/Plan9/amd64/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 6l
mkfiles/mkfile-Plan9-arm+1−1
@@ -12,7 +12,7 @@ AS= 5a · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= 5c
15−CFLAGS= -wFV -I$ROOT/Plan9/arm/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 5l
mkfiles/mkfile-Plan9-mips+1−1
@@ -12,7 +12,7 @@ AS= va · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= vc
15−CFLAGS= -wFV -I$ROOT/Plan9/mips/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= vl
mkfiles/mkfile-Plan9-power+1−1
@@ -12,7 +12,7 @@ AS= qa · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= qc
15−CFLAGS= -wFV -I$ROOT/Plan9/power/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= ql
mkfiles/mkfile-Plan9-sparc+1−1
@@ -12,7 +12,7 @@ AS= ka · 11 unmodified lines
1212 ASFLAGS=
1313
1414 CC= kc
15−CFLAGS= -wFV -I$ROOT/Plan9/sparc/include -I$ROOT/include
15+CFLAGS= -wFV -I$ROOT/Plan9/$OBJTYPE/include -I$ROOT/Plan9/include -I$ROOT/include
1616 ANSICPP= -p
1717
1818 LD= 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