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 |