aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 649d6fed..aeb85426 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -324,6 +324,10 @@ function countNormalArgs(type, out, legalized) {
return ret;
}
+function getVectorSize(type) {
+ return parseInt(type.substring(1, type.indexOf(' ')));
+}
+
function getVectorBaseType(type) {
Types.usesSIMD = true;
switch (type) {
@@ -335,6 +339,17 @@ function getVectorBaseType(type) {
}
}
+function getVectorNativeType(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 'i32';
+ default: throw 'unknown vector type ' + type;
+ }
+}
+
function addIdent(token) {
token.ident = token.text;
return token;