aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-18 14:04:46 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-18 14:04:46 -0700
commit8f14b5c6400133e88c89060ce978114b2455d667 (patch)
tree0a5189dfe10185eb79d1b4adcd958c477aa39471 /src/parseTools.js
parentf96f5dfda08a059647e431f6f084ff7a2d65bc74 (diff)
fix simd math operations and improve test
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 4988f766..bc5b3870 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -2359,10 +2359,14 @@ function processMathop(item) {
// 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] + ')';
- case 'mul' : case 'fmul': return 'SIMD.mul(' + idents[0] + ',' + idents[1] + ')';
- case 'udiv': case 'fdiv': return 'SIMD.div(' + idents[0] + ',' + idents[1] + ')';
+ case 'fadd': return 'SIMD.add(' + idents[0] + ',' + idents[1] + ')';
+ case 'fsub': return 'SIMD.sub(' + idents[0] + ',' + idents[1] + ')';
+ case 'fmul': return 'SIMD.mul(' + idents[0] + ',' + idents[1] + ')';
+ case 'fdiv': return 'SIMD.div(' + idents[0] + ',' + idents[1] + ')';
+ case 'add' : return 'SIMD.addu32(' + idents[0] + ',' + idents[1] + ')';
+ case 'sub' : return 'SIMD.subu32(' + idents[0] + ',' + idents[1] + ')';
+ case 'mul' : return 'SIMD.mulu32(' + idents[0] + ',' + idents[1] + ')';
+ case 'udiv': return 'SIMD.divu32(' + idents[0] + ',' + idents[1] + ')';
case 'bitcast': {
var inType = item.params[0].type;
var outType = item.type;