aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-17 17:31:57 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-18 13:00:49 -0700
commitacb4008cc0fc67d26e9fea45284ac6331f17f3c1 (patch)
treed831d90bd36cf2f4995049c45561259f3408fa16
parent5708083df9706cc22c8570d4c933a170f5936c4a (diff)
vector loads and stores
-rw-r--r--src/jsifier.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index cb80e303..e25296e5 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -936,6 +936,14 @@ function JSify(data, functionsOnly, givenFunctions) {
if (item.pointer.intertype == 'value') {
impl = getVarImpl(item.funcData, item.ident);
}
+ if (item.valueType[item.valueType.length-1] === '>') {
+ // vector store TODO: move to makeSetValue?
+ var base = getVectorBaseType(item.valueType);
+ return '(' + makeSetValue(item.ident, 0, value + '.x', base, 0, 0, item.align) + ',' +
+ makeSetValue(item.ident, 4, value + '.y', base, 0, 0, item.align) + ',' +
+ makeSetValue(item.ident, 8, value + '.z', base, 0, 0, item.align) + ',' +
+ makeSetValue(item.ident, 12, value + '.w', base, 0, 0, item.align) + ')';
+ }
switch (impl) {
case VAR_NATIVIZED:
if (isNumber(item.ident)) {
@@ -1305,7 +1313,7 @@ function JSify(data, functionsOnly, givenFunctions) {
var value = finalizeLLVMParameter(item.pointer);
if (item.valueType[item.valueType.length-1] === '>') {
// vector load
- var base = getVectorBaseType(item.type);
+ var base = getVectorBaseType(item.valueType);
return base + '32x4(' + makeGetValue(value, 0, base, 0, item.unsigned, 0, item.align) + ',' +
makeGetValue(value, 4, base, 0, item.unsigned, 0, item.align) + ',' +
makeGetValue(value, 8, base, 0, item.unsigned, 0, item.align) + ',' +