Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: src/interpreter/interpreter.cc

Issue 1392913002: [Interpreter] Adds shift operators to interpreter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed a typo in comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 156d3b4e90cba5ce5bbe995ec46e976702feae83..a9de0a272948a2058dde70770f5c2c74ccec6455 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -375,6 +375,42 @@ void Interpreter::DoMod(compiler::InterpreterAssembler* assembler) {
}
+// ShiftLeft <src>
+//
+// Left shifts accumulator by the count specified in register <src>.
rmcilroy 2015/10/08 14:53:07 "accumulator" -> "the accumulator"
oth 2015/10/08 16:11:38 Shouldn't it be Left shifts the register <src> by
+// accumulator is converted to a int32 and register <src> to uint32
rmcilroy 2015/10/08 14:53:07 nit "accumulator" -> "The accumulator" (it's the s
rmcilroy 2015/10/08 14:53:07 nit - a int32 -> an int32
+// before the operation. 5 lsb bits from register <src> are used as count.
rmcilroy 2015/10/08 14:53:07 nit - move "." from after "count" to after "0x1F)"
+// i.e. accumulator << (<src> & 0x1F)
+void Interpreter::DoShiftLeft(compiler::InterpreterAssembler* assembler) {
+ DoBinaryOp(Runtime::kShiftLeft, assembler);
+}
+
+
+// ShiftRight <src>
+//
+// Right shifts accumulator by the count specified in register <src>.
+// Result is sign extended.
rmcilroy 2015/10/08 14:53:07 Same comments here. Also, either bring the next se
+// accumulator is converted to a int32 and register <src> to uint32
+// before the operation. 5 lsb bits from register <src> are used as count.
+// i.e. accumulator >> (<src> & 0x1F)
+void Interpreter::DoShiftRight(compiler::InterpreterAssembler* assembler) {
+ DoBinaryOp(Runtime::kShiftRight, assembler);
+}
+
+
+// ShiftRightLogical <src>
+//
+// Right Shifts accumulator by the count specified in register <src>.
+// Result is zero-filled.
rmcilroy 2015/10/08 14:53:07 ditto
+// accumulator and register <src> are converted to uint32 before the operation
+// lsb bits from register <src> are used as count.
+// i.e. accumulator >> (<src> & 0x1F)
+void Interpreter::DoShiftRightLogical(
+ compiler::InterpreterAssembler* assembler) {
+ DoBinaryOp(Runtime::kShiftRightLogical, assembler);
+}
+
+
// LogicalNot
//
// Perform logical-not on the accumulator, first casting the
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698