<!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>[209476] trunk</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/209476">209476</a></dd>
<dt>Author</dt> <dd>keith_miller@apple.com</dd>
<dt>Date</dt> <dd>2016-12-07 13:43:58 -0800 (Wed, 07 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add support for truncation operators
https://bugs.webkit.org/show_bug.cgi?id=165519

Reviewed by Geoffrey Garen.

JSTests:

* wasm/function-tests/i32-trunc-s-f32.js: Added.
* wasm/function-tests/i32-trunc-s-f64.js: Added.
* wasm/function-tests/i32-trunc-u-f32.js: Added.
* wasm/function-tests/i32-trunc-u-f64.js: Added.
* wasm/function-tests/i64-trunc-s-f32.js: Added.
* wasm/function-tests/i64-trunc-s-f64.js: Added.
* wasm/function-tests/i64-trunc-u-f32.js: Added.
* wasm/function-tests/i64-trunc-u-f64.js: Added.

Source/JavaScriptCore:

This patch adds initial support for truncation operators. The current patch
does range based out of bounds checking, in the future we should use system
register flags on ARM and other tricks on X86 improve the performance of
these opcodes.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::branchTruncateDoubleToInt32):
(JSC::MacroAssemblerARM64::truncateDoubleToInt64):
(JSC::MacroAssemblerARM64::truncateDoubleToUint64):
(JSC::MacroAssemblerARM64::truncateFloatToInt32):
(JSC::MacroAssemblerARM64::truncateFloatToUint32):
(JSC::MacroAssemblerARM64::truncateFloatToInt64):
(JSC::MacroAssemblerARM64::truncateFloatToUint64):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::truncateFloatToInt32):
(JSC::MacroAssemblerX86Common::truncateDoubleToUint32): Deleted.
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::truncateDoubleToUint32):
(JSC::MacroAssemblerX86_64::truncateDoubleToInt64):
(JSC::MacroAssemblerX86_64::truncateDoubleToUint64):
(JSC::MacroAssemblerX86_64::truncateFloatToUint32):
(JSC::MacroAssemblerX86_64::truncateFloatToInt64):
(JSC::MacroAssemblerX86_64::truncateFloatToUint64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::cvttss2si_rr):
(JSC::X86Assembler::cvttss2siq_rr):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I32TruncSF64&gt;):
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I32TruncSF32&gt;):
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I32TruncUF64&gt;):
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I32TruncUF32&gt;):
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I64TruncSF64&gt;):
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I64TruncUF64&gt;):
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I64TruncSF32&gt;):
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I64TruncUF32&gt;):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser&lt;Context&gt;::parseExpression):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJSTestsChangeLog">trunk/JSTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerARM64h">trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86_64h">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerX86Assemblerh">trunk/Source/JavaScriptCore/assembler/X86Assembler.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmB3IRGeneratorcpp">trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmFunctionParserh">trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkJSTestswasmfunctiontestsi32truncsf32js">trunk/JSTests/wasm/function-tests/i32-trunc-s-f32.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsi32truncsf64js">trunk/JSTests/wasm/function-tests/i32-trunc-s-f64.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsi32truncuf32js">trunk/JSTests/wasm/function-tests/i32-trunc-u-f32.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsi32truncuf64js">trunk/JSTests/wasm/function-tests/i32-trunc-u-f64.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsi64truncsf32js">trunk/JSTests/wasm/function-tests/i64-trunc-s-f32.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsi64truncsf64js">trunk/JSTests/wasm/function-tests/i64-trunc-s-f64.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsi64truncuf32js">trunk/JSTests/wasm/function-tests/i64-trunc-u-f32.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsi64truncuf64js">trunk/JSTests/wasm/function-tests/i64-trunc-u-f64.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJSTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/ChangeLog (209475 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/ChangeLog        2016-12-07 21:33:37 UTC (rev 209475)
+++ trunk/JSTests/ChangeLog        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-12-06  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        Add support for truncation operators
+        https://bugs.webkit.org/show_bug.cgi?id=165519
+
+        Reviewed by Geoffrey Garen.
+
+        * wasm/function-tests/i32-trunc-s-f32.js: Added.
+        * wasm/function-tests/i32-trunc-s-f64.js: Added.
+        * wasm/function-tests/i32-trunc-u-f32.js: Added.
+        * wasm/function-tests/i32-trunc-u-f64.js: Added.
+        * wasm/function-tests/i64-trunc-s-f32.js: Added.
+        * wasm/function-tests/i64-trunc-s-f64.js: Added.
+        * wasm/function-tests/i64-trunc-u-f32.js: Added.
+        * wasm/function-tests/i64-trunc-u-f64.js: Added.
+
</ins><span class="cx"> 2016-12-06  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Introduce the concept of Immutable Prototype Exotic Objects to comply with the spec.
</span></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsi32truncsf32js"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/i32-trunc-s-f32.js (0 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/i32-trunc-s-f32.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/i32-trunc-s-f32.js        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.Type().End()
+    .Function().End()
+    .Code()
+    .Function({ params: [&quot;f32&quot;], ret: &quot;i32&quot; }, [])
+    .GetLocal(0)
+    .I32TruncSF32()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 1,
+                        [[{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0x1p-149&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1p-149&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;0x1.19999ap+0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.5&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f32&quot;, value: &quot;-1.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1.19999ap+0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f32&quot;, value: &quot;-1.5&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f32&quot;, value: &quot;-1.9&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-2&quot; }, [{ type: &quot;f32&quot;, value: &quot;-2.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;2147483520&quot; }, [{ type: &quot;f32&quot;, value: &quot;2147483520.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-2147483648&quot; }, [{ type: &quot;f32&quot;, value: &quot;-2147483648.0&quot; }]],
+                        ],
+
+                       );
</ins></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsi32truncsf64js"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/i32-trunc-s-f64.js (0 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/i32-trunc-s-f64.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/i32-trunc-s-f64.js        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.Type().End()
+    .Function().End()
+    .Code()
+    .Function({ params: [&quot;f64&quot;], ret: &quot;i32&quot; }, [])
+    .GetLocal(0)
+    .I32TruncSF64()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 1,
+                        [[{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;0.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;0x0.0000000000001p-1022&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x0.0000000000001p-1022&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;0x1.199999999999ap+0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.5&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;-1.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x1.199999999999ap+0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;-1.5&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;-1.9&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-2&quot; }, [{ type: &quot;f64&quot;, value: &quot;-2.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;2147483647&quot; }, [{ type: &quot;f64&quot;, value: &quot;2147483647.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-2147483648&quot; }, [{ type: &quot;f64&quot;, value: &quot;-2147483648.0&quot; }]],
+                        ],
+
+                       );
</ins></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsi32truncuf32js"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/i32-trunc-u-f32.js (0 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/i32-trunc-u-f32.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/i32-trunc-u-f32.js        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.Type().End()
+    .Function().End()
+    .Code()
+    .Function({ params: [&quot;f32&quot;], ret: &quot;i32&quot; }, [])
+    .GetLocal(0)
+    .I32TruncUF32()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 1,
+                        [[{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0x1p-149&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1p-149&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;0x1.19999ap+0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.5&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.9&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;2&quot; }, [{ type: &quot;f32&quot;, value: &quot;2.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-2147483648&quot; }, [{ type: &quot;f32&quot;, value: &quot;2147483648&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-256&quot; }, [{ type: &quot;f32&quot;, value: &quot;4294967040.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1.ccccccp-1&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1.fffffep-1&quot; }]],
+                        ],
+                       );
</ins></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsi32truncuf64js"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/i32-trunc-u-f64.js (0 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/i32-trunc-u-f64.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/i32-trunc-u-f64.js        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.Type().End()
+    .Function().End()
+    .Code()
+    .Function({ params: [&quot;f64&quot;], ret: &quot;i32&quot; }, [])
+    .GetLocal(0)
+    .I32TruncUF64()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 1,
+                        [[{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;0.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;0x0.0000000000001p-1022&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x0.0000000000001p-1022&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;0x1.199999999999ap+0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.5&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.9&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;2&quot; }, [{ type: &quot;f64&quot;, value: &quot;2.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-2147483648&quot; }, [{ type: &quot;f64&quot;, value: &quot;2147483648&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;4294967295.0&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x1.ccccccccccccdp-1&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x1.fffffffffffffp-1&quot; }]],
+                         [{ type: &quot;i32&quot;, value: &quot;100000000&quot; }, [{ type: &quot;f64&quot;, value: &quot;1e8&quot; }]],
+                        ],
+                       );
</ins></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsi64truncsf32js"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/i64-trunc-s-f32.js (0 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/i64-trunc-s-f32.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/i64-trunc-s-f32.js        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.Type().End()
+    .Function().End()
+    .Code()
+    .Function({ params: [&quot;f32&quot;], ret: &quot;i64&quot; }, [])
+    .GetLocal(0)
+    .I64TruncSF32()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 1,
+                        [[{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0x1p-149&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1p-149&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;0x1.19999ap+0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.5&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1&quot; }, [{ type: &quot;f32&quot;, value: &quot;-1.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1.19999ap+0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1&quot; }, [{ type: &quot;f32&quot;, value: &quot;-1.5&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1&quot; }, [{ type: &quot;f32&quot;, value: &quot;-1.9&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-2&quot; }, [{ type: &quot;f32&quot;, value: &quot;-2.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;4294967296&quot; }, [{ type: &quot;f32&quot;, value: &quot;4294967296&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-4294967296&quot; }, [{ type: &quot;f32&quot;, value: &quot;-4294967296&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;9223371487098961920&quot; }, [{ type: &quot;f32&quot;, value: &quot;9223371487098961920.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-9223372036854775808&quot; }, [{ type: &quot;f32&quot;, value: &quot;-9223372036854775808.0&quot; }]],
+                        ],
+
+                       );
</ins></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsi64truncsf64js"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/i64-trunc-s-f64.js (0 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/i64-trunc-s-f64.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/i64-trunc-s-f64.js        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.Type().End()
+    .Function().End()
+    .Code()
+    .Function({ params: [&quot;f64&quot;], ret: &quot;i64&quot; }, [])
+    .GetLocal(0)
+    .I64TruncSF64()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 1,
+                        [[{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;0.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;0x0.0000000000001p-1022&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x0.0000000000001p-1022&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;0x1.199999999999ap+0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.5&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;-1.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x1.199999999999ap+0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;-1.5&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1&quot; }, [{ type: &quot;f64&quot;, value: &quot;-1.9&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-2&quot; }, [{ type: &quot;f64&quot;, value: &quot;-2.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;4294967296&quot; }, [{ type: &quot;f64&quot;, value: &quot;4294967296&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-4294967296&quot; }, [{ type: &quot;f64&quot;, value: &quot;-4294967296&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;9223372036854774784&quot; }, [{ type: &quot;f64&quot;, value: &quot;9223372036854774784.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-9223372036854775808&quot; }, [{ type: &quot;f64&quot;, value: &quot;-9223372036854775808.0&quot; }]],
+                        ],
+
+                       );
</ins></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsi64truncuf32js"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/i64-trunc-u-f32.js (0 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/i64-trunc-u-f32.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/i64-trunc-u-f32.js        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.Type().End()
+    .Function().End()
+    .Code()
+    .Function({ params: [&quot;f32&quot;], ret: &quot;i64&quot; }, [])
+    .GetLocal(0)
+    .I64TruncUF32()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 1,
+                        [[{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0x1p-149&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1p-149&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;0x1.19999ap+0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f32&quot;, value: &quot;1.5&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;4294967296&quot; }, [{ type: &quot;f32&quot;, value: &quot;4294967296&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-1099511627776&quot; }, [{ type: &quot;f32&quot;, value: &quot;18446742974197923840.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1.ccccccp-1&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;-0x1.fffffep-1&quot; }]],[{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f32&quot;, value: &quot;0.0&quot; }]],
+                        ],
+                       );
</ins></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsi64truncuf64js"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/i64-trunc-u-f64.js (0 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/i64-trunc-u-f64.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/i64-trunc-u-f64.js        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.Type().End()
+    .Function().End()
+    .Code()
+    .Function({ params: [&quot;f64&quot;], ret: &quot;i64&quot; }, [])
+    .GetLocal(0)
+    .I64TruncUF64()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 1,
+                        [[{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;0.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;0x0.0000000000001p-1022&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x0.0000000000001p-1022&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;0x1.199999999999ap+0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;1&quot; }, [{ type: &quot;f64&quot;, value: &quot;1.5&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0xffffffff&quot; }, [{ type: &quot;f64&quot;, value: &quot;4294967295&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0x100000000&quot; }, [{ type: &quot;f64&quot;, value: &quot;4294967296&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-2048&quot; }, [{ type: &quot;f64&quot;, value: &quot;18446744073709549568.0&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x1.ccccccccccccdp-1&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;0&quot; }, [{ type: &quot;f64&quot;, value: &quot;-0x1.fffffffffffffp-1&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;100000000&quot; }, [{ type: &quot;f64&quot;, value: &quot;1e8&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;10000000000000000&quot; }, [{ type: &quot;f64&quot;, value: &quot;1e16&quot; }]],
+                         [{ type: &quot;i64&quot;, value: &quot;-9223372036854775808&quot; }, [{ type: &quot;f64&quot;, value: &quot;9223372036854775808&quot; }]],
+                        ],
+
+                       );
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (209475 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-12-07 21:33:37 UTC (rev 209475)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-12-06  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        Add support for truncation operators
+        https://bugs.webkit.org/show_bug.cgi?id=165519
+
+        Reviewed by Geoffrey Garen.
+
+        This patch adds initial support for truncation operators. The current patch
+        does range based out of bounds checking, in the future we should use system
+        register flags on ARM and other tricks on X86 improve the performance of
+        these opcodes.
+
+        * assembler/MacroAssemblerARM64.h:
+        (JSC::MacroAssemblerARM64::branchTruncateDoubleToInt32):
+        (JSC::MacroAssemblerARM64::truncateDoubleToInt64):
+        (JSC::MacroAssemblerARM64::truncateDoubleToUint64):
+        (JSC::MacroAssemblerARM64::truncateFloatToInt32):
+        (JSC::MacroAssemblerARM64::truncateFloatToUint32):
+        (JSC::MacroAssemblerARM64::truncateFloatToInt64):
+        (JSC::MacroAssemblerARM64::truncateFloatToUint64):
+        * assembler/MacroAssemblerX86Common.h:
+        (JSC::MacroAssemblerX86Common::truncateFloatToInt32):
+        (JSC::MacroAssemblerX86Common::truncateDoubleToUint32): Deleted.
+        * assembler/MacroAssemblerX86_64.h:
+        (JSC::MacroAssemblerX86_64::truncateDoubleToUint32):
+        (JSC::MacroAssemblerX86_64::truncateDoubleToInt64):
+        (JSC::MacroAssemblerX86_64::truncateDoubleToUint64):
+        (JSC::MacroAssemblerX86_64::truncateFloatToUint32):
+        (JSC::MacroAssemblerX86_64::truncateFloatToInt64):
+        (JSC::MacroAssemblerX86_64::truncateFloatToUint64):
+        * assembler/X86Assembler.h:
+        (JSC::X86Assembler::cvttss2si_rr):
+        (JSC::X86Assembler::cvttss2siq_rr):
+        * wasm/WasmB3IRGenerator.cpp:
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I32TruncSF64&gt;):
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I32TruncSF32&gt;):
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I32TruncUF64&gt;):
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I32TruncUF32&gt;):
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I64TruncSF64&gt;):
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I64TruncUF64&gt;):
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I64TruncSF32&gt;):
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::I64TruncUF32&gt;):
+        * wasm/WasmFunctionParser.h:
+        (JSC::Wasm::FunctionParser&lt;Context&gt;::parseExpression):
+
</ins><span class="cx"> 2016-12-07  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Remove unused and mostly untested Page domain commands and events
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerARM64h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h (209475 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h        2016-12-07 21:33:37 UTC (rev 209475)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -1655,7 +1655,7 @@
</span><span class="cx">         // Truncate to a 64-bit integer in dataTempRegister, copy the low 32-bit to dest.
</span><span class="cx">         m_assembler.fcvtzs&lt;64, 64&gt;(getCachedDataTempRegisterIDAndInvalidate(), src);
</span><span class="cx">         zeroExtend32ToPtr(dataTempRegister, dest);
</span><del>-        // Check thlow 32-bits sign extend to be equal to the full value.
</del><ins>+        // Check the low 32-bits sign extend to be equal to the full value.
</ins><span class="cx">         m_assembler.cmp&lt;64&gt;(dataTempRegister, dataTempRegister, ARM64Assembler::SXTW, 0);
</span><span class="cx">         return Jump(makeBranch(branchType == BranchIfTruncateSuccessful ? Equal : NotEqual));
</span><span class="cx">     }
</span><span class="lines">@@ -2041,7 +2041,46 @@
</span><span class="cx">         m_assembler.fcvtzu&lt;32, 64&gt;(dest, src);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void truncateDoubleToInt64(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.fcvtzs&lt;64, 64&gt;(dest, src);
+    }
</ins><span class="cx"> 
</span><ins>+    void truncateDoubleToUint64(FPRegisterID src, RegisterID dest, FPRegisterID, FPRegisterID)
+    {
+        truncateDoubleToUint64(src, dest);
+    }
+
+    void truncateDoubleToUint64(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.fcvtzu&lt;64, 64&gt;(dest, src);
+    }
+
+    void truncateFloatToInt32(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.fcvtzs&lt;32, 32&gt;(dest, src);
+    }
+
+    void truncateFloatToUint32(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.fcvtzu&lt;32, 32&gt;(dest, src);
+    }
+
+    void truncateFloatToInt64(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.fcvtzs&lt;64, 32&gt;(dest, src);
+    }
+
+    void truncateFloatToUint64(FPRegisterID src, RegisterID dest, FPRegisterID, FPRegisterID)
+    {
+        truncateFloatToUint64(src, dest);
+    }
+
+    void truncateFloatToUint64(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.fcvtzu&lt;64, 32&gt;(dest, src);
+    }
+
</ins><span class="cx">     // Stack manipulation operations:
</span><span class="cx">     //
</span><span class="cx">     // The ABI is assumed to provide a stack abstraction to memory,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h (209475 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2016-12-07 21:33:37 UTC (rev 209475)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -1678,15 +1678,13 @@
</span><span class="cx">         ASSERT(isSSE2Present());
</span><span class="cx">         m_assembler.cvttsd2si_rr(src, dest);
</span><span class="cx">     }
</span><del>-    
-#if CPU(X86_64)
-    void truncateDoubleToUint32(FPRegisterID src, RegisterID dest)
</del><ins>+
+    void truncateFloatToInt32(FPRegisterID src, RegisterID dest)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(isSSE2Present());
</span><del>-        m_assembler.cvttsd2siq_rr(src, dest);
</del><ins>+        m_assembler.cvttss2si_rr(src, dest);
</ins><span class="cx">     }
</span><del>-#endif
-    
</del><ins>+
</ins><span class="cx">     // Convert 'src' to an integer, and places the resulting 'dest'.
</span><span class="cx">     // If the result is not representable as a 32 bit value, branch.
</span><span class="cx">     // May also branch for some values that are representable in 32 bits
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86_64h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h (209475 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h        2016-12-07 21:33:37 UTC (rev 209475)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -1295,6 +1295,72 @@
</span><span class="cx">         return MacroAssemblerX86Common::branchTest8(cond, Address(scratchRegister()), mask8);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void truncateDoubleToUint32(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.cvttsd2siq_rr(src, dest);
+    }
+
+    void truncateDoubleToInt64(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.cvttsd2siq_rr(src, dest);
+    }
+
+    // int64Min should contain exactly 0x43E0000000000000 == static_cast&lt;double&gt;(int64_t::min()). scratch may
+    // be the same FPR as src.
+    void truncateDoubleToUint64(FPRegisterID src, RegisterID dest, FPRegisterID scratch, FPRegisterID int64Min)
+    {
+        ASSERT(scratch != int64Min);
+
+        // Since X86 does not have a floating point to unsigned integer instruction, we need to use the signed
+        // integer conversion instruction. If the src is less than int64_t::min() then the results of the two
+        // instructions are the same. Otherwise, we need to: subtract int64_t::min(); truncate double to
+        // uint64_t; then add back int64_t::min() in the destination gpr.
+
+        Jump large = branchDouble(DoubleGreaterThanOrEqual, src, int64Min);
+        m_assembler.cvttsd2siq_rr(src, dest);
+        Jump done = jump();
+        large.link(this);
+        moveDouble(src, scratch);
+        m_assembler.subsd_rr(int64Min, scratch);
+        m_assembler.movq_i64r(0x8000000000000000, scratchRegister());
+        m_assembler.cvttsd2siq_rr(scratch, dest);
+        m_assembler.orq_rr(scratchRegister(), dest);
+        done.link(this);
+    }
+
+    void truncateFloatToUint32(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.cvttss2siq_rr(src, dest);
+    }
+
+    void truncateFloatToInt64(FPRegisterID src, RegisterID dest)
+    {
+        m_assembler.cvttss2siq_rr(src, dest);
+    }
+
+    // int64Min should contain exactly 0x5f000000 == static_cast&lt;float&gt;(int64_t::min()). scratch may be the
+    // same FPR as src.
+    void truncateFloatToUint64(FPRegisterID src, RegisterID dest, FPRegisterID scratch, FPRegisterID int64Min)
+    {
+        ASSERT(scratch != int64Min);
+
+        // Since X86 does not have a floating point to unsigned integer instruction, we need to use the signed
+        // integer conversion instruction. If the src is less than int64_t::min() then the results of the two
+        // instructions are the same. Otherwise, we need to: subtract int64_t::min(); truncate double to
+        // uint64_t; then add back int64_t::min() in the destination gpr.
+
+        Jump large = branchFloat(DoubleGreaterThanOrEqual, src, int64Min);
+        m_assembler.cvttss2siq_rr(src, dest);
+        Jump done = jump();
+        large.link(this);
+        moveDouble(src, scratch);
+        m_assembler.subss_rr(int64Min, scratch);
+        m_assembler.movq_i64r(0x8000000000000000, scratchRegister());
+        m_assembler.cvttss2siq_rr(scratch, dest);
+        m_assembler.orq_rr(scratchRegister(), dest);
+        done.link(this);
+    }
+
</ins><span class="cx">     void convertInt64ToDouble(RegisterID src, FPRegisterID dest)
</span><span class="cx">     {
</span><span class="cx">         m_assembler.cvtsi2sdq_rr(src, dest);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerX86Assemblerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/X86Assembler.h (209475 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/X86Assembler.h        2016-12-07 21:33:37 UTC (rev 209475)
+++ trunk/Source/JavaScriptCore/assembler/X86Assembler.h        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -267,6 +267,7 @@
</span><span class="cx">         OP2_MOVAPS_VpdWpd   = 0x28,
</span><span class="cx">         OP2_CVTSI2SD_VsdEd  = 0x2A,
</span><span class="cx">         OP2_CVTTSD2SI_GdWsd = 0x2C,
</span><ins>+        OP2_CVTTSS2SI_GdWsd = 0x2C,
</ins><span class="cx">         OP2_UCOMISD_VsdWsd  = 0x2E,
</span><span class="cx">         OP2_3BYTE_ESCAPE_3A = 0x3A,
</span><span class="cx">         OP2_CMOVCC          = 0x40,
</span><span class="lines">@@ -2293,6 +2294,20 @@
</span><span class="cx">         m_formatter.twoByteOp(OP2_CVTTSD2SI_GdWsd, dst, (RegisterID)src);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void cvttss2si_rr(XMMRegisterID src, RegisterID dst)
+    {
+        m_formatter.prefix(PRE_SSE_F3);
+        m_formatter.twoByteOp(OP2_CVTTSS2SI_GdWsd, dst, (RegisterID)src);
+    }
+
+#if CPU(X86_64)
+    void cvttss2siq_rr(XMMRegisterID src, RegisterID dst)
+    {
+        m_formatter.prefix(PRE_SSE_F3);
+        m_formatter.twoByteOp64(OP2_CVTTSS2SI_GdWsd, dst, (RegisterID)src);
+    }
+#endif
+
</ins><span class="cx">     void cvtsd2ss_rr(XMMRegisterID src, XMMRegisterID dst)
</span><span class="cx">     {
</span><span class="cx">         m_formatter.prefix(PRE_SSE_F2);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmB3IRGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp (209475 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp        2016-12-07 21:33:37 UTC (rev 209475)
+++ trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -905,6 +905,229 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::I32TruncSF64&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    Value* max = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), -static_cast&lt;double&gt;(std::numeric_limits&lt;int32_t&gt;::min()));
+    Value* min = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), static_cast&lt;double&gt;(std::numeric_limits&lt;int32_t&gt;::min()));
+    Value* outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, BitAnd, Origin(),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, LessThan, Origin(), arg, max),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, GreaterEqual, Origin(), arg, min));
+    outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, Equal, Origin(), outOfBounds, zeroForType(I32));
+    CheckValue* trap = m_currentBlock-&gt;appendNew&lt;CheckValue&gt;(m_proc, Check, Origin(), outOfBounds);
+    trap-&gt;setGenerator([] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp;) {
+        jit.breakpoint();
+    });
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Int32, Origin());
+    patchpoint-&gt;append(arg, ValueRep::SomeRegister);
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        jit.truncateDoubleToInt32(params[1].fpr(), params[0].gpr());
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::I32TruncSF32&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    Value* max = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), -static_cast&lt;float&gt;(std::numeric_limits&lt;int32_t&gt;::min()));
+    Value* min = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), static_cast&lt;float&gt;(std::numeric_limits&lt;int32_t&gt;::min()));
+    Value* outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, BitAnd, Origin(),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, LessThan, Origin(), arg, max),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, GreaterEqual, Origin(), arg, min));
+    outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, Equal, Origin(), outOfBounds, zeroForType(I32));
+    CheckValue* trap = m_currentBlock-&gt;appendNew&lt;CheckValue&gt;(m_proc, Check, Origin(), outOfBounds);
+    trap-&gt;setGenerator([] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp;) {
+        jit.breakpoint();
+    });
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Int32, Origin());
+    patchpoint-&gt;append(arg, ValueRep::SomeRegister);
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        jit.truncateFloatToInt32(params[1].fpr(), params[0].gpr());
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::I32TruncUF64&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    Value* max = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), static_cast&lt;double&gt;(std::numeric_limits&lt;int32_t&gt;::min()) * -2.0);
+    Value* min = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), -1.0);
+    Value* outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, BitAnd, Origin(),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, LessThan, Origin(), arg, max),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, GreaterThan, Origin(), arg, min));
+    outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, Equal, Origin(), outOfBounds, zeroForType(I32));
+    CheckValue* trap = m_currentBlock-&gt;appendNew&lt;CheckValue&gt;(m_proc, Check, Origin(), outOfBounds);
+    trap-&gt;setGenerator([] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp;) {
+        jit.breakpoint();
+    });
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Int32, Origin());
+    patchpoint-&gt;append(arg, ValueRep::SomeRegister);
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        jit.truncateDoubleToUint32(params[1].fpr(), params[0].gpr());
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::I32TruncUF32&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    Value* max = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), static_cast&lt;float&gt;(std::numeric_limits&lt;int32_t&gt;::min()) * -2.0);
+    Value* min = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), -1.0);
+    Value* outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, BitAnd, Origin(),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, LessThan, Origin(), arg, max),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, GreaterThan, Origin(), arg, min));
+    outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, Equal, Origin(), outOfBounds, zeroForType(I32));
+    CheckValue* trap = m_currentBlock-&gt;appendNew&lt;CheckValue&gt;(m_proc, Check, Origin(), outOfBounds);
+    trap-&gt;setGenerator([] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp;) {
+        jit.breakpoint();
+    });
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Int32, Origin());
+    patchpoint-&gt;append(arg, ValueRep::SomeRegister);
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        jit.truncateFloatToUint32(params[1].fpr(), params[0].gpr());
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::I64TruncSF64&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    Value* max = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), -static_cast&lt;double&gt;(std::numeric_limits&lt;int64_t&gt;::min()));
+    Value* min = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), static_cast&lt;double&gt;(std::numeric_limits&lt;int64_t&gt;::min()));
+    Value* outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, BitAnd, Origin(),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, LessThan, Origin(), arg, max),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, GreaterEqual, Origin(), arg, min));
+    outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, Equal, Origin(), outOfBounds, zeroForType(I32));
+    CheckValue* trap = m_currentBlock-&gt;appendNew&lt;CheckValue&gt;(m_proc, Check, Origin(), outOfBounds);
+    trap-&gt;setGenerator([] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp;) {
+        jit.breakpoint();
+    });
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Int64, Origin());
+    patchpoint-&gt;append(arg, ValueRep::SomeRegister);
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        jit.truncateDoubleToInt64(params[1].fpr(), params[0].gpr());
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::I64TruncUF64&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    Value* max = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), static_cast&lt;double&gt;(std::numeric_limits&lt;int64_t&gt;::min()) * -2.0);
+    Value* min = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), -1.0);
+    Value* outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, BitAnd, Origin(),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, LessThan, Origin(), arg, max),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, GreaterThan, Origin(), arg, min));
+    outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, Equal, Origin(), outOfBounds, zeroForType(I32));
+    CheckValue* trap = m_currentBlock-&gt;appendNew&lt;CheckValue&gt;(m_proc, Check, Origin(), outOfBounds);
+    trap-&gt;setGenerator([] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp;) {
+        jit.breakpoint();
+    });
+
+    Value* constant;
+    if (isX86()) {
+        // Since x86 doesn't have an instruction to convert floating points to unsigned integers, we at least try to do the smart thing if
+        // the numbers are would be positive anyway as a signed integer. Since we cannot materialize constants into fprs we have b3 do it
+        // so we can pool them if needed.
+        constant = m_currentBlock-&gt;appendNew&lt;ConstDoubleValue&gt;(m_proc, Origin(), static_cast&lt;double&gt;(std::numeric_limits&lt;uint64_t&gt;::max() - std::numeric_limits&lt;int64_t&gt;::max()));
+    }
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Int64, Origin());
+    patchpoint-&gt;append(arg, ValueRep::SomeRegister);
+    if (isX86()) {
+        patchpoint-&gt;append(constant, ValueRep::SomeRegister);
+        patchpoint-&gt;numFPScratchRegisters = 1;
+    }
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        AllowMacroScratchRegisterUsage allowScratch(jit);
+        FPRReg scratch = InvalidFPRReg;
+        FPRReg constant = InvalidFPRReg;
+        if (isX86()) {
+            scratch = params.fpScratch(0);
+            constant = params[2].fpr();
+        }
+        jit.truncateDoubleToUint64(params[1].fpr(), params[0].gpr(), scratch, constant);
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::I64TruncSF32&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    Value* max = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), -static_cast&lt;float&gt;(std::numeric_limits&lt;int64_t&gt;::min()));
+    Value* min = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), static_cast&lt;float&gt;(std::numeric_limits&lt;int64_t&gt;::min()));
+    Value* outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, BitAnd, Origin(),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, LessThan, Origin(), arg, max),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, GreaterEqual, Origin(), arg, min));
+    outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, Equal, Origin(), outOfBounds, zeroForType(I32));
+    CheckValue* trap = m_currentBlock-&gt;appendNew&lt;CheckValue&gt;(m_proc, Check, Origin(), outOfBounds);
+    trap-&gt;setGenerator([] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp;) {
+        jit.breakpoint();
+    });
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Int64, Origin());
+    patchpoint-&gt;append(arg, ValueRep::SomeRegister);
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        jit.truncateFloatToInt64(params[1].fpr(), params[0].gpr());
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::I64TruncUF32&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    Value* max = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), static_cast&lt;float&gt;(std::numeric_limits&lt;int64_t&gt;::min()) * -2.0);
+    Value* min = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), -1.0);
+    Value* outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, BitAnd, Origin(),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, LessThan, Origin(), arg, max),
+        m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, GreaterThan, Origin(), arg, min));
+    outOfBounds = m_currentBlock-&gt;appendNew&lt;Value&gt;(m_proc, Equal, Origin(), outOfBounds, zeroForType(I32));
+    CheckValue* trap = m_currentBlock-&gt;appendNew&lt;CheckValue&gt;(m_proc, Check, Origin(), outOfBounds);
+    trap-&gt;setGenerator([] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp;) {
+        jit.breakpoint();
+    });
+
+    Value* constant;
+    if (isX86()) {
+        // Since x86 doesn't have an instruction to convert floating points to unsigned integers, we at least try to do the smart thing if
+        // the numbers are would be positive anyway as a signed integer. Since we cannot materialize constants into fprs we have b3 do it
+        // so we can pool them if needed.
+        constant = m_currentBlock-&gt;appendNew&lt;ConstFloatValue&gt;(m_proc, Origin(), static_cast&lt;float&gt;(std::numeric_limits&lt;uint64_t&gt;::max() - std::numeric_limits&lt;int64_t&gt;::max()));
+    }
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Int64, Origin());
+    patchpoint-&gt;append(arg, ValueRep::SomeRegister);
+    if (isX86()) {
+        patchpoint-&gt;append(constant, ValueRep::SomeRegister);
+        patchpoint-&gt;numFPScratchRegisters = 1;
+    }
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        AllowMacroScratchRegisterUsage allowScratch(jit);
+        FPRReg scratch = InvalidFPRReg;
+        FPRReg constant = InvalidFPRReg;
+        if (isX86()) {
+            scratch = params.fpScratch(0);
+            constant = params[2].fpr();
+        }
+        jit.truncateFloatToUint64(params[1].fpr(), params[0].gpr(), scratch, constant);
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
</ins><span class="cx"> } } // namespace JSC::Wasm
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WasmB3IRGeneratorInlines.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmFunctionParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h (209475 => 209476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h        2016-12-07 21:33:37 UTC (rev 209475)
+++ trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h        2016-12-07 21:43:58 UTC (rev 209476)
</span><span class="lines">@@ -221,6 +221,14 @@
</span><span class="cx">     case OpType::I64Ctz: return unaryCase&lt;OpType::I64Ctz&gt;();
</span><span class="cx">     case OpType::I32Popcnt: return unaryCase&lt;OpType::I32Popcnt&gt;();
</span><span class="cx">     case OpType::I64Popcnt: return unaryCase&lt;OpType::I64Popcnt&gt;();
</span><ins>+    case OpType::I32TruncSF32: return unaryCase&lt;OpType::I32TruncSF32&gt;();
+    case OpType::I32TruncUF32: return unaryCase&lt;OpType::I32TruncUF32&gt;();
+    case OpType::I32TruncSF64: return unaryCase&lt;OpType::I32TruncSF64&gt;();
+    case OpType::I32TruncUF64: return unaryCase&lt;OpType::I32TruncUF64&gt;();
+    case OpType::I64TruncSF32: return unaryCase&lt;OpType::I64TruncSF32&gt;();
+    case OpType::I64TruncUF32: return unaryCase&lt;OpType::I64TruncUF32&gt;();
+    case OpType::I64TruncSF64: return unaryCase&lt;OpType::I64TruncSF64&gt;();
+    case OpType::I64TruncUF64: return unaryCase&lt;OpType::I64TruncUF64&gt;();
</ins><span class="cx"> #define CREATE_CASE(name, id, b3op, inc) case OpType::name: return unaryCase&lt;OpType::name&gt;();
</span><span class="cx">     FOR_EACH_WASM_SIMPLE_UNARY_OP(CREATE_CASE)
</span><span class="cx"> #undef CREATE_CASE
</span></span></pre>
</div>
</div>

</body>
</html>