diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-23 17:32:52 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-23 17:32:52 -0800 |
commit | 76a81417feb8297e33ebca5982b90ac9ab3032f0 (patch) | |
tree | 92bbfb56f842dd29f0c00613c9568aca667e8c7e /src/parseTools.js | |
parent | 4f33436231371f7fe5402c0c0a22076820aa76b8 (diff) |
unaligned loads and stores for floats and doubles
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 5b2df3a0..b287b237 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -933,7 +933,11 @@ function makeGetValue(ptr, pos, type, noNeedFirst, unsigned, ignore, align, noSa ret += makeI64('tempBigInt', 'tempBigInt2'); } } else { - assert(0, 'We do not support unaligned float/double reads yet'); + if (type == 'float') { + ret += 'copyTempFloat(' + getFastValue(ptr, '+', pos) + '),tempDoubleF32[0]'; + } else { + ret += 'copyTempDouble(' + getFastValue(ptr, '+', pos) + '),tempDoubleF64[0]'; + } } ret += ')'; return ret; @@ -1018,7 +1022,8 @@ function makeSetValue(ptr, pos, value, type, noNeedFirst, ignore, align, noSafe) ret += makeSetValue(ptr, getFastValue(pos, '+', Runtime.getNativeTypeSize('i32')), 'tempPair[1]', 'i32', noNeedFirst, ignore, align) + ';'; } } else { - assert(0, 'We do not support unaligned float/double writes yet'); + ret += makeSetValue('tempDoublePtr', 0, value, type, noNeedFirst, ignore, 8) + ';'; + ret += makeCopyValues(getFastValue(ptr, '+', pos), 'tempDoublePtr', Runtime.getNativeTypeSize(type), type, null, align); } return ret; } |