diff options
author | alon@honor <none@none> | 2010-08-28 18:24:52 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-08-28 18:24:52 -0700 |
commit | 73732309f32e7d98885fd2acf2031751d5b1c81a (patch) | |
tree | 9e2751d9a12d06b98f635d3d7a6e041957134d08 /src | |
parent | 22b8a96321ca0e284fb96916943286d7f4b49187 (diff) |
fcmp fix & better testing
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parser.js b/src/parser.js index 299523cc..42613cb4 100644 --- a/src/parser.js +++ b/src/parser.js @@ -2167,22 +2167,24 @@ function JSify(data) { case 'ult': case 'slt': return '0+(' + ident + ' < ' + ident2 + ')'; case 'ne': case 'une': return '0+(' + ident + ' != ' + ident2 + ')'; case 'eq': return '0+(' + ident + ' == ' + ident2 + ')'; + default: throw 'Unknown icmp variant: ' + variant } } case 'fcmp': { switch (variant) { case 'uge': case 'sge': return '0+(' + ident + ' >= ' + ident2 + ')'; case 'ule': case 'sle': return '0+(' + ident + ' <= ' + ident2 + ')'; - case 'ugt': case 'sgt': return '0+(' + ident + ' > ' + ident2 + ')'; - case 'ult': case 'slt': return '0+(' + ident + ' < ' + ident2 + ')'; + case 'ugt': case 'sgt': case 'ogt': return '0+(' + ident + ' > ' + ident2 + ')'; + case 'ult': case 'slt': case 'olt': return '0+(' + ident + ' < ' + ident2 + ')'; case 'ne': case 'une': return '0+(' + ident + ' != ' + ident2 + ')'; case 'eq': return '0+(' + ident + ' == ' + ident2 + ')'; + default: throw 'Unknown fcmp variant: ' + variant } } case 'zext': case 'fpext': case 'trunc': case 'sext': return ident; case 'select': return '(' + ident + ' ? ' + ident3 + ' : ' + ident4 + ')'; + default: throw 'Unknown mathcmp op: ' + item.op } - return '&*&*&*&*&*&' + item.op; } }); /* return [{ |