MCPcopy Create free account
hub / github.com/nodejs/node / Module

Function Module

deps/v8/test/mjsunit/asm/atomics-and.js:5–60  ·  view source on GitHub ↗
(stdlib, foreign, heap, offset)

Source from the content-addressed store, hash-verified

3// found in the LICENSE file.
4
5function Module(stdlib, foreign, heap, offset) {
6 "use asm";
7 var MEM8 = new stdlib.Int8Array(heap, offset);
8 var MEM16 = new stdlib.Int16Array(heap, offset);
9 var MEM32 = new stdlib.Int32Array(heap, offset);
10 var MEMU8 = new stdlib.Uint8Array(heap, offset);
11 var MEMU16 = new stdlib.Uint16Array(heap, offset);
12 var MEMU32 = new stdlib.Uint32Array(heap, offset);
13 var and = stdlib.Atomics.and;
14 var fround = stdlib.Math.fround;
15
16 function andi8(i, x) {
17 i = i | 0;
18 x = x | 0;
19 return and(MEM8, i, x)|0;
20 }
21
22 function andi16(i, x) {
23 i = i | 0;
24 x = x | 0;
25 return and(MEM16, i, x)|0;
26 }
27
28 function andi32(i, x) {
29 i = i | 0;
30 x = x | 0;
31 return and(MEM32, i, x)|0;
32 }
33
34 function andu8(i, x) {
35 i = i | 0;
36 x = x >>> 0;
37 return and(MEMU8, i, x)>>>0;
38 }
39
40 function andu16(i, x) {
41 i = i | 0;
42 x = x >>> 0;
43 return and(MEMU16, i, x)>>>0;
44 }
45
46 function andu32(i, x) {
47 i = i | 0;
48 x = x >>> 0;
49 return and(MEMU32, i, x)>>>0;
50 }
51
52 return {
53 andi8: andi8,
54 andi16: andi16,
55 andi32: andi32,
56 andu8: andu8,
57 andu16: andu16,
58 andu32: andu32,
59 };
60}
61
62function clearArray() {

Callers 1

atomics-and.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected