porffor 0.50.27 → 0.50.28
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/compiler/builtins.js +4 -31
- package/package.json +1 -1
- package/runner/index.js +2 -2
package/compiler/builtins.js
CHANGED
@@ -364,13 +364,13 @@ export const BuiltinFuncs = function() {
|
|
364
364
|
const prngSeed0 = (Math.random() * (2 ** 30)) | 0, prngSeed1 = (Math.random() * (2 ** 30)) | 0;
|
365
365
|
|
366
366
|
const prng = ({
|
367
|
-
'
|
367
|
+
'lcg32': {
|
368
368
|
globals: [ Valtype.i32 ],
|
369
369
|
locals: [],
|
370
370
|
returns: Valtype.i32,
|
371
371
|
wasm: [
|
372
|
+
// use glibc/musl's constants
|
372
373
|
// seed = (MULTIPLIER * seed + INCREMENT) % MODULUS
|
373
|
-
// MULTIPLIER * state0
|
374
374
|
[ Opcodes.global_get, 0 ],
|
375
375
|
number(1103515245, Valtype.i32),
|
376
376
|
[ Opcodes.i32_mul ],
|
@@ -380,30 +380,8 @@ export const BuiltinFuncs = function() {
|
|
380
380
|
[ Opcodes.i32_add ],
|
381
381
|
|
382
382
|
// % MODULUS
|
383
|
-
number(
|
384
|
-
[ Opcodes.
|
385
|
-
|
386
|
-
// state0 =
|
387
|
-
[ Opcodes.global_set, 0 ],
|
388
|
-
|
389
|
-
// state0
|
390
|
-
[ Opcodes.global_get, 0 ],
|
391
|
-
],
|
392
|
-
},
|
393
|
-
'lcg32_minstd': {
|
394
|
-
globals: [ Valtype.i32 ],
|
395
|
-
locals: [],
|
396
|
-
returns: Valtype.i32,
|
397
|
-
wasm: [
|
398
|
-
// seed = (MULTIPLIER * seed + INCREMENT) % MODULUS
|
399
|
-
// MULTIPLIER * state0
|
400
|
-
[ Opcodes.global_get, 0 ],
|
401
|
-
number(48271, Valtype.i32),
|
402
|
-
[ Opcodes.i32_mul ],
|
403
|
-
|
404
|
-
// % MODULUS
|
405
|
-
number((2 ** 31) - 1, Valtype.i32),
|
406
|
-
[ Opcodes.i32_rem_s ],
|
383
|
+
number(0x7fffffff, Valtype.i32),
|
384
|
+
[ Opcodes.i32_and ],
|
407
385
|
|
408
386
|
// state0 =
|
409
387
|
[ Opcodes.global_set, 0 ],
|
@@ -484,11 +462,6 @@ export const BuiltinFuncs = function() {
|
|
484
462
|
// state0 = s1
|
485
463
|
[ Opcodes.global_set, 0 ],
|
486
464
|
|
487
|
-
// // s1 * 0x2545F4914F6CDD1D
|
488
|
-
// [ Opcodes.local_get, 0 ],
|
489
|
-
// [ Opcodes.i64_const, 0x9d, 0xba, 0xb3, 0xfb, 0x94, 0x92, 0xfd, 0xa2, 0x25 ],
|
490
|
-
// [ Opcodes.i64_mul ]
|
491
|
-
|
492
465
|
// s1
|
493
466
|
[ Opcodes.local_get, 0 ],
|
494
467
|
],
|
package/package.json
CHANGED
package/runner/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import fs from 'node:fs';
|
3
|
-
globalThis.version = '0.50.
|
3
|
+
globalThis.version = '0.50.28';
|
4
4
|
|
5
5
|
// deno compat
|
6
6
|
if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
|
@@ -63,7 +63,7 @@ if (process.argv.includes('--help')) {
|
|
63
63
|
pgo: 'Enable PGO (profile-guided optimization)',
|
64
64
|
'profile-compiler': 'Log general compiler performance (on by default when compiling to a file)',
|
65
65
|
valtype: 'Valtype to use (i32|i64|\x1B[1mf64\x1B[0m)',
|
66
|
-
prng: 'PRNG algorithm to use (
|
66
|
+
prng: 'PRNG algorithm to use (lcg32|xorshift32+|xorshift64+|\x1B[1mxorshift128+\x1B[0m|xoroshiro128+|xoshiro128+)',
|
67
67
|
allocator: 'Allocator to use (oneshot|\x1B[1mchunk\x1B[0m)',
|
68
68
|
'exception-mode': 'Exception mode to use (lut|\x1B[1mstack\x1B[0m)',
|
69
69
|
fastLength: 'Spec non-compliant optimization to make .length faster',
|