<!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>[192051] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/192051">192051</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2015-11-04 21:50:02 -0800 (Wed, 04 Nov 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[JSC] Add B3-to-Air lowering for the shift opcodes
https://bugs.webkit.org/show_bug.cgi?id=150919
Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-11-04
Reviewed by Filip Pizlo.
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::rshift64):
(JSC::MacroAssemblerX86_64::urshift64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::shrq_CLr):
* b3/B3Const32Value.cpp:
(JSC::B3::Const32Value::shlConstant):
(JSC::B3::Const32Value::sShrConstant):
(JSC::B3::Const32Value::zShrConstant):
* b3/B3Const32Value.h:
* b3/B3Const64Value.cpp:
(JSC::B3::Const64Value::shlConstant):
(JSC::B3::Const64Value::sShrConstant):
(JSC::B3::Const64Value::zShrConstant):
* b3/B3Const64Value.h:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::appendShift):
(JSC::B3::Air::LowerToAir::tryShl):
(JSC::B3::Air::LowerToAir::trySShr):
(JSC::B3::Air::LowerToAir::tryZShr):
* b3/B3LoweringMatcher.patterns:
* b3/B3Opcode.h:
* b3/B3ReduceStrength.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::shlConstant):
(JSC::B3::Value::sShrConstant):
(JSC::B3::Value::zShrConstant):
* b3/B3Value.h:
* b3/air/AirInstInlines.h:
(JSC::B3::Air::isShiftValid):
(JSC::B3::Air::isRshift32Valid):
(JSC::B3::Air::isRshift64Valid):
(JSC::B3::Air::isUrshift32Valid):
(JSC::B3::Air::isUrshift64Valid):
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testShlArgs):
(JSC::B3::testShlImms):
(JSC::B3::testShlArgImm):
(JSC::B3::testShlArgs32):
(JSC::B3::testShlImms32):
(JSC::B3::testShlArgImm32):
(JSC::B3::testSShrArgs):
(JSC::B3::testSShrImms):
(JSC::B3::testSShrArgImm):
(JSC::B3::testSShrArgs32):
(JSC::B3::testSShrImms32):
(JSC::B3::testSShrArgImm32):
(JSC::B3::testZShrArgs):
(JSC::B3::testZShrImms):
(JSC::B3::testZShrArgImm):
(JSC::B3::testZShrArgs32):
(JSC::B3::testZShrImms32):
(JSC::B3::testZShrArgImm32):
(JSC::B3::run):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</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="#trunkSourceJavaScriptCoreb3B3Const32Valuecpp">trunk/Source/JavaScriptCore/b3/B3Const32Value.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Const32Valueh">trunk/Source/JavaScriptCore/b3/B3Const32Value.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Const64Valuecpp">trunk/Source/JavaScriptCore/b3/B3Const64Value.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Const64Valueh">trunk/Source/JavaScriptCore/b3/B3Const64Value.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3LowerToAircpp">trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3LoweringMatcherpatterns">trunk/Source/JavaScriptCore/b3/B3LoweringMatcher.patterns</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Opcodeh">trunk/Source/JavaScriptCore/b3/B3Opcode.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ReduceStrengthcpp">trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Valuecpp">trunk/Source/JavaScriptCore/b3/B3Value.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Valueh">trunk/Source/JavaScriptCore/b3/B3Value.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3airAirInstInlinesh">trunk/Source/JavaScriptCore/b3/air/AirInstInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3airAirOpcodeopcodes">trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3testb3cpp">trunk/Source/JavaScriptCore/b3/testb3.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -1,3 +1,66 @@
</span><ins>+2015-11-04 Benjamin Poulain <bpoulain@apple.com>
+
+ [JSC] Add B3-to-Air lowering for the shift opcodes
+ https://bugs.webkit.org/show_bug.cgi?id=150919
+
+ Reviewed by Filip Pizlo.
+
+ * assembler/MacroAssemblerX86_64.h:
+ (JSC::MacroAssemblerX86_64::rshift64):
+ (JSC::MacroAssemblerX86_64::urshift64):
+ * assembler/X86Assembler.h:
+ (JSC::X86Assembler::shrq_CLr):
+ * b3/B3Const32Value.cpp:
+ (JSC::B3::Const32Value::shlConstant):
+ (JSC::B3::Const32Value::sShrConstant):
+ (JSC::B3::Const32Value::zShrConstant):
+ * b3/B3Const32Value.h:
+ * b3/B3Const64Value.cpp:
+ (JSC::B3::Const64Value::shlConstant):
+ (JSC::B3::Const64Value::sShrConstant):
+ (JSC::B3::Const64Value::zShrConstant):
+ * b3/B3Const64Value.h:
+ * b3/B3LowerToAir.cpp:
+ (JSC::B3::Air::LowerToAir::appendShift):
+ (JSC::B3::Air::LowerToAir::tryShl):
+ (JSC::B3::Air::LowerToAir::trySShr):
+ (JSC::B3::Air::LowerToAir::tryZShr):
+ * b3/B3LoweringMatcher.patterns:
+ * b3/B3Opcode.h:
+ * b3/B3ReduceStrength.cpp:
+ * b3/B3Value.cpp:
+ (JSC::B3::Value::shlConstant):
+ (JSC::B3::Value::sShrConstant):
+ (JSC::B3::Value::zShrConstant):
+ * b3/B3Value.h:
+ * b3/air/AirInstInlines.h:
+ (JSC::B3::Air::isShiftValid):
+ (JSC::B3::Air::isRshift32Valid):
+ (JSC::B3::Air::isRshift64Valid):
+ (JSC::B3::Air::isUrshift32Valid):
+ (JSC::B3::Air::isUrshift64Valid):
+ * b3/air/AirOpcode.opcodes:
+ * b3/testb3.cpp:
+ (JSC::B3::testShlArgs):
+ (JSC::B3::testShlImms):
+ (JSC::B3::testShlArgImm):
+ (JSC::B3::testShlArgs32):
+ (JSC::B3::testShlImms32):
+ (JSC::B3::testShlArgImm32):
+ (JSC::B3::testSShrArgs):
+ (JSC::B3::testSShrImms):
+ (JSC::B3::testSShrArgImm):
+ (JSC::B3::testSShrArgs32):
+ (JSC::B3::testSShrImms32):
+ (JSC::B3::testSShrArgImm32):
+ (JSC::B3::testZShrArgs):
+ (JSC::B3::testZShrImms):
+ (JSC::B3::testZShrArgImm):
+ (JSC::B3::testZShrArgs32):
+ (JSC::B3::testZShrImms32):
+ (JSC::B3::testZShrArgImm32):
+ (JSC::B3::run):
+
</ins><span class="cx"> 2015-11-03 Filip Pizlo <fpizlo@apple.com>
</span><span class="cx">
</span><span class="cx"> B3 should be able to compile a Check
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86_64h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -347,12 +347,40 @@
</span><span class="cx"> {
</span><span class="cx"> m_assembler.sarq_i8r(imm.m_value, dest);
</span><span class="cx"> }
</span><del>-
</del><ins>+
+ void rshift64(RegisterID src, RegisterID dest)
+ {
+ ASSERT(src != dest);
+
+ if (src == X86Registers::ecx)
+ m_assembler.sarq_CLr(dest);
+ else {
+ // Can only shift by ecx, so we do some swapping if we see anything else.
+ swap(src, X86Registers::ecx);
+ m_assembler.sarq_CLr(dest);
+ swap(src, X86Registers::ecx);
+ }
+ }
+
</ins><span class="cx"> void urshift64(TrustedImm32 imm, RegisterID dest)
</span><span class="cx"> {
</span><span class="cx"> m_assembler.shrq_i8r(imm.m_value, dest);
</span><span class="cx"> }
</span><del>-
</del><ins>+
+ void urshift64(RegisterID src, RegisterID dest)
+ {
+ ASSERT(src != dest);
+
+ if (src == X86Registers::ecx)
+ m_assembler.shrq_CLr(dest);
+ else {
+ // Can only shift by ecx, so we do some swapping if we see anything else.
+ swap(src, X86Registers::ecx);
+ m_assembler.shrq_CLr(dest);
+ swap(src, X86Registers::ecx);
+ }
+ }
+
</ins><span class="cx"> void mul64(RegisterID src, RegisterID dest)
</span><span class="cx"> {
</span><span class="cx"> m_assembler.imulq_rr(src, dest);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerX86Assemblerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/X86Assembler.h (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/X86Assembler.h        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/assembler/X86Assembler.h        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -901,6 +901,11 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ void shrq_CLr(RegisterID dst)
+ {
+ m_formatter.oneByteOp64(OP_GROUP2_EvCL, GROUP2_OP_SHR, dst);
+ }
+
</ins><span class="cx"> void shlq_i8r(int imm, RegisterID dst)
</span><span class="cx"> {
</span><span class="cx"> if (imm == 1)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Const32Valuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Const32Value.cpp (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Const32Value.cpp        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3Const32Value.cpp        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -82,6 +82,27 @@
</span><span class="cx"> return proc.add<Const32Value>(origin(), m_value ^ other->asInt32());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Value* Const32Value::shlConstant(Procedure& proc, Value* other) const
+{
+ if (!other->hasInt32())
+ return nullptr;
+ return proc.add<Const32Value>(origin(), m_value << (other->asInt32() & 31));
+}
+
+Value* Const32Value::sShrConstant(Procedure& proc, Value* other) const
+{
+ if (!other->hasInt32())
+ return nullptr;
+ return proc.add<Const32Value>(origin(), m_value >> (other->asInt32() & 31));
+}
+
+Value* Const32Value::zShrConstant(Procedure& proc, Value* other) const
+{
+ if (!other->hasInt32())
+ return nullptr;
+ return proc.add<Const32Value>(origin(), static_cast<int32_t>(static_cast<uint32_t>(m_value) >> (other->asInt32() & 31)));
+}
+
</ins><span class="cx"> Value* Const32Value::equalConstant(Procedure& proc, Value* other) const
</span><span class="cx"> {
</span><span class="cx"> if (!other->hasInt32())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Const32Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Const32Value.h (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Const32Value.h        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3Const32Value.h        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -47,6 +47,9 @@
</span><span class="cx"> Value* bitAndConstant(Procedure&, Value* other) const override;
</span><span class="cx"> Value* bitOrConstant(Procedure&, Value* other) const override;
</span><span class="cx"> Value* bitXorConstant(Procedure&, Value* other) const override;
</span><ins>+ Value* shlConstant(Procedure&, Value* other) const override;
+ Value* sShrConstant(Procedure&, Value* other) const override;
+ Value* zShrConstant(Procedure&, Value* other) const override;
</ins><span class="cx"> Value* equalConstant(Procedure&, Value* other) const override;
</span><span class="cx"> Value* notEqualConstant(Procedure&, Value* other) const override;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Const64Valuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Const64Value.cpp (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Const64Value.cpp        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3Const64Value.cpp        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -82,6 +82,27 @@
</span><span class="cx"> return proc.add<Const64Value>(origin(), m_value ^ other->asInt64());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Value* Const64Value::shlConstant(Procedure& proc, Value* other) const
+{
+ if (!other->hasInt32())
+ return nullptr;
+ return proc.add<Const64Value>(origin(), m_value << (other->asInt32() & 63));
+}
+
+Value* Const64Value::sShrConstant(Procedure& proc, Value* other) const
+{
+ if (!other->hasInt32())
+ return nullptr;
+ return proc.add<Const64Value>(origin(), m_value >> (other->asInt32() & 63));
+}
+
+Value* Const64Value::zShrConstant(Procedure& proc, Value* other) const
+{
+ if (!other->hasInt32())
+ return nullptr;
+ return proc.add<Const64Value>(origin(), static_cast<int64_t>(static_cast<uint64_t>(m_value) >> (other->asInt32() & 63)));
+}
+
</ins><span class="cx"> Value* Const64Value::equalConstant(Procedure& proc, Value* other) const
</span><span class="cx"> {
</span><span class="cx"> if (!other->hasInt64())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Const64Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Const64Value.h (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Const64Value.h        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3Const64Value.h        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -47,6 +47,9 @@
</span><span class="cx"> Value* bitAndConstant(Procedure&, Value* other) const override;
</span><span class="cx"> Value* bitOrConstant(Procedure&, Value* other) const override;
</span><span class="cx"> Value* bitXorConstant(Procedure&, Value* other) const override;
</span><ins>+ Value* shlConstant(Procedure&, Value* other) const override;
+ Value* sShrConstant(Procedure&, Value* other) const override;
+ Value* zShrConstant(Procedure&, Value* other) const override;
</ins><span class="cx"> Value* equalConstant(Procedure&, Value* other) const override;
</span><span class="cx"> Value* notEqualConstant(Procedure&, Value* other) const override;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3LowerToAircpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -754,21 +754,39 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- bool tryShl(Value* value, Value* amount)
</del><ins>+ void appendShift(Air::Opcode opcode, Value* value, Value* amount)
</ins><span class="cx"> {
</span><del>- Air::Opcode opcode = value->type() == Int32 ? Lshift32 : Lshift64;
-
</del><span class="cx"> if (imm(amount)) {
</span><span class="cx"> append(Move, tmp(value), tmp(currentValue));
</span><span class="cx"> append(opcode, imm(amount), tmp(currentValue));
</span><del>- return true;
</del><ins>+ return;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> append(Move, tmp(value), tmp(currentValue));
</span><span class="cx"> append(Move, tmp(amount), Tmp(X86Registers::ecx));
</span><span class="cx"> append(opcode, Tmp(X86Registers::ecx), tmp(currentValue));
</span><ins>+ }
+
+ bool tryShl(Value* value, Value* amount)
+ {
+ Air::Opcode opcode = value->type() == Int32 ? Lshift32 : Lshift64;
+ appendShift(opcode, value, amount);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><ins>+
+ bool trySShr(Value* value, Value* amount)
+ {
+ Air::Opcode opcode = value->type() == Int32 ? Rshift32 : Rshift64;
+ appendShift(opcode, value, amount);
+ return true;
+ }
+
+ bool tryZShr(Value* value, Value* amount)
+ {
+ Air::Opcode opcode = value->type() == Int32 ? Urshift32 : Urshift64;
+ appendShift(opcode, value, amount);
+ return true;
+ }
</ins><span class="cx">
</span><span class="cx"> bool tryStoreAddLoad(Value* left, Value* right, Value*)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3LoweringMatcherpatterns"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3LoweringMatcher.patterns (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3LoweringMatcher.patterns        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3LoweringMatcher.patterns        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -37,6 +37,8 @@
</span><span class="cx"> Xor = BitXor(left, right)
</span><span class="cx">
</span><span class="cx"> Shl = Shl(value, amount)
</span><ins>+SShr = SShr(value, amount)
+ZShr = ZShr(value, amount)
</ins><span class="cx">
</span><span class="cx"> StoreAddLoad = Store(Add(left, right), address)
</span><span class="cx"> StoreSubLoad = Store(Sub(left, right), address)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Opcodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Opcode.h (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Opcode.h        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3Opcode.h        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx"> BitOr,
</span><span class="cx"> BitXor,
</span><span class="cx"> Shl,
</span><del>- SShr,
- ZShr,
</del><ins>+ SShr, // Arithmetic Shift.
+ ZShr, // Logical Shift.
</ins><span class="cx">
</span><span class="cx"> // Casts and such.
</span><span class="cx"> // Takes and returns Int32:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ReduceStrengthcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -283,6 +283,45 @@
</span><span class="cx">
</span><span class="cx"> break;
</span><span class="cx">
</span><ins>+ case Shl:
+ // Turn this: Shl(constant1, constant2)
+ // Into this: constant1 << constant2
+ if (Value* constant = m_value->child(0)->shlConstant(m_proc, m_value->child(1))) {
+ replaceWithNewValue(constant);
+ break;
+ }
+
+ if (handleShiftByZero())
+ break;
+
+ break;
+
+ case SShr:
+ // Turn this: SShr(constant1, constant2)
+ // Into this: constant1 >> constant2
+ if (Value* constant = m_value->child(0)->sShrConstant(m_proc, m_value->child(1))) {
+ replaceWithNewValue(constant);
+ break;
+ }
+
+ if (handleShiftByZero())
+ break;
+
+ break;
+
+ case ZShr:
+ // Turn this: ZShr(constant1, constant2)
+ // Into this: (unsigned)constant1 >> constant2
+ if (Value* constant = m_value->child(0)->zShrConstant(m_proc, m_value->child(1))) {
+ replaceWithNewValue(constant);
+ break;
+ }
+
+ if (handleShiftByZero())
+ break;
+
+ break;
+
</ins><span class="cx"> case Load8Z:
</span><span class="cx"> case Load8S:
</span><span class="cx"> case Load16Z:
</span><span class="lines">@@ -478,6 +517,17 @@
</span><span class="cx"> m_changed = true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ bool handleShiftByZero()
+ {
+ // Shift anything by zero is identity.
+ if (m_value->child(1)->isInt(0)) {
+ m_value->replaceWithIdentity(m_value->child(0));
+ m_changed = true;
+ return true;
+ }
+ return false;
+ }
+
</ins><span class="cx"> void killDeadCode()
</span><span class="cx"> {
</span><span class="cx"> GraphNodeWorklist<Value*, IndexSet<Value>> worklist;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Valuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Value.cpp (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Value.cpp        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3Value.cpp        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -147,6 +147,21 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Value* Value::shlConstant(Procedure&, Value*) const
+{
+ return nullptr;
+}
+
+Value* Value::sShrConstant(Procedure&, Value*) const
+{
+ return nullptr;
+}
+
+Value* Value::zShrConstant(Procedure&, Value*) const
+{
+ return nullptr;
+}
+
</ins><span class="cx"> Value* Value::equalConstant(Procedure&, Value*) const
</span><span class="cx"> {
</span><span class="cx"> return nullptr;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Value.h (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Value.h        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/B3Value.h        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -115,6 +115,9 @@
</span><span class="cx"> virtual Value* bitAndConstant(Procedure&, Value* other) const;
</span><span class="cx"> virtual Value* bitOrConstant(Procedure&, Value* other) const;
</span><span class="cx"> virtual Value* bitXorConstant(Procedure&, Value* other) const;
</span><ins>+ virtual Value* shlConstant(Procedure&, Value* other) const;
+ virtual Value* sShrConstant(Procedure&, Value* other) const;
+ virtual Value* zShrConstant(Procedure&, Value* other) const;
</ins><span class="cx"> virtual Value* equalConstant(Procedure&, Value* other) const;
</span><span class="cx"> virtual Value* notEqualConstant(Procedure&, Value* other) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3airAirInstInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/air/AirInstInlines.h (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/air/AirInstInlines.h        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/air/AirInstInlines.h        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> UNUSED_PARAM(inst);
</span><span class="cx"> return true;
</span><span class="cx"> #endif
</span><del>-}
</del><ins>+}
</ins><span class="cx">
</span><span class="cx"> inline bool isLshift32Valid(const Inst& inst)
</span><span class="cx"> {
</span><span class="lines">@@ -108,6 +108,26 @@
</span><span class="cx"> return isShiftValid(inst);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline bool isRshift32Valid(const Inst& inst)
+{
+ return isShiftValid(inst);
+}
+
+inline bool isRshift64Valid(const Inst& inst)
+{
+ return isShiftValid(inst);
+}
+
+inline bool isUrshift32Valid(const Inst& inst)
+{
+ return isShiftValid(inst);
+}
+
+inline bool isUrshift64Valid(const Inst& inst)
+{
+ return isShiftValid(inst);
+}
+
</ins><span class="cx"> } } } // namespace JSC::B3::Air
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(B3_JIT)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3airAirOpcodeopcodes"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -114,6 +114,26 @@
</span><span class="cx"> Tmp*, Tmp
</span><span class="cx"> Imm, Tmp
</span><span class="cx">
</span><ins>+Lshift64 U:G, UD:G
+ Tmp*, Tmp
+ Imm, Tmp
+
+Rshift32 U:G, UD:G
+ Tmp*, Tmp
+ Imm, Tmp
+
+Rshift64 U:G, UD:G
+ Tmp*, Tmp
+ Imm, Tmp
+
+Urshift32 U:G, UD:G
+ Tmp*, Tmp
+ Imm, Tmp
+
+Urshift64 U:G, UD:G
+ Tmp*, Tmp
+ Imm, Tmp
+
</ins><span class="cx"> Or32 U:G, UD:G
</span><span class="cx"> Tmp, Tmp
</span><span class="cx"> Imm, Tmp
</span><span class="lines">@@ -137,10 +157,6 @@
</span><span class="cx"> Tmp, Addr
</span><span class="cx"> Imm, Tmp
</span><span class="cx">
</span><del>-Lshift64 U:G, UD:G
- Tmp*, Tmp
- Imm, Tmp
-
</del><span class="cx"> Mul32 U:G, UD:G
</span><span class="cx"> Tmp, Tmp
</span><span class="cx"> Addr, Tmp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3testb3cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/testb3.cpp (192050 => 192051)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/testb3.cpp        2015-11-05 04:09:25 UTC (rev 192050)
+++ trunk/Source/JavaScriptCore/b3/testb3.cpp        2015-11-05 05:50:02 UTC (rev 192051)
</span><span class="lines">@@ -966,6 +966,282 @@
</span><span class="cx"> CHECK(compileAndRun<int>(proc, b) == (a ^ (b ^ c)));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void testShlArgs(int64_t a, int64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, Shl, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))));
+
+ CHECK(compileAndRun<int64_t>(proc, a, b) == (a << b));
+}
+
+void testShlImms(int64_t a, int64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, Shl, Origin(),
+ root->appendNew<Const64Value>(proc, Origin(), a),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<int64_t>(proc) == (a << b));
+}
+
+void testShlArgImm(int64_t a, int64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, Shl, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<int64_t>(proc, a) == (a << b));
+}
+
+void testShlArgs32(int32_t a, int32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, Shl, Origin(),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))));
+
+ CHECK(compileAndRun<int32_t>(proc, a, b) == (a << b));
+}
+
+void testShlImms32(int32_t a, int32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, Shl, Origin(),
+ root->appendNew<Const32Value>(proc, Origin(), a),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<int32_t>(proc) == (a << b));
+}
+
+void testShlArgImm32(int32_t a, int32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, Shl, Origin(),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<int32_t>(proc, a) == (a << b));
+}
+
+void testSShrArgs(int64_t a, int64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, SShr, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))));
+
+ CHECK(compileAndRun<int64_t>(proc, a, b) == (a >> b));
+}
+
+void testSShrImms(int64_t a, int64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, SShr, Origin(),
+ root->appendNew<Const64Value>(proc, Origin(), a),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<int64_t>(proc) == (a >> b));
+}
+
+void testSShrArgImm(int64_t a, int64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, SShr, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<int64_t>(proc, a) == (a >> b));
+}
+
+void testSShrArgs32(int32_t a, int32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, SShr, Origin(),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))));
+
+ CHECK(compileAndRun<int32_t>(proc, a, b) == (a >> b));
+}
+
+void testSShrImms32(int32_t a, int32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, SShr, Origin(),
+ root->appendNew<Const32Value>(proc, Origin(), a),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<int32_t>(proc) == (a >> b));
+}
+
+void testSShrArgImm32(int32_t a, int32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, SShr, Origin(),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<int32_t>(proc, a) == (a >> b));
+}
+
+void testZShrArgs(uint64_t a, uint64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, ZShr, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))));
+
+ CHECK(compileAndRun<uint64_t>(proc, a, b) == (a >> b));
+}
+
+void testZShrImms(uint64_t a, uint64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, ZShr, Origin(),
+ root->appendNew<Const64Value>(proc, Origin(), a),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<uint64_t>(proc) == (a >> b));
+}
+
+void testZShrArgImm(uint64_t a, uint64_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, ZShr, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<uint64_t>(proc, a) == (a >> b));
+}
+
+void testZShrArgs32(uint32_t a, uint32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, ZShr, Origin(),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))));
+
+ CHECK(compileAndRun<uint32_t>(proc, a, b) == (a >> b));
+}
+
+void testZShrImms32(uint32_t a, uint32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, ZShr, Origin(),
+ root->appendNew<Const32Value>(proc, Origin(), a),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<uint32_t>(proc) == (a >> b));
+}
+
+void testZShrArgImm32(uint32_t a, uint32_t b)
+{
+ Procedure proc;
+ BasicBlock* root = proc.addBlock();
+ root->appendNew<ControlValue>(
+ proc, Return, Origin(),
+ root->appendNew<Value>(
+ proc, ZShr, Origin(),
+ root->appendNew<Value>(
+ proc, Trunc, Origin(),
+ root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)),
+ root->appendNew<Const32Value>(proc, Origin(), b)));
+
+ CHECK(compileAndRun<uint32_t>(proc, a) == (a >> b));
+}
+
</ins><span class="cx"> void testStore(int value)
</span><span class="cx"> {
</span><span class="cx"> Procedure proc;
</span><span class="lines">@@ -2245,6 +2521,129 @@
</span><span class="cx"> RUN(testBitXorImmBitXorArgImm32(6, 1, 6));
</span><span class="cx"> RUN(testBitXorImmBitXorArgImm32(24, 0xffff, 7));
</span><span class="cx">
</span><ins>+ RUN(testShlArgs(1, 0));
+ RUN(testShlArgs(1, 1));
+ RUN(testShlArgs(1, 62));
+ RUN(testShlArgs(0xffffffffffffffff, 0));
+ RUN(testShlArgs(0xffffffffffffffff, 1));
+ RUN(testShlArgs(0xffffffffffffffff, 63));
+ RUN(testShlImms(1, 0));
+ RUN(testShlImms(1, 1));
+ RUN(testShlImms(1, 62));
+ RUN(testShlImms(1, 65));
+ RUN(testShlImms(0xffffffffffffffff, 0));
+ RUN(testShlImms(0xffffffffffffffff, 1));
+ RUN(testShlImms(0xffffffffffffffff, 63));
+ RUN(testShlArgImm(1, 0));
+ RUN(testShlArgImm(1, 1));
+ RUN(testShlArgImm(1, 62));
+ RUN(testShlArgImm(1, 65));
+ RUN(testShlArgImm(0xffffffffffffffff, 0));
+ RUN(testShlArgImm(0xffffffffffffffff, 1));
+ RUN(testShlArgImm(0xffffffffffffffff, 63));
+ RUN(testShlArgs32(1, 0));
+ RUN(testShlArgs32(1, 1));
+ RUN(testShlArgs32(1, 62));
+ RUN(testShlImms32(1, 33));
+ RUN(testShlArgs32(0xffffffff, 0));
+ RUN(testShlArgs32(0xffffffff, 1));
+ RUN(testShlArgs32(0xffffffff, 63));
+ RUN(testShlImms32(1, 0));
+ RUN(testShlImms32(1, 1));
+ RUN(testShlImms32(1, 62));
+ RUN(testShlImms32(1, 33));
+ RUN(testShlImms32(0xffffffff, 0));
+ RUN(testShlImms32(0xffffffff, 1));
+ RUN(testShlImms32(0xffffffff, 63));
+ RUN(testShlArgImm32(1, 0));
+ RUN(testShlArgImm32(1, 1));
+ RUN(testShlArgImm32(1, 62));
+ RUN(testShlArgImm32(0xffffffff, 0));
+ RUN(testShlArgImm32(0xffffffff, 1));
+ RUN(testShlArgImm32(0xffffffff, 63));
+
+ RUN(testSShrArgs(1, 0));
+ RUN(testSShrArgs(1, 1));
+ RUN(testSShrArgs(1, 62));
+ RUN(testSShrArgs(0xffffffffffffffff, 0));
+ RUN(testSShrArgs(0xffffffffffffffff, 1));
+ RUN(testSShrArgs(0xffffffffffffffff, 63));
+ RUN(testSShrImms(1, 0));
+ RUN(testSShrImms(1, 1));
+ RUN(testSShrImms(1, 62));
+ RUN(testSShrImms(1, 65));
+ RUN(testSShrImms(0xffffffffffffffff, 0));
+ RUN(testSShrImms(0xffffffffffffffff, 1));
+ RUN(testSShrImms(0xffffffffffffffff, 63));
+ RUN(testSShrArgImm(1, 0));
+ RUN(testSShrArgImm(1, 1));
+ RUN(testSShrArgImm(1, 62));
+ RUN(testSShrArgImm(1, 65));
+ RUN(testSShrArgImm(0xffffffffffffffff, 0));
+ RUN(testSShrArgImm(0xffffffffffffffff, 1));
+ RUN(testSShrArgImm(0xffffffffffffffff, 63));
+ RUN(testSShrArgs32(1, 0));
+ RUN(testSShrArgs32(1, 1));
+ RUN(testSShrArgs32(1, 62));
+ RUN(testSShrArgs32(1, 33));
+ RUN(testSShrArgs32(0xffffffff, 0));
+ RUN(testSShrArgs32(0xffffffff, 1));
+ RUN(testSShrArgs32(0xffffffff, 63));
+ RUN(testSShrImms32(1, 0));
+ RUN(testSShrImms32(1, 1));
+ RUN(testSShrImms32(1, 62));
+ RUN(testSShrImms32(1, 33));
+ RUN(testSShrImms32(0xffffffff, 0));
+ RUN(testSShrImms32(0xffffffff, 1));
+ RUN(testSShrImms32(0xffffffff, 63));
+ RUN(testSShrArgImm32(1, 0));
+ RUN(testSShrArgImm32(1, 1));
+ RUN(testSShrArgImm32(1, 62));
+ RUN(testSShrArgImm32(0xffffffff, 0));
+ RUN(testSShrArgImm32(0xffffffff, 1));
+ RUN(testSShrArgImm32(0xffffffff, 63));
+
+ RUN(testZShrArgs(1, 0));
+ RUN(testZShrArgs(1, 1));
+ RUN(testZShrArgs(1, 62));
+ RUN(testZShrArgs(0xffffffffffffffff, 0));
+ RUN(testZShrArgs(0xffffffffffffffff, 1));
+ RUN(testZShrArgs(0xffffffffffffffff, 63));
+ RUN(testZShrImms(1, 0));
+ RUN(testZShrImms(1, 1));
+ RUN(testZShrImms(1, 62));
+ RUN(testZShrImms(1, 65));
+ RUN(testZShrImms(0xffffffffffffffff, 0));
+ RUN(testZShrImms(0xffffffffffffffff, 1));
+ RUN(testZShrImms(0xffffffffffffffff, 63));
+ RUN(testZShrArgImm(1, 0));
+ RUN(testZShrArgImm(1, 1));
+ RUN(testZShrArgImm(1, 62));
+ RUN(testZShrArgImm(1, 65));
+ RUN(testZShrArgImm(0xffffffffffffffff, 0));
+ RUN(testZShrArgImm(0xffffffffffffffff, 1));
+ RUN(testZShrArgImm(0xffffffffffffffff, 63));
+ RUN(testZShrArgs32(1, 0));
+ RUN(testZShrArgs32(1, 1));
+ RUN(testZShrArgs32(1, 62));
+ RUN(testZShrArgs32(1, 33));
+ RUN(testZShrArgs32(0xffffffff, 0));
+ RUN(testZShrArgs32(0xffffffff, 1));
+ RUN(testZShrArgs32(0xffffffff, 63));
+ RUN(testZShrImms32(1, 0));
+ RUN(testZShrImms32(1, 1));
+ RUN(testZShrImms32(1, 62));
+ RUN(testZShrImms32(1, 33));
+ RUN(testZShrImms32(0xffffffff, 0));
+ RUN(testZShrImms32(0xffffffff, 1));
+ RUN(testZShrImms32(0xffffffff, 63));
+ RUN(testZShrArgImm32(1, 0));
+ RUN(testZShrArgImm32(1, 1));
+ RUN(testZShrArgImm32(1, 62));
+ RUN(testZShrArgImm32(0xffffffff, 0));
+ RUN(testZShrArgImm32(0xffffffff, 1));
+ RUN(testZShrArgImm32(0xffffffff, 63));
+
</ins><span class="cx"> RUN(testStore(44));
</span><span class="cx"> RUN(testStoreConstant(49));
</span><span class="cx"> RUN(testStoreConstantPtr(49));
</span></span></pre>
</div>
</div>
</body>
</html>