<!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>[209204] 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/209204">209204</a></dd>
<dt>Author</dt> <dd>keith_miller@apple.com</dd>
<dt>Date</dt> <dd>2016-12-01 14:00:23 -0800 (Thu, 01 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add wasm int to floating point opcodes
https://bugs.webkit.org/show_bug.cgi?id=165252

Reviewed by Geoffrey Garen.

JSTests:

Add tests for Wasm integral to floating point conversion opcodes.

* wasm/function-tests/int-to-floating-point.js: Added.
* wasm/wasm.json:

Source/JavaScriptCore:

This patch adds support for the Wasm integral type =&gt; floating point
type conversion opcodes. Most of these were already supported by B3
however there was no support for uint64 to float/double. Unfortunately,
AFAIK x86_64 does not have a single instruction that performs this
conversion. Since there is a signed conversion instruction on x86 we
use that for all uint64s that don't have the top bit set. If they do have
the top bit set we need to divide by 2 (rounding up) then convert the number
with the signed conversion then double the result.

* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::convertUInt64ToDouble):
(JSC::MacroAssemblerX86_64::convertUInt64ToFloat):
* jsc.cpp:
(valueWithTypeOfWasmValue):
(box):
(functionTestWasmModuleFunctions):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addOp&lt;F64ConvertUI64&gt;):
(JSC::Wasm::B3IRGenerator::addOp&lt;OpType::F32ConvertUI64&gt;):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser&lt;Context&gt;::parseExpression):
* wasm/wasm.json:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJSTestsChangeLog">trunk/JSTests/ChangeLog</a></li>
<li><a href="#trunkJSTestswasmwasmjson">trunk/JSTests/wasm/wasm.json</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="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86_64h">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</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>
<li><a href="#trunkSourceJavaScriptCorewasmwasmjson">trunk/Source/JavaScriptCore/wasm/wasm.json</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkJSTestswasmfunctiontestsinttofloatingpointjs">trunk/JSTests/wasm/function-tests/int-to-floating-point.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJSTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/ChangeLog (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/ChangeLog        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/JSTests/ChangeLog        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-12-01  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        Add wasm int to floating point opcodes
+        https://bugs.webkit.org/show_bug.cgi?id=165252
+
+        Reviewed by Geoffrey Garen.
+
+        Add tests for Wasm integral to floating point conversion opcodes.
+
+        * wasm/function-tests/int-to-floating-point.js: Added.
+        * wasm/wasm.json:
+
</ins><span class="cx"> 2016-12-01  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Land a test case for &lt;rdar://problem/27889416&gt;
</span></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsinttofloatingpointjs"></a>
<div class="addfile"><h4>Added: trunk/JSTests/wasm/function-tests/int-to-floating-point.js (0 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/int-to-floating-point.js                                (rev 0)
+++ trunk/JSTests/wasm/function-tests/int-to-floating-point.js        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -0,0 +1,135 @@
</span><ins>+import Builder from '../Builder.js'
+
+const b = new Builder();
+b.setChecked(false);
+b.Type().End()
+    .Function().End()
+    .Code()
+
+    .Function({ params: [&quot;i64&quot;], ret: &quot;f32&quot; }, [])
+    .GetLocal(0)
+    .F32ConvertUI64()
+    .End()
+
+    .Function({ params: [&quot;i64&quot;], ret: &quot;f32&quot; }, [])
+    .GetLocal(0)
+    .F32ConvertSI64()
+    .End()
+
+    .Function({ params: [&quot;i32&quot;], ret: &quot;f32&quot; }, [])
+    .GetLocal(0)
+    .F32ConvertUI32()
+    .End()
+
+    .Function({ params: [&quot;i32&quot;], ret: &quot;f32&quot; }, [])
+    .GetLocal(0)
+    .F32ConvertSI32()
+    .End()
+
+    .Function({ params: [&quot;i64&quot;], ret: &quot;f64&quot; }, [])
+    .GetLocal(0)
+    .F64ConvertUI64()
+    .End()
+
+    .Function({ params: [&quot;i64&quot;], ret: &quot;f64&quot; }, [])
+    .GetLocal(0)
+    .F64ConvertSI64()
+    .End()
+
+    .Function({ params: [&quot;i32&quot;], ret: &quot;f64&quot; }, [])
+    .GetLocal(0)
+    .F64ConvertUI32()
+    .End()
+
+    .Function({ params: [&quot;i32&quot;], ret: &quot;f64&quot; }, [])
+    .GetLocal(0)
+    .F64ConvertSI32()
+    .End()
+
+const bin = b.WebAssembly()
+bin.trim();
+testWasmModuleFunctions(bin.get(), 8,
+                        [[{ type: &quot;f32&quot;, value: 1.0 }, [{ type: &quot;i64&quot;, value: &quot;1&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 0.0 }, [{ type: &quot;i64&quot;, value: &quot;0&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 9223372036854775807 }, [{type: &quot;i64&quot;, value: &quot;9223372036854775807&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 9223372036854775808 }, [{type: &quot;i64&quot;, value: &quot;-9223372036854775808&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 18446744073709551616.0 }, [{ type: &quot;i64&quot;, value: &quot;0xffffffffffffffff&quot; }]],
+                         // Test rounding directions.
+                         [{ type: &quot;f32&quot;, value: 16777216.0 }, [{ type: &quot;i64&quot;, value: &quot;16777217&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 16777220.0 }, [{ type: &quot;i64&quot;, value: &quot;16777219&quot; }]]
+                        ],
+
+                        [[{ type: &quot;f32&quot;, value: 1.0 }, [{ type: &quot;i64&quot;, value: &quot;1&quot; }]],
+                         [{ type: &quot;f32&quot;, value: -1.0}, [{ type: &quot;i64&quot;, value: &quot;-1&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 0.0}, [{ type: &quot;i64&quot;, value: &quot;0&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 9223372036854775807}, [{ type: &quot;i64&quot;, value: &quot;9223372036854775807&quot; }]],
+                         [{ type: &quot;f32&quot;, value: -9223372036854775808}, [{ type: &quot;i64&quot;, value: &quot;-9223372036854775808&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 314159275180032.0}, [{ type: &quot;i64&quot;, value: &quot;314159265358979&quot; }]],
+                         // Test rounding directions.
+                         [{ type: &quot;f32&quot;, value: 16777216.0}, [{ type: &quot;i64&quot;, value: &quot;16777217&quot; }]],
+                         [{ type: &quot;f32&quot;, value: -16777216.0}, [{ type: &quot;i64&quot;, value: &quot;-16777217&quot; }]],
+                         [{ type: &quot;f32&quot;, value: 16777220.0}, [{ type: &quot;i64&quot;, value: &quot;16777219&quot; }]],
+                         [{ type: &quot;f32&quot;, value: -16777220.0}, [{ type: &quot;i64&quot;, value: &quot;-16777219&quot; }]]
+                        ],
+
+                        [[{ type: &quot;f32&quot;, value: 1.0 }, [{ type: &quot;i32&quot;, value: 1 }]],
+                         [{ type: &quot;f32&quot;, value: 0.0 }, [{ type: &quot;i32&quot;, value: 0 }]],
+                         [{ type: &quot;f32&quot;, value: 2147483648 }, [{ type: &quot;i32&quot;, value: 2147483647 }]],
+                         [{ type: &quot;f32&quot;, value: 2147483648 }, [{ type: &quot;i32&quot;, value: -2147483648 }]],
+                         [{ type: &quot;f32&quot;, value: 305419904.0 }, [{ type: &quot;i32&quot;, value: 0x12345678 }]],
+                         [{ type: &quot;f32&quot;, value: 4294967296.0 }, [{ type: &quot;i32&quot;, value: -1 }]],
+                         // Test rounding directions.
+                         [{ type: &quot;f32&quot;, value: 16777220.0 }, [{ type: &quot;i32&quot;, value: 16777219 }]]
+                        ],
+
+                        [[{ type: &quot;f32&quot;, value: 1.0 }, [{ type: &quot;i32&quot;, value: 1 }]],
+                         [{ type: &quot;f32&quot;, value: -1.0 }, [{ type: &quot;i32&quot;, value: -1 }]],
+                         [{ type: &quot;f32&quot;, value: 0.0 }, [{ type: &quot;i32&quot;, value: 0 }]],
+                         [{ type: &quot;f32&quot;, value: 2147483648 }, [{ type: &quot;i32&quot;, value: 2147483647 }]],
+                         [{ type: &quot;f32&quot;, value: -2147483648 }, [{ type: &quot;i32&quot;, value: -2147483648 }]],
+                         [{ type: &quot;f32&quot;, value: 1234567936.0 }, [{ type: &quot;i32&quot;, value: 1234567890 }]],
+                         // Test rounding directions.
+                         [{ type: &quot;f32&quot;, value: 16777216.0 }, [{ type: &quot;i32&quot;, value: 16777217 }]],
+                         [{ type: &quot;f32&quot;, value: -16777216.0 }, [{ type: &quot;i32&quot;, value: -16777217 }]],
+                         [{ type: &quot;f32&quot;, value: 16777220.0 }, [{ type: &quot;i32&quot;, value: 16777219 }]],
+                         [{ type: &quot;f32&quot;, value: -16777220.0 }, [{ type: &quot;i32&quot;, value: -16777219 }]]
+                        ],
+
+                        [[{ type: &quot;f64&quot;, value: 1.0 }, [{ type: &quot;i64&quot;, value: &quot;1&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 0.0 }, [{ type: &quot;i64&quot;, value: &quot;0&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 9223372036854775807 }, [{ type: &quot;i64&quot;, value: &quot;9223372036854775807&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 9223372036854775808 }, [{ type: &quot;i64&quot;, value: &quot;-9223372036854775808&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 18446744073709551616.0 }, [{ type: &quot;i64&quot;, value: &quot;0xffffffffffffffff&quot; }]],
+                         // Test rounding directions.
+                         [{ type: &quot;f64&quot;, value: 9007199254740992 }, [{ type: &quot;i64&quot;, value: &quot;9007199254740993&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 9007199254740996 }, [{ type: &quot;i64&quot;, value: &quot;9007199254740995&quot; }]]
+                        ],
+
+                        [[{ type: &quot;f64&quot;, value: 1.0 }, [{ type: &quot;i64&quot;, value: &quot;1&quot; }]],
+                         [{ type: &quot;f64&quot;, value: -1.0 }, [{ type: &quot;i64&quot;, value: &quot;-1&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 0.0 }, [{ type: &quot;i64&quot;, value: &quot;0&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 9223372036854775807 }, [{ type: &quot;i64&quot;, value: &quot;9223372036854775807&quot; }]],
+                         [{ type: &quot;f64&quot;, value: -9223372036854775808 }, [{ type: &quot;i64&quot;, value: &quot;-9223372036854775808&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 4669201609102990 }, [{ type: &quot;i64&quot;, value: &quot;4669201609102990&quot; }]],
+                         // Test rounding directions.
+                         [{ type: &quot;f64&quot;, value: 9007199254740992 }, [{ type: &quot;i64&quot;, value: &quot;9007199254740993&quot; }]],
+                         [{ type: &quot;f64&quot;, value: -9007199254740992 }, [{ type: &quot;i64&quot;, value: &quot;-9007199254740993&quot; }]],
+                         [{ type: &quot;f64&quot;, value: 9007199254740996 }, [{ type: &quot;i64&quot;, value: &quot;9007199254740995&quot; }]],
+                         [{ type: &quot;f64&quot;, value: -9007199254740996 }, [{ type: &quot;i64&quot;, value: &quot;-9007199254740995&quot; }]]
+                        ],
+
+                        [[{ type: &quot;f64&quot;, value: 1.0 }, [{ type: &quot;i32&quot;, value: 1 }]],
+                         [{ type: &quot;f64&quot;, value: 0.0 }, [{ type: &quot;i32&quot;, value: 0 }]],
+                         [{ type: &quot;f64&quot;, value: 2147483647 }, [{ type: &quot;i32&quot;, value: 2147483647 }]],
+                         [{ type: &quot;f64&quot;, value: 2147483648 }, [{ type: &quot;i32&quot;, value: -2147483648 }]],
+                         [{ type: &quot;f64&quot;, value: 4294967295.0 }, [{ type: &quot;i32&quot;, value: -1 }]]
+                        ],
+
+                        [[{ type: &quot;f64&quot;, value: 1.0 }, [{ type: &quot;i32&quot;, value: 1 }]],
+                         [{ type: &quot;f64&quot;, value: -1.0 }, [{ type: &quot;i32&quot;, value: -1 }]],
+                         [{ type: &quot;f64&quot;, value: 0.0 }, [{ type: &quot;i32&quot;, value: 0 }]],
+                         [{ type: &quot;f64&quot;, value: 2147483647 }, [{ type: &quot;i32&quot;, value: 2147483647 }]],
+                         [{ type: &quot;f64&quot;, value: -2147483648 }, [{ type: &quot;i32&quot;, value: -2147483648 }]],
+                         [{ type: &quot;f64&quot;, value: 987654321 }, [{ type: &quot;i32&quot;, value: 987654321 }]]
+                        ]
+                       );
</ins></span></pre></div>
<a id="trunkJSTestswasmwasmjson"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/wasm.json (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/wasm.json        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/JSTests/wasm/wasm.json        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -199,15 +199,15 @@
</span><span class="cx">         &quot;i64.trunc_u/f64&quot;:     { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 177, &quot;return&quot;: [&quot;i64&quot;],      &quot;parameter&quot;: [&quot;f64&quot;],                  &quot;immediate&quot;: []                         },
</span><span class="cx">         &quot;i64.extend_s/i32&quot;:    { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 172, &quot;return&quot;: [&quot;i64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;SExt32&quot;       },
</span><span class="cx">         &quot;i64.extend_u/i32&quot;:    { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 173, &quot;return&quot;: [&quot;i64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;ZExt32&quot;       },
</span><del>-        &quot;f32.convert_s/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 178, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: []                         },
-        &quot;f32.convert_u/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 179, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: []                         },
-        &quot;f32.convert_s/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 180, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: []                         },
</del><ins>+        &quot;f32.convert_s/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 178, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToF&quot;         },
+        &quot;f32.convert_u/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 179, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToF(ZExt32(@0))&quot; },
+        &quot;f32.convert_s/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 180, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToF&quot;         },
</ins><span class="cx">         &quot;f32.convert_u/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 181, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: []                         },
</span><span class="cx">         &quot;f32.demote/f64&quot;:      { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 182, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;f64&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;DoubleToFloat&quot;},
</span><span class="cx">         &quot;f32.reinterpret/i32&quot;: { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 190, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;BitwiseCast&quot;  },
</span><del>-        &quot;f64.convert_s/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 183, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: []                         },
-        &quot;f64.convert_u/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 184, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: []                         },
-        &quot;f64.convert_s/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 185, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: []                         },
</del><ins>+        &quot;f64.convert_s/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 183, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToD&quot;         },
+        &quot;f64.convert_u/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 184, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToD(ZExt32(@0))&quot; },
+        &quot;f64.convert_s/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 185, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToD&quot;         },
</ins><span class="cx">         &quot;f64.convert_u/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 186, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: []                         },
</span><span class="cx">         &quot;f64.promote/f32&quot;:     { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 187, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;f32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;FloatToDouble&quot;},
</span><span class="cx">         &quot;f64.reinterpret/i64&quot;: { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 191, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;BitwiseCast&quot;  },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-12-01  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        Add wasm int to floating point opcodes
+        https://bugs.webkit.org/show_bug.cgi?id=165252
+
+        Reviewed by Geoffrey Garen.
+
+        This patch adds support for the Wasm integral type =&gt; floating point
+        type conversion opcodes. Most of these were already supported by B3
+        however there was no support for uint64 to float/double. Unfortunately,
+        AFAIK x86_64 does not have a single instruction that performs this
+        conversion. Since there is a signed conversion instruction on x86 we
+        use that for all uint64s that don't have the top bit set. If they do have
+        the top bit set we need to divide by 2 (rounding up) then convert the number
+        with the signed conversion then double the result.
+
+        * assembler/MacroAssemblerX86_64.h:
+        (JSC::MacroAssemblerX86_64::convertUInt64ToDouble):
+        (JSC::MacroAssemblerX86_64::convertUInt64ToFloat):
+        * jsc.cpp:
+        (valueWithTypeOfWasmValue):
+        (box):
+        (functionTestWasmModuleFunctions):
+        * wasm/WasmB3IRGenerator.cpp:
+        (JSC::Wasm::B3IRGenerator::addOp&lt;F64ConvertUI64&gt;):
+        (JSC::Wasm::B3IRGenerator::addOp&lt;OpType::F32ConvertUI64&gt;):
+        * wasm/WasmFunctionParser.h:
+        (JSC::Wasm::FunctionParser&lt;Context&gt;::parseExpression):
+        * wasm/wasm.json:
+
</ins><span class="cx"> 2016-12-01  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Renamed EvalCodeCache =&gt; DirectEvalCodeCache
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerARM64h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -1682,7 +1682,17 @@
</span><span class="cx">     {
</span><span class="cx">         m_assembler.scvtf&lt;32, 64&gt;(dest, src);
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+    void convertUInt64ToDouble(RegisterID src, FPRegisterID dest)
+    {
+        m_assembler.ucvtf&lt;64, 64&gt;(dest, src);
+    }
+
+    void convertUInt64ToFloat(RegisterID src, FPRegisterID dest)
+    {
+        m_assembler.ucvtf&lt;32, 64&gt;(dest, src);
+    }
+
</ins><span class="cx">     void divDouble(FPRegisterID src, FPRegisterID dest)
</span><span class="cx">     {
</span><span class="cx">         divDouble(dest, src, dest);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86_64h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -1305,6 +1305,47 @@
</span><span class="cx">         m_assembler.cvtsi2ssq_mr(src.offset, src.base, dest);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // One of scratch or scratch2 may be the same as src
+    void convertUInt64ToDouble(RegisterID src, FPRegisterID dest, RegisterID scratch)
+    {
+        RegisterID scratch2 = scratchRegister();
+
+        m_assembler.testq_rr(src, src);
+        AssemblerLabel signBitSet = m_assembler.jCC(x86Condition(Signed));
+        m_assembler.cvtsi2sdq_rr(src, dest);
+        AssemblerLabel done = m_assembler.jmp();
+        m_assembler.linkJump(signBitSet, m_assembler.label());
+        if (scratch != src)
+            m_assembler.movq_rr(src, scratch);
+        m_assembler.movq_rr(src, scratch2);
+        m_assembler.shrq_i8r(1, scratch);
+        m_assembler.andq_ir(1, scratch2);
+        m_assembler.orq_rr(scratch, scratch2);
+        m_assembler.cvtsi2sdq_rr(scratch2, dest);
+        m_assembler.addsd_rr(dest, dest);
+        m_assembler.linkJump(done, m_assembler.label());
+    }
+
+    // One of scratch or scratch2 may be the same as src
+    void convertUInt64ToFloat(RegisterID src, FPRegisterID dest, RegisterID scratch)
+    {
+        RegisterID scratch2 = scratchRegister();
+        m_assembler.testq_rr(src, src);
+        AssemblerLabel signBitSet = m_assembler.jCC(x86Condition(Signed));
+        m_assembler.cvtsi2ssq_rr(src, dest);
+        AssemblerLabel done = m_assembler.jmp();
+        m_assembler.linkJump(signBitSet, m_assembler.label());
+        if (scratch != src)
+            m_assembler.movq_rr(src, scratch);
+        m_assembler.movq_rr(src, scratch2);
+        m_assembler.shrq_i8r(1, scratch);
+        m_assembler.andq_ir(1, scratch2);
+        m_assembler.orq_rr(scratch, scratch2);
+        m_assembler.cvtsi2ssq_rr(scratch2, dest);
+        m_assembler.addss_rr(dest, dest);
+        m_assembler.linkJump(done, m_assembler.label());
+    }
+
</ins><span class="cx">     static bool supportsFloatingPoint() { return true; }
</span><span class="cx">     static bool supportsFloatingPointTruncate() { return true; }
</span><span class="cx">     static bool supportsFloatingPointSqrt() { return true; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx"> #include &lt;string.h&gt;
</span><span class="cx"> #include &lt;thread&gt;
</span><span class="cx"> #include &lt;type_traits&gt;
</span><ins>+#include &lt;wtf/CommaPrinter.h&gt;
</ins><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="lines">@@ -2495,6 +2496,18 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx"> 
</span><ins>+static CString valueWithTypeOfWasmValue(ExecState* exec, VM&amp; vm, JSValue value, JSValue wasmValue)
+{
+    JSString* type = jsCast&lt;JSString*&gt;(wasmValue.get(exec, makeIdentifier(vm, &quot;type&quot;)));
+
+    const String&amp; typeString = type-&gt;value(exec);
+    if (typeString == &quot;i64&quot; || typeString == &quot;i32&quot;)
+        return toCString(typeString, &quot; &quot;, RawPointer(bitwise_cast&lt;void*&gt;(value)));
+    if (typeString == &quot;f32&quot;)
+        return toCString(typeString, &quot; hex: &quot;, RawPointer(bitwise_cast&lt;void*&gt;(value)), &quot;, float: &quot;, bitwise_cast&lt;float&gt;(static_cast&lt;uint32_t&gt;(JSValue::encode(value))));
+    return toCString(typeString, &quot; hex: &quot;, RawPointer(bitwise_cast&lt;void*&gt;(value)), &quot;, double: &quot;, bitwise_cast&lt;double&gt;(value));
+}
+
</ins><span class="cx"> static JSValue box(ExecState* exec, VM&amp; vm, JSValue wasmValue)
</span><span class="cx"> {
</span><span class="cx">     JSString* type = jsCast&lt;JSString*&gt;(wasmValue.get(exec, makeIdentifier(vm, &quot;type&quot;)));
</span><span class="lines">@@ -2502,9 +2515,14 @@
</span><span class="cx"> 
</span><span class="cx">     const String&amp; typeString = type-&gt;value(exec);
</span><span class="cx">     if (typeString == &quot;i64&quot;) {
</span><del>-        RELEASE_ASSERT(value.isString());
</del><span class="cx">         int64_t result;
</span><del>-        RELEASE_ASSERT(sscanf(bitwise_cast&lt;const char*&gt;(jsCast&lt;JSString*&gt;(value)-&gt;value(exec).characters8()), &quot;%lld&quot;, &amp;result) != EOF);
</del><ins>+        const char* str = toCString(jsCast&lt;JSString*&gt;(value)-&gt;value(exec)).data();
+        int scanResult;
+        if (std::strlen(str) &gt; 2 &amp;&amp; str[0] == '0' &amp;&amp; str[1] == 'x')
+            scanResult = sscanf(str, &quot;%llx&quot;, &amp;result);
+        else
+            scanResult = sscanf(str, &quot;%lld&quot;, &amp;result);
+        RELEASE_ASSERT(scanResult != EOF);
</ins><span class="cx">         return JSValue::decode(result);
</span><span class="cx">     }
</span><span class="cx">     RELEASE_ASSERT(value.isNumber());
</span><span class="lines">@@ -2582,7 +2600,13 @@
</span><span class="cx">             JSValue callResult = callWasmFunction(&amp;vm, *plan.compiledFunction(i)-&gt;jsEntryPoint, boxedArgs);
</span><span class="cx">             JSValue expected = box(exec, vm, result);
</span><span class="cx">             if (callResult != expected) {
</span><del>-                WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, toCString(&quot; (callResult == &quot;, RawPointer(bitwise_cast&lt;void*&gt;(callResult)), &quot;, expected == &quot;, RawPointer(bitwise_cast&lt;void*&gt;(expected)), &quot;)&quot;).data());
</del><ins>+                dataLog(&quot;Arguments: &quot;);
+                CommaPrinter comma(&quot;, &quot;);
+                for (unsigned argIndex = 0; argIndex &lt; arguments-&gt;length(); ++argIndex)
+                    dataLog(comma, valueWithTypeOfWasmValue(exec, vm, boxedArgs[argIndex], arguments-&gt;getIndexQuickly(argIndex)));
+                dataLogLn();
+
+                WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, toCString(&quot; (callResult == &quot;, valueWithTypeOfWasmValue(exec, vm, callResult, result), &quot;, expected == &quot;, valueWithTypeOfWasmValue(exec, vm, expected, result), &quot;)&quot;).data());
</ins><span class="cx">                 CRASH();
</span><span class="cx">             }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmB3IRGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -760,6 +760,48 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// Custom wasm ops. These are the ones too messy to do in wasm.json.
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;F64ConvertUI64&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Float, Origin());
+    if (isX86())
+        patchpoint-&gt;numGPScratchRegisters = 1;
+    patchpoint-&gt;append(ConstrainedValue(arg, ValueRep::WarmAny));
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        AllowMacroScratchRegisterUsage allowScratch(jit);
+#if CPU(X86_64)
+        jit.convertUInt64ToDouble(params[1].gpr(), params[0].fpr(), params.gpScratch(0));
+#else
+        jit.convertUInt64ToDouble(params[1].gpr(), params[0].fpr());
+#endif
+    });
+    patchpoint-&gt;effects = Effects::none();
+    result = patchpoint;
+    return true;
+}
+
+template&lt;&gt;
+bool B3IRGenerator::addOp&lt;OpType::F32ConvertUI64&gt;(ExpressionType arg, ExpressionType&amp; result)
+{
+    PatchpointValue* patchpoint = m_currentBlock-&gt;appendNew&lt;PatchpointValue&gt;(m_proc, Float, Origin());
+    if (isX86())
+        patchpoint-&gt;numGPScratchRegisters = 1;
+    patchpoint-&gt;append(ConstrainedValue(arg, ValueRep::WarmAny));
+    patchpoint-&gt;setGenerator([=] (CCallHelpers&amp; jit, const StackmapGenerationParams&amp; params) {
+        AllowMacroScratchRegisterUsage allowScratch(jit);
+#if CPU(X86_64)
+        jit.convertUInt64ToFloat(params[1].gpr(), params[0].fpr(), params.gpScratch(0));
+#else
+        jit.convertUInt64ToFloat(params[1].gpr(), params[0].fpr());
+#endif
+    });
+    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 (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -211,6 +211,8 @@
</span><span class="cx">     FOR_EACH_WASM_SIMPLE_BINARY_OP(CREATE_CASE)
</span><span class="cx"> #undef CREATE_CASE
</span><span class="cx"> 
</span><ins>+    case OpType::F32ConvertUI64: return unaryCase&lt;OpType::F32ConvertUI64&gt;();
+    case OpType::F64ConvertUI64: return unaryCase&lt;OpType::F64ConvertUI64&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>
<a id="trunkSourceJavaScriptCorewasmwasmjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/wasm.json (209203 => 209204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/wasm.json        2016-12-01 21:58:30 UTC (rev 209203)
+++ trunk/Source/JavaScriptCore/wasm/wasm.json        2016-12-01 22:00:23 UTC (rev 209204)
</span><span class="lines">@@ -199,15 +199,15 @@
</span><span class="cx">         &quot;i64.trunc_u/f64&quot;:     { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 177, &quot;return&quot;: [&quot;i64&quot;],      &quot;parameter&quot;: [&quot;f64&quot;],                  &quot;immediate&quot;: []                         },
</span><span class="cx">         &quot;i64.extend_s/i32&quot;:    { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 172, &quot;return&quot;: [&quot;i64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;SExt32&quot;       },
</span><span class="cx">         &quot;i64.extend_u/i32&quot;:    { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 173, &quot;return&quot;: [&quot;i64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;ZExt32&quot;       },
</span><del>-        &quot;f32.convert_s/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 178, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: []                         },
-        &quot;f32.convert_u/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 179, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: []                         },
-        &quot;f32.convert_s/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 180, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: []                         },
</del><ins>+        &quot;f32.convert_s/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 178, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToF&quot;         },
+        &quot;f32.convert_u/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 179, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToF(ZExt32(@0))&quot; },
+        &quot;f32.convert_s/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 180, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToF&quot;         },
</ins><span class="cx">         &quot;f32.convert_u/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 181, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: []                         },
</span><span class="cx">         &quot;f32.demote/f64&quot;:      { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 182, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;f64&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;DoubleToFloat&quot;},
</span><span class="cx">         &quot;f32.reinterpret/i32&quot;: { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 190, &quot;return&quot;: [&quot;f32&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;BitwiseCast&quot;  },
</span><del>-        &quot;f64.convert_s/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 183, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: []                         },
-        &quot;f64.convert_u/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 184, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: []                         },
-        &quot;f64.convert_s/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 185, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: []                         },
</del><ins>+        &quot;f64.convert_s/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 183, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToD&quot;         },
+        &quot;f64.convert_u/i32&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 184, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToD(ZExt32(@0))&quot; },
+        &quot;f64.convert_s/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 185, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;IToD&quot;         },
</ins><span class="cx">         &quot;f64.convert_u/i64&quot;:   { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 186, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: []                         },
</span><span class="cx">         &quot;f64.promote/f32&quot;:     { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 187, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;f32&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;FloatToDouble&quot;},
</span><span class="cx">         &quot;f64.reinterpret/i64&quot;: { &quot;category&quot;: &quot;conversion&quot;, &quot;value&quot;: 191, &quot;return&quot;: [&quot;f64&quot;],      &quot;parameter&quot;: [&quot;i64&quot;],                  &quot;immediate&quot;: [], &quot;b3op&quot;: &quot;BitwiseCast&quot;  },
</span></span></pre>
</div>
</div>

</body>
</html>