Confirmed users
149
edits
| Line 9: | Line 9: | ||
== 1. Simd.add(arrayA, indexA, arrayB, indexB, count) == | == 1. Simd.add(arrayA, indexA, arrayB, indexB, count) == | ||
1. If not arrayA is an object, throw TypeError | |||
2. Let indexA be ToUint32(indexA) | |||
3. If not arrayB is an object, throw TypeError | |||
4. Let indexB be ToUint32(indexB) | |||
5. Let count be ToUint32(count) | |||
6. Throw TypeError, if arrayA is not a TypeArray (the class is either Float32Array, Float64 etc.) | |||
7. Throw TypeError, if the internal property [[ Class ]] of arrayA is different from internal property [[ Class ]] of arrayB | |||
8. Throw RangeError if indexA + count is larger than the length of the arrayA | |||
9. Throw RangeError if indexB + count is larger than the length of the arrayB | |||
10. Let k be 0 | |||
11. Repeat, while k < count | |||
a. Let a be arrayA[indexA + k] | |||
b. Let b be arrayB[indexB + k] | |||
c. Assign a + b to arrayA[indexA + k] | |||
d. Increase k by 1 | |||
= Example = | = Example = | ||