porffor 0.0.0-05f898f → 0.0.0-151f80e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/compiler/2c.js +353 -349
- package/compiler/codeGen.js +398 -101
- package/compiler/embedding.js +9 -5
- package/compiler/index.js +3 -3
- package/compiler/opt.js +14 -18
- package/compiler/prototype.js +168 -29
- package/compiler/sections.js +19 -4
- package/out.exe +0 -0
- package/package.json +1 -1
- package/r.js +39 -1
- package/rhemyn/compile.js +1 -1
- package/runner/index.js +5 -3
- package/runner/info.js +37 -2
- package/tmp.c +26 -23
package/tmp.c
CHANGED
@@ -6,30 +6,31 @@
|
|
6
6
|
|
7
7
|
#include <stdio.h>
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
return
|
9
|
+
long long state0 = 1028798103;
|
10
|
+
long long state1 = 477374377;
|
11
|
+
double t = 0;
|
12
|
+
|
13
|
+
double inline __Math_random() {
|
14
|
+
long long s1 = 0;
|
15
|
+
long long s0 = 0;
|
16
|
+
|
17
|
+
s1 = state0;
|
18
|
+
state0 = (s0 = state1);
|
19
|
+
state1 = ((((s1 = (s1 ^ (s1 << 23)))) ^ s0) ^ (s1 >> 17)) ^ (s0 >> 26);
|
20
|
+
return ((double)((state1 + s0) & 2097151) / 2.097152e+6);
|
21
21
|
}
|
22
22
|
|
23
|
-
double
|
24
|
-
double
|
23
|
+
double randoms(double max) {
|
24
|
+
double sum = 0;
|
25
25
|
double i = 0;
|
26
26
|
|
27
|
+
sum = 0e+0;
|
27
28
|
i = 0e+0;
|
28
|
-
while (i <
|
29
|
-
|
29
|
+
while (i < max) {
|
30
|
+
sum = sum + __Math_random();
|
30
31
|
i = i + 1e+0;
|
31
32
|
}
|
32
|
-
return
|
33
|
+
return sum;
|
33
34
|
}
|
34
35
|
|
35
36
|
double inline __performance_now() {
|
@@ -42,17 +43,19 @@ double inline __performance_now() {
|
|
42
43
|
#else
|
43
44
|
struct timespec _time;
|
44
45
|
clock_gettime(CLOCK_MONOTONIC, &_time);
|
45
|
-
_time_out = _time.tv_nsec / 1000000.;
|
46
|
+
_time_out = _time.tv_nsec / 1000000. + _time.tv_sec * 1000.;
|
46
47
|
#endif
|
47
48
|
return _time_out;
|
48
49
|
}
|
49
50
|
|
50
|
-
|
51
|
-
|
51
|
+
void inline __console_log(double x) {
|
52
|
+
printf("%f\n", x);
|
53
|
+
printf("%c", (int)(1e+1));
|
54
|
+
}
|
52
55
|
|
56
|
+
int main() {
|
53
57
|
t = __performance_now();
|
54
|
-
|
55
|
-
|
56
|
-
printf("%f\n", (__performance_now() - t));
|
58
|
+
randoms(1e+5);
|
59
|
+
__console_log(__performance_now() - t);
|
57
60
|
}
|
58
61
|
|