aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-02-20 17:03:25 -0500
committerAlon Zakai <alonzakai@gmail.com>2012-02-20 17:03:25 -0500
commit3c61023b189c412302981d6d029e21a58e9b428a (patch)
tree942c8470472a33c202939ec577fd397c08dea054 /src/parseTools.js
parent8804769763b0dd4c2ec8ca11f81cf24577882085 (diff)
parent7cad64ba5c02c6efa80b6686f27439133d103978 (diff)
Merge branch 'incoming' of github.com:kripken/emscripten into incoming
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 5a92335e..d3cb7795 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1699,9 +1699,17 @@ function processMathop(item) {
var inType = item.param1.type;
var outType = item.type;
if (inType in Runtime.INT_TYPES && outType in Runtime.FLOAT_TYPES) {
- return makeInlineCalculation('tempDoubleI32[0]=VALUE[0],tempDoubleI32[1]=VALUE[1],tempDoubleF64[0]', ident1, 'tempI64');
+ if (legalizedI64s) {
+ return '(tempDoubleI32[0]=' + ident1 + '$0, tempDoubleI32[1]=' + ident1 + '$1, tempDoubleF64[0])';
+ } else {
+ return makeInlineCalculation('tempDoubleI32[0]=VALUE[0],tempDoubleI32[1]=VALUE[1],tempDoubleF64[0]', ident1, 'tempI64');
+ }
} else if (inType in Runtime.FLOAT_TYPES && outType in Runtime.INT_TYPES) {
- return '(tempDoubleF64[0]=' + ident1 + ',[tempDoubleI32[0],tempDoubleI32[1]])';
+ if (legalizedI64s) {
+ return 'tempDoubleF64[0]=' + ident1 + '; ' + finish(['tempDoubleI32[0]','tempDoubleI32[1]']);
+ } else {
+ return '(tempDoubleF64[0]=' + ident1 + ',[tempDoubleI32[0],tempDoubleI32[1]])';
+ }
} else {
throw 'Invalid I64_MODE1 bitcast: ' + dump(item) + ' : ' + item.param1.type;
}