ecmascript_simd icon indicating copy to clipboard operation
ecmascript_simd copied to clipboard

Coerce lane indexes with ToNumber().

Open stoklund opened this issue 9 years ago • 3 comments

SIMD functions that take a lane index (extractLane, replaceLane, swizzle, shuffle) should use ToNumber() to coerce the lane index to a number before checking that the index is an integer in range.

This behavior corresponds to the SIMDToLane() function in the SIMD.js specification.

This fixes issues #319 and #237.

stoklund avatar Mar 15 '16 19:03 stoklund

I think you meant #329 instead of 319, right?

PeterJensen avatar Mar 15 '16 21:03 PeterJensen

Oops, you are right. Fixed.

stoklund avatar Mar 15 '16 21:03 stoklund

Thanks, Peter. I found another mistake in the validLaneIndex() function.

stoklund avatar Mar 15 '16 22:03 stoklund