<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[189549] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/189549">189549</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-09-09 14:01:03 -0700 (Wed, 09 Sep 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Implement the relational instructions for doubles in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=148999
Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-09
Reviewed by Filip Pizlo.
Implements the relational instructions for doubles (float64) in
WebAssembly. Also pass the values into the test functions as Mark Lam
suggested in https://bugs.webkit.org/show_bug.cgi?id=148882#c3
* tests/stress/wasm-relational.js:
* tests/stress/wasm/relational.wasm:
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::buildRelationalF64):
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseExpressionI32):
(JSC::WASMFunctionParser::parseRelationalF64ExpressionI32):
* wasm/WASMFunctionParser.h:
* wasm/WASMFunctionSyntaxChecker.h:
(JSC::WASMFunctionSyntaxChecker::buildRelationalI32):
(JSC::WASMFunctionSyntaxChecker::buildRelationalF64):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmrelationalwasm">trunk/Source/JavaScriptCore/tests/stress/wasm/relational.wasm</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmrelationaljs">trunk/Source/JavaScriptCore/tests/stress/wasm-relational.js</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionCompilerh">trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionParsercpp">trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionParserh">trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionSyntaxCheckerh">trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (189548 => 189549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-09-09 20:58:44 UTC (rev 189548)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-09-09 21:01:03 UTC (rev 189549)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-09-09 Sukolsak Sakshuwong <sukolsak@gmail.com>
+
+ Implement the relational instructions for doubles in WebAssembly
+ https://bugs.webkit.org/show_bug.cgi?id=148999
+
+ Reviewed by Filip Pizlo.
+
+ Implements the relational instructions for doubles (float64) in
+ WebAssembly. Also pass the values into the test functions as Mark Lam
+ suggested in https://bugs.webkit.org/show_bug.cgi?id=148882#c3
+
+ * tests/stress/wasm-relational.js:
+ * tests/stress/wasm/relational.wasm:
+ * wasm/WASMFunctionCompiler.h:
+ (JSC::WASMFunctionCompiler::buildRelationalF64):
+ * wasm/WASMFunctionParser.cpp:
+ (JSC::WASMFunctionParser::parseExpressionI32):
+ (JSC::WASMFunctionParser::parseRelationalF64ExpressionI32):
+ * wasm/WASMFunctionParser.h:
+ * wasm/WASMFunctionSyntaxChecker.h:
+ (JSC::WASMFunctionSyntaxChecker::buildRelationalI32):
+ (JSC::WASMFunctionSyntaxChecker::buildRelationalF64):
+
</ins><span class="cx"> 2015-09-09 Saam barati <sbarati@apple.com>
</span><span class="cx">
</span><span class="cx"> DFG should have a debugging option that runs a phase that flushes all locals
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmrelationalwasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm/relational.wasm (189548 => 189549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm/relational.wasm        2015-09-09 20:58:44 UTC (rev 189548)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm/relational.wasm        2015-09-09 21:01:03 UTC (rev 189549)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><del>-wasmc\xFF\xFF\xFF\xFF\x80.\xA1\xA1\x80.\xA1\xA2\x801\xA1\xA2\x801\xA1\xA1\x804\x80\xA2\x804\xA1\xA1\x808\xA1\xA1\x808\xA2\xA1\x80<\xA2\x80\x80<\xA1\xA1\x80@\xA1\xA1\x80@\xA1\xA2\x805\xA2\x80\x805\x80\xA2\x809\xA2\x80\x809\x80\xA2\x80=\x80\xA2\x80=\xA2\x80\x80A\x80\xA2\x80A\xA2\x80equalTrueequalFalsenotEqualTruenotEqualFalselessThanTruelessThanFalselessThanOrEqualTruelessThanOrEqualFalsegreaterThanTruegreaterThanFalse        greaterThanOrEqualTrue
-greaterThanOrEqualFalseunsignedLessThanTrueunsignedLessThanFalse-unsignedLessThanOrEqualTrueunsignedLessThanOrEqualFalseunsignedGreaterThanTrueunsignedGreaterThanFalseunsignedGreaterThanOrEqualTrueunsignedGreaterThanOrEqualFalse
</del><span class="cx">\ No newline at end of file
</span><ins>+wasmE\x80.\xC0\xC1\x801\xC0\xC1\x804\xC0\xC1\x808\xC0\xC1\x80<\xC0\xC1\x80@\xC0\xC1\x805\xC0\xC1\x809\xC0\xC1\x80=\xC0\xC1\x80A\xC0\xC1\x800\xA0\xA1\x803\xA0\xA1\x807\xA0\xA1\x80;\xA0\xA1\x80?\xA0\xA1\x80C\xA0\xA1equalnotEquallessThanlessThanOrEqualgreaterThangreaterThanOrEqualunsignedLessThanunsignedLessThanOrEqualunsignedGreaterThanunsignedGreaterThanOrEqual        doubleEqual
+doubleNotEqualdoubleLessThandoubleLessThanOrEqual+doubleGreaterThandoubleGreaterThanOrEqual
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmrelationaljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-relational.js (189548 => 189549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-relational.js        2015-09-09 20:58:44 UTC (rev 189548)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-relational.js        2015-09-09 21:01:03 UTC (rev 189549)
</span><span class="lines">@@ -11,130 +11,165 @@
</span><span class="cx"> function asmModule(global, env, buffer) {
</span><span class="cx"> "use asm";
</span><span class="cx">
</span><del>- function equalTrue() {
- return 1 == 1;
</del><ins>+ function equal(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return (x == y) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function equalFalse() {
- return 1 == 2;
</del><ins>+ function notEqual(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return (x != y) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function notEqualTrue() {
- return 1 != 2;
</del><ins>+ function lessThan(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return ((x | 0) < (y | 0)) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function notEqualFalse() {
- return 1 != 1;
</del><ins>+ function lessThanOrEqual(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return ((x | 0) <= (y | 0)) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function lessThanTrue() {
- return -1 < 2;
</del><ins>+ function greaterThan(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return ((x | 0) > (y | 0)) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function lessThanFalse() {
- return 1 < 1;
</del><ins>+ function greaterThanOrEqual(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return ((x | 0) >= (y | 0)) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function lessThanOrEqualTrue() {
- return 1 <= 1;
</del><ins>+ function unsignedLessThan(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return ((x >>> 0) < (y >>> 0)) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function lessThanOrEqualFalse() {
- return 2 <= 1;
</del><ins>+ function unsignedLessThanOrEqual(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return ((x >>> 0) <= (y >>> 0)) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function greaterThanTrue() {
- return 2 > -1;
</del><ins>+ function unsignedGreaterThan(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return ((x >>> 0) > (y >>> 0)) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function greaterThanFalse() {
- return 1 > 1;
</del><ins>+ function unsignedGreaterThanOrEqual(x, y) {
+ x = x | 0;
+ y = y | 0;
+ return ((x >>> 0) >= (y >>> 0)) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function greaterThanOrEqualTrue() {
- return 1 >= 1;
</del><ins>+ function doubleEqual(x, y) {
+ x = +x;
+ y = +y;
+ return (x == y) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function greaterThanOrEqualFalse() {
- return 1 >= 2;
</del><ins>+ function doubleNotEqual(x, y) {
+ x = +x;
+ y = +y;
+ return (x != y) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function unsignedLessThanTrue() {
- return (2 >>> 0) < (-1 >>> 0);
</del><ins>+ function doubleLessThan(x, y) {
+ x = +x;
+ y = +y;
+ return (x < y) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function unsignedLessThanFalse() {
- return (-1 >>> 0) < (2 >>> 0);
</del><ins>+ function doubleLessThanOrEqual(x, y) {
+ x = +x;
+ y = +y;
+ return (x <= y) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function unsignedLessThanOrEqualTrue() {
- return (2 >>> 0) <= (-1 >>> 0);
</del><ins>+ function doubleGreaterThan(x, y) {
+ x = +x;
+ y = +y;
+ return (x > y) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function unsignedLessThanOrEqualFalse() {
- return (-1 >>> 0) <= (2 >>> 0);
</del><ins>+ function doubleGreaterThanOrEqual(x, y) {
+ x = +x;
+ y = +y;
+ return (x >= y) | 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- function unsignedGreaterThanTrue() {
- return (-1 >>> 0) > (2 >>> 0);
- }
</del><ins>+ return {
+ equal: equal,
+ notEqual: notEqual,
+ lessThan: lessThan,
+ lessThanOrEqual: lessThanOrEqual,
+ greaterThan: greaterThan,
+ greaterThanOrEqual: greaterThanOrEqual,
+ unsignedLessThan: unsignedLessThan,
+ unsignedLessThanOrEqual: unsignedLessThanOrEqual,
+ unsignedGreaterThan: unsignedGreaterThan,
+ unsignedGreaterThanOrEqual: unsignedGreaterThanOrEqual,
</ins><span class="cx">
</span><del>- function unsignedGreaterThanFalse() {
- return (2 >>> 0) > (-1 >>> 0);
- }
-
- function unsignedGreaterThanOrEqualTrue() {
- return (-1 >>> 0) >= (2 >>> 0);
- }
-
- function unsignedGreaterThanOrEqualFalse() {
- return (2 >>> 0) >= (-1 >>> 0);
- }
-
- return {
- equalTrue: equalTrue,
- equalFalse: equalFalse,
- notEqualTrue: notEqualTrue,
- notEqualFalse: notEqualFalse,
- lessThanTrue: lessThanTrue,
- lessThanFalse: lessThanFalse,
- lessThanOrEqualTrue: lessThanOrEqualTrue,
- lessThanOrEqualFalse: lessThanOrEqualFalse,
- greaterThanTrue: greaterThanTrue,
- greaterThanFalse: greaterThanFalse,
- greaterThanOrEqualTrue: greaterThanOrEqualTrue,
- greaterThanOrEqualFalse: greaterThanOrEqualFalse,
- unsignedLessThanTrue: unsignedLessThanTrue,
- unsignedLessThanFalse: unsignedLessThanFalse,
- unsignedLessThanOrEqualTrue: unsignedLessThanOrEqualTrue,
- unsignedLessThanOrEqualFalse: unsignedLessThanOrEqualFalse,
- unsignedGreaterThanTrue: unsignedGreaterThanTrue,
- unsignedGreaterThanFalse: unsignedGreaterThanFalse,
- unsignedGreaterThanOrEqualTrue: unsignedGreaterThanOrEqualTrue,
- unsignedGreaterThanOrEqualFalse: unsignedGreaterThanOrEqualFalse,
</del><ins>+ doubleEqual: doubleEqual,
+ doubleNotEqual: doubleNotEqual,
+ doubleLessThan: doubleLessThan,
+ doubleLessThanOrEqual: doubleLessThanOrEqual,
+ doubleGreaterThan: doubleGreaterThan,
+ doubleGreaterThanOrEqual: doubleGreaterThanOrEqual,
</ins><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> var module = loadWebAssembly("wasm/relational.wasm");
</span><span class="cx">
</span><del>-shouldBe(module.equalTrue(), 1);
-shouldBe(module.equalFalse(), 0);
-shouldBe(module.notEqualTrue(), 1);
-shouldBe(module.notEqualFalse(), 0);
-shouldBe(module.lessThanTrue(), 1);
-shouldBe(module.lessThanFalse(), 0);
-shouldBe(module.lessThanOrEqualTrue(), 1);
-shouldBe(module.lessThanOrEqualFalse(), 0);
-shouldBe(module.greaterThanTrue(), 1);
-shouldBe(module.greaterThanFalse(), 0);
-shouldBe(module.greaterThanOrEqualTrue(), 1);
-shouldBe(module.greaterThanOrEqualFalse(), 0);
-shouldBe(module.unsignedLessThanTrue(), 1);
-shouldBe(module.unsignedLessThanFalse(), 0);
-shouldBe(module.unsignedLessThanOrEqualTrue(), 1);
-shouldBe(module.unsignedLessThanOrEqualFalse(), 0);
-shouldBe(module.unsignedGreaterThanTrue(), 1);
-shouldBe(module.unsignedGreaterThanFalse(), 0);
-shouldBe(module.unsignedGreaterThanOrEqualTrue(), 1);
-shouldBe(module.unsignedGreaterThanOrEqualFalse(), 0);
</del><ins>+shouldBe(module.equal(1, 1), 1);
+shouldBe(module.equal(1, 2), 0);
+shouldBe(module.notEqual(1, 2), 1);
+shouldBe(module.notEqual(1, 1), 0);
+shouldBe(module.lessThan(-1, 2), 1);
+shouldBe(module.lessThan(1, 1), 0);
+shouldBe(module.lessThanOrEqual(1, 1), 1);
+shouldBe(module.lessThanOrEqual(2, 1), 0);
+shouldBe(module.greaterThan(2, -1), 1);
+shouldBe(module.greaterThan(1, 1), 0);
+shouldBe(module.greaterThanOrEqual(1, 1), 1);
+shouldBe(module.greaterThanOrEqual(1, 2), 0);
+shouldBe(module.unsignedLessThan(2, -1), 1);
+shouldBe(module.unsignedLessThan(-1, 2), 0);
+shouldBe(module.unsignedLessThanOrEqual(2, -1), 1);
+shouldBe(module.unsignedLessThanOrEqual(-1, 2), 0);
+shouldBe(module.unsignedGreaterThan(-1, 2), 1);
+shouldBe(module.unsignedGreaterThan(2, -1), 0);
+shouldBe(module.unsignedGreaterThanOrEqual(-1, 2), 1);
+shouldBe(module.unsignedGreaterThanOrEqual(2, -1), 0);
+
+shouldBe(module.doubleEqual(0.1, 0.1), 1);
+shouldBe(module.doubleEqual(0.1, 0.2), 0);
+shouldBe(module.doubleNotEqual(0.1, 0.2), 1);
+shouldBe(module.doubleNotEqual(0.1, 0.1), 0);
+shouldBe(module.doubleLessThan(-0.1, 0.2), 1);
+shouldBe(module.doubleLessThan(0.1, 0.1), 0);
+shouldBe(module.doubleLessThanOrEqual(0.1, 0.1), 1);
+shouldBe(module.doubleLessThanOrEqual(0.2, 0.1), 0);
+shouldBe(module.doubleGreaterThan(0.2, -0.1), 1);
+shouldBe(module.doubleGreaterThan(0.1, 0.1), 0);
+shouldBe(module.doubleGreaterThanOrEqual(0.1, 0.1), 1);
+shouldBe(module.doubleGreaterThanOrEqual(0.1, 0.2), 0);
+shouldBe(module.doubleEqual(NaN, NaN), 0);
+shouldBe(module.doubleNotEqual(NaN, NaN), 0);
+shouldBe(module.doubleNotEqual(NaN, 0.1), 0);
+shouldBe(module.doubleGreaterThan(NaN, 0.1), 0);
+shouldBe(module.doubleLessThan(NaN, 0.1), 0);
+shouldBe(module.doubleEqual(Infinity, Infinity), 1);
+shouldBe(module.doubleGreaterThan(Infinity, 0.1), 1);
+shouldBe(module.doubleGreaterThan(Infinity, NaN), 0);
+shouldBe(module.doubleLessThan(Infinity, NaN), 0);
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionCompilerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h (189548 => 189549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h        2015-09-09 20:58:44 UTC (rev 189548)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h        2015-09-09 21:01:03 UTC (rev 189549)
</span><span class="lines">@@ -438,6 +438,43 @@
</span><span class="cx"> return UNUSED;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ int buildRelationalF64(int, int, WASMOpExpressionI32 op)
+ {
+ loadDouble(temporaryAddress(m_tempStackTop - 2), FPRInfo::fpRegT0);
+ loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT1);
+ DoubleCondition condition;
+ switch (op) {
+ case WASMOpExpressionI32::EqualF64:
+ condition = DoubleEqual;
+ break;
+ case WASMOpExpressionI32::NotEqualF64:
+ condition = DoubleNotEqual;
+ break;
+ case WASMOpExpressionI32::LessThanF64:
+ condition = DoubleLessThan;
+ break;
+ case WASMOpExpressionI32::LessThanOrEqualF64:
+ condition = DoubleLessThanOrEqual;
+ break;
+ case WASMOpExpressionI32::GreaterThanF64:
+ condition = DoubleGreaterThan;
+ break;
+ case WASMOpExpressionI32::GreaterThanOrEqualF64:
+ condition = DoubleGreaterThanOrEqual;
+ break;
+ default:
+ RELEASE_ASSERT_NOT_REACHED();
+ }
+ m_tempStackTop--;
+ Jump trueCase = branchDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1);
+ store32(TrustedImm32(0), temporaryAddress(m_tempStackTop - 1));
+ Jump end = jump();
+ trueCase.link(this);
+ store32(TrustedImm32(1), temporaryAddress(m_tempStackTop - 1));
+ end.link(this);
+ return UNUSED;
+ }
+
</ins><span class="cx"> void linkTarget(JumpTarget& target)
</span><span class="cx"> {
</span><span class="cx"> target.label = label();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp (189548 => 189549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp        2015-09-09 20:58:44 UTC (rev 189548)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp        2015-09-09 21:01:03 UTC (rev 189549)
</span><span class="lines">@@ -505,6 +505,13 @@
</span><span class="cx"> case WASMOpExpressionI32::SGreaterThanOrEqualI32:
</span><span class="cx"> case WASMOpExpressionI32::UGreaterThanOrEqualI32:
</span><span class="cx"> return parseRelationalI32ExpressionI32(context, op);
</span><ins>+ case WASMOpExpressionI32::EqualF64:
+ case WASMOpExpressionI32::NotEqualF64:
+ case WASMOpExpressionI32::LessThanF64:
+ case WASMOpExpressionI32::LessThanOrEqualF64:
+ case WASMOpExpressionI32::GreaterThanF64:
+ case WASMOpExpressionI32::GreaterThanOrEqualF64:
+ return parseRelationalF64ExpressionI32(context, op);
</ins><span class="cx"> case WASMOpExpressionI32::GetGlobal:
</span><span class="cx"> case WASMOpExpressionI32::SetLocal:
</span><span class="cx"> case WASMOpExpressionI32::SetGlobal:
</span><span class="lines">@@ -532,17 +539,11 @@
</span><span class="cx"> case WASMOpExpressionI32::FromF32:
</span><span class="cx"> case WASMOpExpressionI32::FromF64:
</span><span class="cx"> case WASMOpExpressionI32::EqualF32:
</span><del>- case WASMOpExpressionI32::EqualF64:
</del><span class="cx"> case WASMOpExpressionI32::NotEqualF32:
</span><del>- case WASMOpExpressionI32::NotEqualF64:
</del><span class="cx"> case WASMOpExpressionI32::LessThanF32:
</span><del>- case WASMOpExpressionI32::LessThanF64:
</del><span class="cx"> case WASMOpExpressionI32::LessThanOrEqualF32:
</span><del>- case WASMOpExpressionI32::LessThanOrEqualF64:
</del><span class="cx"> case WASMOpExpressionI32::GreaterThanF32:
</span><del>- case WASMOpExpressionI32::GreaterThanF64:
</del><span class="cx"> case WASMOpExpressionI32::GreaterThanOrEqualF32:
</span><del>- case WASMOpExpressionI32::GreaterThanOrEqualF64:
</del><span class="cx"> case WASMOpExpressionI32::SMin:
</span><span class="cx"> case WASMOpExpressionI32::UMin:
</span><span class="cx"> case WASMOpExpressionI32::SMax:
</span><span class="lines">@@ -641,6 +642,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <class Context>
</span><ins>+ContextExpression WASMFunctionParser::parseRelationalF64ExpressionI32(Context& context, WASMOpExpressionI32 op)
+{
+ ContextExpression left = parseExpressionF64(context);
+ PROPAGATE_ERROR();
+ ContextExpression right = parseExpressionF64(context);
+ PROPAGATE_ERROR();
+ return context.buildRelationalF64(left, right, op);
+}
+
+template <class Context>
</ins><span class="cx"> ContextExpression WASMFunctionParser::parseExpressionF64(Context& context)
</span><span class="cx"> {
</span><span class="cx"> bool hasImmediate;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h (189548 => 189549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h        2015-09-09 20:58:44 UTC (rev 189548)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h        2015-09-09 21:01:03 UTC (rev 189549)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx"> template <class Context> ContextExpression parseUnaryExpressionI32(Context&, WASMOpExpressionI32);
</span><span class="cx"> template <class Context> ContextExpression parseBinaryExpressionI32(Context&, WASMOpExpressionI32);
</span><span class="cx"> template <class Context> ContextExpression parseRelationalI32ExpressionI32(Context&, WASMOpExpressionI32);
</span><ins>+ template <class Context> ContextExpression parseRelationalF64ExpressionI32(Context&, WASMOpExpressionI32);
</ins><span class="cx">
</span><span class="cx"> template <class Context> ContextExpression parseExpressionF64(Context&);
</span><span class="cx"> template <class Context> ContextExpression parseConstantPoolIndexExpressionF64(Context&, uint32_t constantIndex);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionSyntaxCheckerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h (189548 => 189549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h        2015-09-09 20:58:44 UTC (rev 189548)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h        2015-09-09 21:01:03 UTC (rev 189549)
</span><span class="lines">@@ -98,6 +98,12 @@
</span><span class="cx"> return UNUSED;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ int buildRelationalF64(int, int, WASMOpExpressionI32)
+ {
+ m_tempStackTop--;
+ return UNUSED;
+ }
+
</ins><span class="cx"> void linkTarget(const int&) { }
</span><span class="cx"> void jumpToTarget(const int&) { }
</span><span class="cx"> void jumpToTargetIf(JumpCondition, int, const int&)
</span></span></pre>
</div>
</div>
</body>
</html>