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

Unified Diff: test/cctest/test-macro-assembler-mips.cc

Issue 24266007: MIPS: Fixed a bug in CopyBytes() and new test cases for MIPS macro assembler. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years, 3 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/cctest.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-macro-assembler-mips.cc
diff --git a/test/cctest/test-macro-assembler-arm.cc b/test/cctest/test-macro-assembler-mips.cc
similarity index 90%
copy from test/cctest/test-macro-assembler-arm.cc
copy to test/cctest/test-macro-assembler-mips.cc
index 77f7abbd44356c7684e90c99cd12d77247a60cba..b7151dc85348f46c87050ce0eb92cf681811e1d0 100644
--- a/test/cctest/test-macro-assembler-arm.cc
+++ b/test/cctest/test-macro-assembler-mips.cc
@@ -29,8 +29,8 @@
#include "v8.h"
#include "macro-assembler.h"
-#include "arm/macro-assembler-arm.h"
-#include "arm/simulator-arm.h"
+#include "mips/macro-assembler-mips.h"
+#include "mips/simulator-mips.h"
#include "cctest.h"
@@ -74,20 +74,20 @@ TEST(CopyBytes) {
CHECK(act_size >= static_cast<size_t>(data_size));
// Storage for R0 and R1.
Bangfu 2013/09/23 12:59:07 should be: // Storage for a0 and a1
kilvadyb 2013/09/23 15:30:16 Done.
- byte* r0_;
- byte* r1_;
+ byte* a0_;
+ byte* a1_;
MacroAssembler assembler(isolate, NULL, 0);
MacroAssembler* masm = &assembler;
// Code to be generated: The stuff in CopyBytes followed by a store of R0 and
// R1, respectively.
- __ CopyBytes(r0, r1, r2, r3);
- __ mov(r2, Operand(reinterpret_cast<int>(&r0_)));
- __ mov(r3, Operand(reinterpret_cast<int>(&r1_)));
- __ str(r0, MemOperand(r2));
- __ str(r1, MemOperand(r3));
- __ bx(lr);
+ __ CopyBytes(a0, a1, a2, a3);
+ __ li(a2, Operand(reinterpret_cast<int>(&a0_)));
+ __ li(a3, Operand(reinterpret_cast<int>(&a1_)));
+ __ sw(a0, MemOperand(a2));
+ __ jr(ra);
+ __ sw(a1, MemOperand(a3));
CodeDesc desc;
masm->GetCode(&desc);
@@ -97,7 +97,7 @@ TEST(CopyBytes) {
Handle<Code>())->ToObjectChecked();
CHECK(code->IsCode());
- F f = FUNCTION_CAST<F>(Code::cast(code)->entry());
+ ::F f = FUNCTION_CAST< ::F>(Code::cast(code)->entry());
// Initialise source data with non-zero bytes.
for (int i = 0; i < data_size; i++) {
@@ -114,8 +114,8 @@ TEST(CopyBytes) {
(void) CALL_GENERATED_CODE(f, reinterpret_cast<int>(src),
reinterpret_cast<int>(dest), size, 0, 0);
// R0 and R1 should point at the first byte after the copied data.
Bangfu 2013/09/23 12:59:07 // a0 and a1
kilvadyb 2013/09/23 15:30:16 Done.
- CHECK_EQ(src + size, r0_);
- CHECK_EQ(dest + size, r1_);
+ CHECK_EQ(src + size, a0_);
+ CHECK_EQ(dest + size, a1_);
// Check that we haven't written outside the target area.
CHECK(all_zeroes(dest_buffer, dest));
CHECK(all_zeroes(dest + size, dest_buffer + data_size));
« no previous file with comments | « test/cctest/cctest.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698