Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

Commit 4320a35

Browse files
committed
Update benchmarks not to use zero() anymore.
1 parent 8773a96 commit 4320a35

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/benchmarks/aobench.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
orthoBasis(basis, isect.n);
279279

280280
var occlusion = 0;
281-
var occlusionx4 = SIMD.float32x4.zero();
281+
var occlusionx4 = SIMD.float32x4.splat(0.0);
282282

283283
for (j = 0; j < ntheta; j++) {
284284
for (i = 0; i < nphi; i += 4) {
@@ -314,14 +314,14 @@
314314
};
315315
var occIsectB = {
316316
p: {
317-
x: SIMD.float32x4.zero(),
318-
y: SIMD.float32x4.zero(),
319-
z: SIMD.float32x4.zero()
317+
x: SIMD.float32x4.splat(0.0),
318+
y: SIMD.float32x4.splat(0.0),
319+
z: SIMD.float32x4.splat(0.0)
320320
},
321321
n: {
322-
x: SIMD.float32x4.zero(),
323-
y: SIMD.float32x4.zero(),
324-
z: SIMD.float32x4.zero()
322+
x: SIMD.float32x4.splat(0.0),
323+
y: SIMD.float32x4.splat(0.0),
324+
z: SIMD.float32x4.splat(0.0)
325325
}
326326
};
327327

@@ -363,10 +363,10 @@
363363
SIMD.float32x4.splat(sphere.radius * sphere.radius));
364364
var D = SIMD.float32x4.sub(SIMD.float32x4.mul(B, B), C);
365365

366-
var cond1 = SIMD.float32x4.greaterThan(D, SIMD.float32x4.zero());
366+
var cond1 = SIMD.float32x4.greaterThan(D, SIMD.float32x4.splat(0.0));
367367
if (cond1.signMask) {
368368
var t2 = SIMD.float32x4.fromInt32x4Bits(SIMD.int32x4.and(cond1, SIMD.int32x4.fromFloat32x4Bits(SIMD.float32x4.sub(SIMD.float32x4.neg(B), SIMD.float32x4.sqrt(D)))));
369-
var cond2 = SIMD.int32x4.and(SIMD.float32x4.greaterThan(t2, SIMD.float32x4.zero()),
369+
var cond2 = SIMD.int32x4.and(SIMD.float32x4.greaterThan(t2, SIMD.float32x4.splat(0.0)),
370370
SIMD.float32x4.lessThan(t2, isectA.t));
371371
if (cond2.signMask) {
372372
isectA.t = SIMD.float32x4.fromInt32x4Bits(
@@ -428,7 +428,7 @@
428428
SIMD.float32x4.add(SIMD.float32x4.mul(orgy, SIMD.float32x4.splat(plane.n.y)),
429429
SIMD.float32x4.mul(orgz, SIMD.float32x4.splat(plane.n.z))));
430430
var t2 = SIMD.float32x4.fromInt32x4Bits(SIMD.int32x4.and(cond1, SIMD.int32x4.fromFloat32x4Bits(SIMD.float32x4.div(SIMD.float32x4.neg(SIMD.float32x4.add(dp, d)), v))));
431-
var cond2 = SIMD.int32x4.and(SIMD.float32x4.greaterThan(t2, SIMD.float32x4.zero()), SIMD.float32x4.lessThan(t2, isectA.t));
431+
var cond2 = SIMD.int32x4.and(SIMD.float32x4.greaterThan(t2, SIMD.float32x4.splat(0.0)), SIMD.float32x4.lessThan(t2, isectA.t));
432432
if (cond2.signMask) {
433433
isectA.t = SIMD.float32x4.fromInt32x4Bits(SIMD.int32x4.or(SIMD.int32x4.and(cond2, SIMD.int32x4.fromFloat32x4Bits(t2)),
434434
SIMD.int32x4.and(SIMD.int32x4.not(cond2), SIMD.int32x4.fromFloat32x4Bits(isectA.t))));

src/benchmarks/averageFloat32x4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
function simdAverage(n) {
5454
var ax4_length = ax4.length;
5555
for (var i = 0; i < n; ++i) {
56-
var sum4 = SIMD.float32x4.zero();
56+
var sum4 = SIMD.float32x4.splat(0.0);
5757
for (var j = 0; j < ax4_length; ++j) {
5858
sum4 = SIMD.float32x4.add(sum4, ax4.getAt(j));
5959
}

src/benchmarks/averageFloat64x2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
function simdAverage(n) {
5555
var ax2_length = ax2.length;
5656
for (var i = 0; i < n; ++i) {
57-
var sum2 = SIMD.float64x2.zero();
57+
var sum2 = SIMD.float64x2.splat(0.0);
5858
for (var j = 0; j < ax2_length; ++j) {
5959
sum2 = SIMD.float64x2.add(sum2, ax2.getAt(j));
6060
}

src/benchmarks/sinx4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
emm0 = SIMD.int32x4.shiftLeft(emm0, 29);
122122

123123
emm2 = SIMD.int32x4.and(emm2, _pi32_2);
124-
emm2 = SIMD.int32x4.equal(emm2, SIMD.int32x4.zero());
124+
emm2 = SIMD.int32x4.equal(emm2, SIMD.int32x4.splat(0));
125125

126126
swap_sign_bit = SIMD.float32x4.fromInt32x4Bits(emm0);
127127
poly_mask = SIMD.float32x4.fromInt32x4Bits(emm2);

src/benchmarks/transform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
function simdVertexTransform(n) {
8181
for (var i = 0; i < n; i++) {
8282
var xxxx = SIMD.float32x4.shuffle(Vx4.getAt(0), SIMD.XXXX);
83-
var z = SIMD.float32x4.zero();
83+
var z = SIMD.float32x4.splat(0.0);
8484
z = SIMD.float32x4.add(z, SIMD.float32x4.mul(xxxx, Tx4.getAt(0)));
8585
var yyyy = SIMD.float32x4.shuffle(Vx4.getAt(0), SIMD.YYYY);
8686
z = SIMD.float32x4.add(z, SIMD.float32x4.mul(yyyy, Tx4.getAt(1)));

0 commit comments

Comments
 (0)