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

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 434553002: [arm] Add support for ROR. Refactor operand2 handling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « test/cctest/compiler/test-instruction-selector-arm.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
index 331b08247c5eb71b3f6cc0250f4a14286494582e..a4f915653fc150c928a80a69392557206e472366 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <functional>
#include <limits>
-#include "src/v8.h"
#include "test/cctest/cctest.h"
#include "test/cctest/compiler/codegen-tester.h"
@@ -3680,6 +3680,53 @@ TEST(RunTestIntPtrArithmetic) {
}
+static inline uint32_t rotr32(uint32_t i, uint32_t j) {
+ return (i >> j) | (i << (32 - j));
+}
+
+
+TEST(RunTestInt32RotateRightP) {
+ {
+ RawMachineAssemblerTester<int32_t> m;
+ Int32BinopTester bt(&m);
+ bt.AddReturn(m.Word32Or(
+ m.Word32Shr(bt.param0, bt.param1),
+ m.Word32Shl(bt.param0, m.Int32Sub(m.Int32Constant(32), bt.param1))));
+ bt.Run(ValueHelper::uint32_vector(), ValueHelper::ror_vector(), rotr32);
+ }
+ {
+ RawMachineAssemblerTester<int32_t> m;
+ Int32BinopTester bt(&m);
+ bt.AddReturn(m.Word32Or(
+ m.Word32Shl(bt.param0, m.Int32Sub(m.Int32Constant(32), bt.param1)),
+ m.Word32Shr(bt.param0, bt.param1)));
+ bt.Run(ValueHelper::uint32_vector(), ValueHelper::ror_vector(), rotr32);
+ }
+}
+
+
+TEST(RunTestInt32RotateRightImm) {
+ FOR_INPUTS(uint32_t, ror, i) {
+ {
+ RawMachineAssemblerTester<int32_t> m(kMachineWord32);
+ Node* value = m.Parameter(0);
+ m.Return(m.Word32Or(m.Word32Shr(value, m.Int32Constant(*i)),
+ m.Word32Shl(value, m.Int32Constant(32 - *i))));
+ m.Run(ValueHelper::uint32_vector(),
+ std::bind2nd(std::ptr_fun(&rotr32), *i));
+ }
+ {
+ RawMachineAssemblerTester<int32_t> m(kMachineWord32);
+ Node* value = m.Parameter(0);
+ m.Return(m.Word32Or(m.Word32Shl(value, m.Int32Constant(32 - *i)),
+ m.Word32Shr(value, m.Int32Constant(*i))));
+ m.Run(ValueHelper::uint32_vector(),
+ std::bind2nd(std::ptr_fun(&rotr32), *i));
+ }
+ }
+}
+
+
TEST(RunSpillLotsOfThings) {
static const int kInputSize = 1000;
RawMachineAssemblerTester<void> m;
« no previous file with comments | « test/cctest/compiler/test-instruction-selector-arm.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698