author | Lars T Hansen <lhansen@mozilla.com> |
Wed, 02 Sep 2015 09:26:13 +0200 | |
changeset 260493 | 9dc70a671d84539392e2f30b89eeb188b56ae2c8 |
parent 260492 | 3e0f851d44435338e2e62211344af9a615c7899e |
child 260494 | 62efa6d695d0f7e7e862035ce8c0798faa45ae50 |
push id | 64507 |
push user | lhansen@mozilla.com |
push date | Wed, 02 Sep 2015 07:31:14 +0000 |
treeherder | mozilla-inbound@9dc70a671d84 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | luke |
bugs | 1178793 |
milestone | 43.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
js/src/asmjs/AsmJSValidate.cpp | file | annotate | diff | comparison | revisions | |
js/src/jit-test/tests/asm.js/testAtomics.js | file | annotate | diff | comparison | revisions |
--- a/js/src/asmjs/AsmJSValidate.cpp +++ b/js/src/asmjs/AsmJSValidate.cpp @@ -5992,17 +5992,17 @@ CheckAtomicsLoad(FunctionBuilder& f, Par NeedsBoundsCheck needsBoundsCheck; int32_t mask; if (!CheckSharedArrayAtomicAccess(f, arrayArg, indexArg, &viewType, &needsBoundsCheck, &mask)) return false; f.patchU8(needsBoundsCheckAt, uint8_t(needsBoundsCheck)); f.patchU8(viewTypeAt, uint8_t(viewType)); - *type = Type::Intish; + *type = Type::Int; return true; } static bool EmitAtomicsLoad(FunctionCompiler& f, MDefinition** def) { NeedsBoundsCheck needsBoundsCheck = NeedsBoundsCheck(f.readU8()); Scalar::Type viewType = Scalar::Type(f.readU8()); @@ -6089,17 +6089,17 @@ CheckAtomicsBinop(FunctionBuilder& f, Pa return false; if (!valueArgType.isIntish()) return f.failf(valueArg, "%s is not a subtype of intish", valueArgType.toChars()); f.patchU8(needsBoundsCheckAt, uint8_t(needsBoundsCheck)); f.patchU8(viewTypeAt, uint8_t(viewType)); - *type = Type::Intish; + *type = Type::Int; return true; } static bool EmitAtomicsBinOp(FunctionCompiler& f, MDefinition** def) { NeedsBoundsCheck needsBoundsCheck = NeedsBoundsCheck(f.readU8()); Scalar::Type viewType = Scalar::Type(f.readU8()); @@ -6164,17 +6164,17 @@ CheckAtomicsCompareExchange(FunctionBuil return f.failf(oldValueArg, "%s is not a subtype of intish", oldValueArgType.toChars()); if (!newValueArgType.isIntish()) return f.failf(newValueArg, "%s is not a subtype of intish", newValueArgType.toChars()); f.patchU8(needsBoundsCheckAt, uint8_t(needsBoundsCheck)); f.patchU8(viewTypeAt, uint8_t(viewType)); - *type = Type::Intish; + *type = Type::Int; return true; } static bool EmitAtomicsCompareExchange(FunctionCompiler& f, MDefinition** def) { NeedsBoundsCheck needsBoundsCheck = NeedsBoundsCheck(f.readU8()); Scalar::Type viewType = Scalar::Type(f.readU8()); @@ -6216,17 +6216,17 @@ CheckAtomicsExchange(FunctionBuilder& f, return false; if (!valueArgType.isIntish()) return f.failf(arrayArg, "%s is not a subtype of intish", valueArgType.toChars()); f.patchU8(needsBoundsCheckAt, uint8_t(needsBoundsCheck)); f.patchU8(viewTypeAt, uint8_t(viewType)); - *type = Type::Intish; + *type = Type::Int; return true; } static bool EmitAtomicsExchange(FunctionCompiler& f, MDefinition** def) { NeedsBoundsCheck needsBoundsCheck = NeedsBoundsCheck(f.readU8()); Scalar::Type viewType = Scalar::Type(f.readU8());
--- a/js/src/jit-test/tests/asm.js/testAtomics.js +++ b/js/src/jit-test/tests/asm.js/testAtomics.js @@ -25,186 +25,186 @@ var loadModule_int32_code = function do_fence() { atomic_fence(); } // Load element 0 function do_load() { var v = 0; - v = atomic_load(i32a, 0)|0; + v = atomic_load(i32a, 0); return v|0; } // Load element i function do_load_i(i) { i = i|0; var v = 0; - v = atomic_load(i32a, i>>2)|0; + v = atomic_load(i32a, i>>2); return v|0; } // Store 37 in element 0 function do_store() { var v = 0; - v = atomic_store(i32a, 0, 37)|0; + v = atomic_store(i32a, 0, 37); return v|0; } // Store 37 in element i function do_store_i(i) { i = i|0; var v = 0; - v = atomic_store(i32a, i>>2, 37)|0; + v = atomic_store(i32a, i>>2, 37); return v|0; } // Exchange 37 into element 200 function do_xchg() { var v = 0; - v = atomic_exchange(i32a, 200, 37)|0; + v = atomic_exchange(i32a, 200, 37); return v|0; } // Exchange 42 into element i function do_xchg_i(i) { i = i|0; var v = 0; - v = atomic_exchange(i32a, i>>2, 42)|0; + v = atomic_exchange(i32a, i>>2, 42); return v|0; } // Exchange 1+2 into element 200. This is not called; all we're // checking is that the compilation succeeds, since 1+2 has type // "intish" (asm.js spec "AdditiveExpression") and this should be // allowed. function do_xchg_intish() { var v = 0; - v = atomic_exchange(i32a, 200, 1+2)|0; + v = atomic_exchange(i32a, 200, 1+2); return v|0; } // Add 37 to element 10 function do_add() { var v = 0; - v = atomic_add(i32a, 10, 37)|0; + v = atomic_add(i32a, 10, 37); return v|0; } // Add 37 to element i function do_add_i(i) { i = i|0; var v = 0; - v = atomic_add(i32a, i>>2, 37)|0; + v = atomic_add(i32a, i>>2, 37); return v|0; } // As for do_xchg_intish, above. Given the structure of the // compiler, this covers all the binops. function do_add_intish() { var v = 0; - v = atomic_add(i32a, 10, 1+2)|0; + v = atomic_add(i32a, 10, 1+2); return v|0; } // Subtract 148 from element 20 function do_sub() { var v = 0; - v = atomic_sub(i32a, 20, 148)|0; + v = atomic_sub(i32a, 20, 148); return v|0; } // Subtract 148 from element i function do_sub_i(i) { i = i|0; var v = 0; - v = atomic_sub(i32a, i>>2, 148)|0; + v = atomic_sub(i32a, i>>2, 148); return v|0; } // AND 0x33333333 into element 30 function do_and() { var v = 0; - v = atomic_and(i32a, 30, 0x33333333)|0; + v = atomic_and(i32a, 30, 0x33333333); return v|0; } // AND 0x33333333 into element i function do_and_i(i) { i = i|0; var v = 0; - v = atomic_and(i32a, i>>2, 0x33333333)|0; + v = atomic_and(i32a, i>>2, 0x33333333); return v|0; } // OR 0x33333333 into element 40 function do_or() { var v = 0; - v = atomic_or(i32a, 40, 0x33333333)|0; + v = atomic_or(i32a, 40, 0x33333333); return v|0; } // OR 0x33333333 into element i function do_or_i(i) { i = i|0; var v = 0; - v = atomic_or(i32a, i>>2, 0x33333333)|0; + v = atomic_or(i32a, i>>2, 0x33333333); return v|0; } // XOR 0x33333333 into element 50 function do_xor() { var v = 0; - v = atomic_xor(i32a, 50, 0x33333333)|0; + v = atomic_xor(i32a, 50, 0x33333333); return v|0; } // XOR 0x33333333 into element i function do_xor_i(i) { i = i|0; var v = 0; - v = atomic_xor(i32a, i>>2, 0x33333333)|0; + v = atomic_xor(i32a, i>>2, 0x33333333); return v|0; } // CAS element 100: 0 -> -1 function do_cas1() { var v = 0; - v = atomic_cmpxchg(i32a, 100, 0, -1)|0; + v = atomic_cmpxchg(i32a, 100, 0, -1); return v|0; } // As for do_xchg_intish, above. Will not be called, is here just // to test that the compiler allows intish arguments. function do_cas_intish() { var v = 0; - v = atomic_cmpxchg(i32a, 100, 1+2, 2+3)|0; + v = atomic_cmpxchg(i32a, 100, 1+2, 2+3); return v|0; } // CAS element 100: -1 -> 0x5A5A5A5A function do_cas2() { var v = 0; - v = atomic_cmpxchg(i32a, 100, -1, 0x5A5A5A5A)|0; + v = atomic_cmpxchg(i32a, 100, -1, 0x5A5A5A5A); return v|0; } // CAS element i: 0 -> -1 function do_cas1_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i32a, i>>2, 0, -1)|0; + v = atomic_cmpxchg(i32a, i>>2, 0, -1); return v|0; } // CAS element i: -1 -> 0x5A5A5A5A function do_cas2_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i32a, i>>2, -1, 0x5A5A5A5A)|0; + v = atomic_cmpxchg(i32a, i>>2, -1, 0x5A5A5A5A); return v|0; } return { fence: do_fence, load: do_load, load_i: do_load_i, store: do_store, store_i: do_store_i, @@ -226,35 +226,16 @@ var loadModule_int32_code = cas2: do_cas2, cas_intish: do_cas_intish, cas1_i: do_cas1_i, cas2_i: do_cas2_i }; `; var loadModule_int32 = asmCompile('stdlib', 'foreign', 'heap', loadModule_int32_code); -// Test that compilation fails without a coercion on the return value. -// The module is never created, we use it only for its effect. - -var loadModule_int32_return_xchg_code = - USE_ASM + ` - var atomic_exchange = stdlib.Atomics.exchange; - var i32a = new stdlib.SharedInt32Array(heap); - - function do_xchg() { - var v = 0; - v = atomic_exchange(i32a, 200, 37); // Should not be allowed without |0 at the end - return v|0; - } - - return { xchg: do_xchg } -`; - -assertAsmTypeFail('stdlib', 'foreign', 'heap', loadModule_int32_return_xchg_code); - function test_int32(heap) { var i32a = new SharedInt32Array(heap); var i32m = asmLink(loadModule_int32, this, {}, heap); var size = SharedInt32Array.BYTES_PER_ELEMENT; i32m.fence(); @@ -357,160 +338,160 @@ var loadModule_uint32_code = var atomic_or = stdlib.Atomics.or; var atomic_xor = stdlib.Atomics.xor; var i32a = new stdlib.SharedUint32Array(heap); // Load element 0 function do_load() { var v = 0; - v = atomic_load(i32a, 0)|0; + v = atomic_load(i32a, 0); return +(v>>>0); } // Load element i function do_load_i(i) { i = i|0; var v = 0; - v = atomic_load(i32a, i>>2)|0; + v = atomic_load(i32a, i>>2); return +(v>>>0); } // Store 37 in element 0 function do_store() { var v = 0; - v = atomic_store(i32a, 0, 37)|0; + v = atomic_store(i32a, 0, 37); return +(v>>>0); } // Store 37 in element i function do_store_i(i) { i = i|0; var v = 0; - v = atomic_store(i32a, i>>2, 37)|0; + v = atomic_store(i32a, i>>2, 37); return +(v>>>0); } // Exchange 37 into element 200 function do_xchg() { var v = 0; - v = atomic_exchange(i32a, 200, 37)|0; + v = atomic_exchange(i32a, 200, 37); return v|0; } // Exchange 42 into element i function do_xchg_i(i) { i = i|0; var v = 0; - v = atomic_exchange(i32a, i>>2, 42)|0; + v = atomic_exchange(i32a, i>>2, 42); return v|0; } // Add 37 to element 10 function do_add() { var v = 0; - v = atomic_add(i32a, 10, 37)|0; + v = atomic_add(i32a, 10, 37); return +(v>>>0); } // Add 37 to element i function do_add_i(i) { i = i|0; var v = 0; - v = atomic_add(i32a, i>>2, 37)|0; + v = atomic_add(i32a, i>>2, 37); return +(v>>>0); } // Subtract 148 from element 20 function do_sub() { var v = 0; - v = atomic_sub(i32a, 20, 148)|0; + v = atomic_sub(i32a, 20, 148); return +(v>>>0); } // Subtract 148 from element i function do_sub_i(i) { i = i|0; var v = 0; - v = atomic_sub(i32a, i>>2, 148)|0; + v = atomic_sub(i32a, i>>2, 148); return +(v>>>0); } // AND 0x33333333 into element 30 function do_and() { var v = 0; - v = atomic_and(i32a, 30, 0x33333333)|0; + v = atomic_and(i32a, 30, 0x33333333); return +(v>>>0); } // AND 0x33333333 into element i function do_and_i(i) { i = i|0; var v = 0; - v = atomic_and(i32a, i>>2, 0x33333333)|0; + v = atomic_and(i32a, i>>2, 0x33333333); return +(v>>>0); } // OR 0x33333333 into element 40 function do_or() { var v = 0; - v = atomic_or(i32a, 40, 0x33333333)|0; + v = atomic_or(i32a, 40, 0x33333333); return +(v>>>0); } // OR 0x33333333 into element i function do_or_i(i) { i = i|0; var v = 0; - v = atomic_or(i32a, i>>2, 0x33333333)|0; + v = atomic_or(i32a, i>>2, 0x33333333); return +(v>>>0); } // XOR 0x33333333 into element 50 function do_xor() { var v = 0; - v = atomic_xor(i32a, 50, 0x33333333)|0; + v = atomic_xor(i32a, 50, 0x33333333); return +(v>>>0); } // XOR 0x33333333 into element i function do_xor_i(i) { i = i|0; var v = 0; - v = atomic_xor(i32a, i>>2, 0x33333333)|0; + v = atomic_xor(i32a, i>>2, 0x33333333); return +(v>>>0); } // CAS element 100: 0 -> -1 function do_cas1() { var v = 0; - v = atomic_cmpxchg(i32a, 100, 0, -1)|0; + v = atomic_cmpxchg(i32a, 100, 0, -1); return +(v>>>0); } // CAS element 100: -1 -> 0x5A5A5A5A function do_cas2() { var v = 0; - v = atomic_cmpxchg(i32a, 100, -1, 0x5A5A5A5A)|0; + v = atomic_cmpxchg(i32a, 100, -1, 0x5A5A5A5A); return +(v>>>0); } // CAS element i: 0 -> -1 function do_cas1_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i32a, i>>2, 0, -1)|0; + v = atomic_cmpxchg(i32a, i>>2, 0, -1); return +(v>>>0); } // CAS element i: -1 -> 0x5A5A5A5A function do_cas2_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i32a, i>>2, -1, 0x5A5A5A5A)|0; + v = atomic_cmpxchg(i32a, i>>2, -1, 0x5A5A5A5A); return +(v>>>0); } return { load: do_load, load_i: do_load_i, store: do_store, store_i: do_store_i, xchg: do_xchg, @@ -642,160 +623,160 @@ var loadModule_int16_code = function do_fence() { atomic_fence(); } // Load element 0 function do_load() { var v = 0; - v = atomic_load(i16a, 0)|0; + v = atomic_load(i16a, 0); return v|0; } // Load element i function do_load_i(i) { i = i|0; var v = 0; - v = atomic_load(i16a, i>>1)|0; + v = atomic_load(i16a, i>>1); return v|0; } // Store 37 in element 0 function do_store() { var v = 0; - v = atomic_store(i16a, 0, 37)|0; + v = atomic_store(i16a, 0, 37); return v|0; } // Store 37 in element i function do_store_i(i) { i = i|0; var v = 0; - v = atomic_store(i16a, i>>1, 37)|0; + v = atomic_store(i16a, i>>1, 37); return v|0; } // Exchange 37 into element 200 function do_xchg() { var v = 0; - v = atomic_exchange(i16a, 200, 37)|0; + v = atomic_exchange(i16a, 200, 37); return v|0; } // Exchange 42 into element i function do_xchg_i(i) { i = i|0; var v = 0; - v = atomic_exchange(i16a, i>>1, 42)|0; + v = atomic_exchange(i16a, i>>1, 42); return v|0; } // Add 37 to element 10 function do_add() { var v = 0; - v = atomic_add(i16a, 10, 37)|0; + v = atomic_add(i16a, 10, 37); return v|0; } // Add 37 to element i function do_add_i(i) { i = i|0; var v = 0; - v = atomic_add(i16a, i>>1, 37)|0; + v = atomic_add(i16a, i>>1, 37); return v|0; } // Subtract 148 from element 20 function do_sub() { var v = 0; - v = atomic_sub(i16a, 20, 148)|0; + v = atomic_sub(i16a, 20, 148); return v|0; } // Subtract 148 from element i function do_sub_i(i) { i = i|0; var v = 0; - v = atomic_sub(i16a, i>>1, 148)|0; + v = atomic_sub(i16a, i>>1, 148); return v|0; } // AND 0x3333 into element 30 function do_and() { var v = 0; - v = atomic_and(i16a, 30, 0x3333)|0; + v = atomic_and(i16a, 30, 0x3333); return v|0; } // AND 0x3333 into element i function do_and_i(i) { i = i|0; var v = 0; - v = atomic_and(i16a, i>>1, 0x3333)|0; + v = atomic_and(i16a, i>>1, 0x3333); return v|0; } // OR 0x3333 into element 40 function do_or() { var v = 0; - v = atomic_or(i16a, 40, 0x3333)|0; + v = atomic_or(i16a, 40, 0x3333); return v|0; } // OR 0x3333 into element i function do_or_i(i) { i = i|0; var v = 0; - v = atomic_or(i16a, i>>1, 0x3333)|0; + v = atomic_or(i16a, i>>1, 0x3333); return v|0; } // XOR 0x3333 into element 50 function do_xor() { var v = 0; - v = atomic_xor(i16a, 50, 0x3333)|0; + v = atomic_xor(i16a, 50, 0x3333); return v|0; } // XOR 0x3333 into element i function do_xor_i(i) { i = i|0; var v = 0; - v = atomic_xor(i16a, i>>1, 0x3333)|0; + v = atomic_xor(i16a, i>>1, 0x3333); return v|0; } // CAS element 100: 0 -> -1 function do_cas1() { var v = 0; - v = atomic_cmpxchg(i16a, 100, 0, -1)|0; + v = atomic_cmpxchg(i16a, 100, 0, -1); return v|0; } // CAS element 100: -1 -> 0x5A5A function do_cas2() { var v = 0; - v = atomic_cmpxchg(i16a, 100, -1, 0x5A5A)|0; + v = atomic_cmpxchg(i16a, 100, -1, 0x5A5A); return v|0; } // CAS element i: 0 -> -1 function do_cas1_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i16a, i>>1, 0, -1)|0; + v = atomic_cmpxchg(i16a, i>>1, 0, -1); return v|0; } // CAS element i: -1 -> 0x5A5A function do_cas2_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i16a, i>>1, -1, 0x5A5A)|0; + v = atomic_cmpxchg(i16a, i>>1, -1, 0x5A5A); return v|0; } return { fence: do_fence, load: do_load, load_i: do_load_i, store: do_store, store_i: do_store_i, @@ -933,160 +914,160 @@ var loadModule_uint16_code = var atomic_or = stdlib.Atomics.or; var atomic_xor = stdlib.Atomics.xor; var i16a = new stdlib.SharedUint16Array(heap); // Load element 0 function do_load() { var v = 0; - v = atomic_load(i16a, 0)|0; + v = atomic_load(i16a, 0); return v|0; } // Load element i function do_load_i(i) { i = i|0; var v = 0; - v = atomic_load(i16a, i>>1)|0; + v = atomic_load(i16a, i>>1); return v|0; } // Store 37 in element 0 function do_store() { var v = 0; - v = atomic_store(i16a, 0, 37)|0; + v = atomic_store(i16a, 0, 37); return v|0; } // Store 37 in element i function do_store_i(i) { i = i|0; var v = 0; - v = atomic_store(i16a, i>>1, 37)|0; + v = atomic_store(i16a, i>>1, 37); return v|0; } // Exchange 37 into element 200 function do_xchg() { var v = 0; - v = atomic_exchange(i16a, 200, 37)|0; + v = atomic_exchange(i16a, 200, 37); return v|0; } // Exchange 42 into element i function do_xchg_i(i) { i = i|0; var v = 0; - v = atomic_exchange(i16a, i>>1, 42)|0; + v = atomic_exchange(i16a, i>>1, 42); return v|0; } // Add 37 to element 10 function do_add() { var v = 0; - v = atomic_add(i16a, 10, 37)|0; + v = atomic_add(i16a, 10, 37); return v|0; } // Add 37 to element i function do_add_i(i) { i = i|0; var v = 0; - v = atomic_add(i16a, i>>1, 37)|0; + v = atomic_add(i16a, i>>1, 37); return v|0; } // Subtract 148 from element 20 function do_sub() { var v = 0; - v = atomic_sub(i16a, 20, 148)|0; + v = atomic_sub(i16a, 20, 148); return v|0; } // Subtract 148 from element i function do_sub_i(i) { i = i|0; var v = 0; - v = atomic_sub(i16a, i>>1, 148)|0; + v = atomic_sub(i16a, i>>1, 148); return v|0; } // AND 0x3333 into element 30 function do_and() { var v = 0; - v = atomic_and(i16a, 30, 0x3333)|0; + v = atomic_and(i16a, 30, 0x3333); return v|0; } // AND 0x3333 into element i function do_and_i(i) { i = i|0; var v = 0; - v = atomic_and(i16a, i>>1, 0x3333)|0; + v = atomic_and(i16a, i>>1, 0x3333); return v|0; } // OR 0x3333 into element 40 function do_or() { var v = 0; - v = atomic_or(i16a, 40, 0x3333)|0; + v = atomic_or(i16a, 40, 0x3333); return v|0; } // OR 0x3333 into element i function do_or_i(i) { i = i|0; var v = 0; - v = atomic_or(i16a, i>>1, 0x3333)|0; + v = atomic_or(i16a, i>>1, 0x3333); return v|0; } // XOR 0x3333 into element 50 function do_xor() { var v = 0; - v = atomic_xor(i16a, 50, 0x3333)|0; + v = atomic_xor(i16a, 50, 0x3333); return v|0; } // XOR 0x3333 into element i function do_xor_i(i) { i = i|0; var v = 0; - v = atomic_xor(i16a, i>>1, 0x3333)|0; + v = atomic_xor(i16a, i>>1, 0x3333); return v|0; } // CAS element 100: 0 -> -1 function do_cas1() { var v = 0; - v = atomic_cmpxchg(i16a, 100, 0, -1)|0; + v = atomic_cmpxchg(i16a, 100, 0, -1); return v|0; } // CAS element 100: -1 -> 0x5A5A function do_cas2() { var v = 0; - v = atomic_cmpxchg(i16a, 100, -1, 0x5A5A)|0; + v = atomic_cmpxchg(i16a, 100, -1, 0x5A5A); return v|0; } // CAS element i: 0 -> -1 function do_cas1_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i16a, i>>1, 0, -1)|0; + v = atomic_cmpxchg(i16a, i>>1, 0, -1); return v|0; } // CAS element i: -1 -> 0x5A5A function do_cas2_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i16a, i>>1, -1, 0x5A5A)|0; + v = atomic_cmpxchg(i16a, i>>1, -1, 0x5A5A); return v|0; } return { load: do_load, load_i: do_load_i, store: do_store, store_i: do_store_i, xchg: do_xchg, @@ -1221,160 +1202,160 @@ var loadModule_int8_code = var atomic_or = stdlib.Atomics.or; var atomic_xor = stdlib.Atomics.xor; var i8a = new stdlib.SharedInt8Array(heap); // Load element 0 function do_load() { var v = 0; - v = atomic_load(i8a, 0)|0; + v = atomic_load(i8a, 0); return v|0; } // Load element i function do_load_i(i) { i = i|0; var v = 0; - v = atomic_load(i8a, i)|0; + v = atomic_load(i8a, i); return v|0; } // Store 37 in element 0 function do_store() { var v = 0; - v = atomic_store(i8a, 0, 37)|0; + v = atomic_store(i8a, 0, 37); return v|0; } // Store 37 in element i function do_store_i(i) { i = i|0; var v = 0; - v = atomic_store(i8a, i, 37)|0; + v = atomic_store(i8a, i, 37); return v|0; } // Exchange 37 into element 200 function do_xchg() { var v = 0; - v = atomic_exchange(i8a, 200, 37)|0; + v = atomic_exchange(i8a, 200, 37); return v|0; } // Exchange 42 into element i function do_xchg_i(i) { i = i|0; var v = 0; - v = atomic_exchange(i8a, i, 42)|0; + v = atomic_exchange(i8a, i, 42); return v|0; } // Add 37 to element 10 function do_add() { var v = 0; - v = atomic_add(i8a, 10, 37)|0; + v = atomic_add(i8a, 10, 37); return v|0; } // Add 37 to element i function do_add_i(i) { i = i|0; var v = 0; - v = atomic_add(i8a, i, 37)|0; + v = atomic_add(i8a, i, 37); return v|0; } // Subtract 108 from element 20 function do_sub() { var v = 0; - v = atomic_sub(i8a, 20, 108)|0; + v = atomic_sub(i8a, 20, 108); return v|0; } // Subtract 108 from element i function do_sub_i(i) { i = i|0; var v = 0; - v = atomic_sub(i8a, i, 108)|0; + v = atomic_sub(i8a, i, 108); return v|0; } // AND 0x33 into element 30 function do_and() { var v = 0; - v = atomic_and(i8a, 30, 0x33)|0; + v = atomic_and(i8a, 30, 0x33); return v|0; } // AND 0x33 into element i function do_and_i(i) { i = i|0; var v = 0; - v = atomic_and(i8a, i, 0x33)|0; + v = atomic_and(i8a, i, 0x33); return v|0; } // OR 0x33 into element 40 function do_or() { var v = 0; - v = atomic_or(i8a, 40, 0x33)|0; + v = atomic_or(i8a, 40, 0x33); return v|0; } // OR 0x33 into element i function do_or_i(i) { i = i|0; var v = 0; - v = atomic_or(i8a, i, 0x33)|0; + v = atomic_or(i8a, i, 0x33); return v|0; } // XOR 0x33 into element 50 function do_xor() { var v = 0; - v = atomic_xor(i8a, 50, 0x33)|0; + v = atomic_xor(i8a, 50, 0x33); return v|0; } // XOR 0x33 into element i function do_xor_i(i) { i = i|0; var v = 0; - v = atomic_xor(i8a, i, 0x33)|0; + v = atomic_xor(i8a, i, 0x33); return v|0; } // CAS element 100: 0 -> -1 function do_cas1() { var v = 0; - v = atomic_cmpxchg(i8a, 100, 0, -1)|0; + v = atomic_cmpxchg(i8a, 100, 0, -1); return v|0; } // CAS element 100: -1 -> 0x5A function do_cas2() { var v = 0; - v = atomic_cmpxchg(i8a, 100, -1, 0x5A)|0; + v = atomic_cmpxchg(i8a, 100, -1, 0x5A); return v|0; } // CAS element i: 0 -> -1 function do_cas1_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i8a, i, 0, -1)|0; + v = atomic_cmpxchg(i8a, i, 0, -1); return v|0; } // CAS element i: -1 -> 0x5A function do_cas2_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i8a, i, -1, 0x5A)|0; + v = atomic_cmpxchg(i8a, i, -1, 0x5A); return v|0; } return { load: do_load, load_i: do_load_i, store: do_store, store_i: do_store_i, xchg: do_xchg, @@ -1502,160 +1483,160 @@ var loadModule_uint8_code = var atomic_or = stdlib.Atomics.or; var atomic_xor = stdlib.Atomics.xor; var i8a = new stdlib.SharedUint8Array(heap); // Load element 0 function do_load() { var v = 0; - v = atomic_load(i8a, 0)|0; + v = atomic_load(i8a, 0); return v|0; } // Load element i function do_load_i(i) { i = i|0; var v = 0; - v = atomic_load(i8a, i)|0; + v = atomic_load(i8a, i); return v|0; } // Store 37 in element 0 function do_store() { var v = 0; - v = atomic_store(i8a, 0, 37)|0; + v = atomic_store(i8a, 0, 37); return v|0; } // Store 37 in element i function do_store_i(i) { i = i|0; var v = 0; - v = atomic_store(i8a, i, 37)|0; + v = atomic_store(i8a, i, 37); return v|0; } // Exchange 37 into element 200 function do_xchg() { var v = 0; - v = atomic_exchange(i8a, 200, 37)|0; + v = atomic_exchange(i8a, 200, 37); return v|0; } // Exchange 42 into element i function do_xchg_i(i) { i = i|0; var v = 0; - v = atomic_exchange(i8a, i, 42)|0; + v = atomic_exchange(i8a, i, 42); return v|0; } // Add 37 to element 10 function do_add() { var v = 0; - v = atomic_add(i8a, 10, 37)|0; + v = atomic_add(i8a, 10, 37); return v|0; } // Add 37 to element i function do_add_i(i) { i = i|0; var v = 0; - v = atomic_add(i8a, i, 37)|0; + v = atomic_add(i8a, i, 37); return v|0; } // Subtract 108 from element 20 function do_sub() { var v = 0; - v = atomic_sub(i8a, 20, 108)|0; + v = atomic_sub(i8a, 20, 108); return v|0; } // Subtract 108 from element i function do_sub_i(i) { i = i|0; var v = 0; - v = atomic_sub(i8a, i, 108)|0; + v = atomic_sub(i8a, i, 108); return v|0; } // AND 0x33 into element 30 function do_and() { var v = 0; - v = atomic_and(i8a, 30, 0x33)|0; + v = atomic_and(i8a, 30, 0x33); return v|0; } // AND 0x33 into element i function do_and_i(i) { i = i|0; var v = 0; - v = atomic_and(i8a, i, 0x33)|0; + v = atomic_and(i8a, i, 0x33); return v|0; } // OR 0x33 into element 40 function do_or() { var v = 0; - v = atomic_or(i8a, 40, 0x33)|0; + v = atomic_or(i8a, 40, 0x33); return v|0; } // OR 0x33 into element i function do_or_i(i) { i = i|0; var v = 0; - v = atomic_or(i8a, i, 0x33)|0; + v = atomic_or(i8a, i, 0x33); return v|0; } // XOR 0x33 into element 50 function do_xor() { var v = 0; - v = atomic_xor(i8a, 50, 0x33)|0; + v = atomic_xor(i8a, 50, 0x33); return v|0; } // XOR 0x33 into element i function do_xor_i(i) { i = i|0; var v = 0; - v = atomic_xor(i8a, i, 0x33)|0; + v = atomic_xor(i8a, i, 0x33); return v|0; } // CAS element 100: 0 -> -1 function do_cas1() { var v = 0; - v = atomic_cmpxchg(i8a, 100, 0, -1)|0; + v = atomic_cmpxchg(i8a, 100, 0, -1); return v|0; } // CAS element 100: -1 -> 0x5A function do_cas2() { var v = 0; - v = atomic_cmpxchg(i8a, 100, -1, 0x5A)|0; + v = atomic_cmpxchg(i8a, 100, -1, 0x5A); return v|0; } // CAS element i: 0 -> -1 function do_cas1_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i8a, i, 0, -1)|0; + v = atomic_cmpxchg(i8a, i, 0, -1); return v|0; } // CAS element i: -1 -> 0x5A function do_cas2_i(i) { i = i|0; var v = 0; - v = atomic_cmpxchg(i8a, i, -1, 0x5A)|0; + v = atomic_cmpxchg(i8a, i, -1, 0x5A); return v|0; } return { load: do_load, load_i: do_load_i, store: do_store, store_i: do_store_i, xchg: do_xchg, @@ -1866,14 +1847,14 @@ setARMHwCapFlags('vfp'); asmCompile('stdlib', 'ffi', 'heap', USE_ASM + ` var atomic_exchange = stdlib.Atomics.exchange; var i8a = new stdlib.SharedInt8Array(heap); function do_xchg() { var v = 0; - v = atomic_exchange(i8a, 200, 37) | 0; + v = atomic_exchange(i8a, 200, 37); return v|0; } return { xchg: do_xchg } `);