aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-18 12:59:55 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-18 13:00:50 -0700
commit4cdc5fea95821751396b8a8bc350bf6b1eaf01d4 (patch)
treebfae7f78c9cca304dd4610307b0ef55488b382a8 /src/parseTools.js
parentd32d18af61f4b9f83036d5573cad747607023bf7 (diff)
integrate the SIMD polyfill code
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 385482a7..649d6fed 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -325,8 +325,11 @@ function countNormalArgs(type, out, legalized) {
}
function getVectorBaseType(type) {
+ Types.usesSIMD = true;
switch (type) {
+ case '<2 x float>':
case '<4 x float>': return 'float';
+ case '<2 x i32>':
case '<4 x i32>': return 'uint';
default: throw 'unknown vector type ' + type;
}
@@ -2339,6 +2342,7 @@ function processMathop(item) {
if (type[0] === '<' && type[type.length-1] !== '*') {
// vector/SIMD operation
+ Types.usesSIMD = true;
switch (op) {
case 'add' : case 'fadd': return 'SIMD.add(' + idents[0] + ',' + idents[1] + ')';
case 'sub' : case 'fsub': return 'SIMD.sub(' + idents[0] + ',' + idents[1] + ')';
@@ -2634,6 +2638,7 @@ var SIMDLane = ['X', 'Y', 'Z', 'W'];
var simdLane = ['x', 'y', 'z', 'w'];
function ensureVector(ident, base) {
+ Types.usesSIMD = true;
return ident == 0 ? base + '32x4.zero()' : ident;
}