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

Unified Diff: test/cctest/test-code-stubs-a64.cc

Issue 160423002: A64 support for DoubleToIStub (truncating). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test cases Created 6 years, 10 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/test-code-stubs.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-code-stubs-a64.cc
diff --git a/test/cctest/test-code-stubs-arm.cc b/test/cctest/test-code-stubs-a64.cc
similarity index 80%
copy from test/cctest/test-code-stubs-arm.cc
copy to test/cctest/test-code-stubs-a64.cc
index 53cdd161308b903ea92bdf6a25b03c3cfdaaee49..5d5d3702edd74ccc20594be60f339cb2f817b324 100644
--- a/test/cctest/test-code-stubs-arm.cc
+++ b/test/cctest/test-code-stubs-a64.cc
@@ -58,19 +58,15 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
byte* start = stub.GetCode(isolate)->instruction_start();
Label done;
- // Save callee save registers.
- __ Push(r7, r6, r5, r4);
- __ Push(lr);
+ __ SetStackPointer(csp);
+ __ PushCalleeSavedRegisters();
+ __ Mov(jssp, csp);
+ __ SetStackPointer(jssp);
- // For softfp, move the input value into d0.
- if (!masm.use_eabi_hardfloat()) {
- __ vmov(d0, r0, r1);
- }
// Push the double argument.
- __ sub(sp, sp, Operand(kDoubleSize));
- __ vstr(d0, sp, 0);
- if (!source_reg.is(sp)) {
- __ mov(source_reg, sp);
+ __ Push(d0);
+ if (!source_reg.is(jssp)) {
+ __ Mov(source_reg, jssp);
}
// Save registers make sure they don't get clobbered.
@@ -79,50 +75,49 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
for (;reg_num < Register::NumAllocatableRegisters(); ++reg_num) {
Register reg = Register::from_code(reg_num);
if (!reg.is(destination_reg)) {
- __ push(reg);
+ __ Push(reg);
source_reg_offset += kPointerSize;
}
}
// Re-push the double argument.
- __ sub(sp, sp, Operand(kDoubleSize));
- __ vstr(d0, sp, 0);
+ __ Push(d0);
// Call through to the actual stub
if (inline_fastpath) {
- __ vldr(d0, MemOperand(source_reg));
+ __ Ldr(d0, MemOperand(source_reg));
__ TryInlineTruncateDoubleToI(destination_reg, d0, &done);
- if (destination_reg.is(source_reg) && !source_reg.is(sp)) {
+ if (destination_reg.is(source_reg)) {
// Restore clobbered source_reg.
- __ add(source_reg, sp, Operand(source_reg_offset));
+ __ add(source_reg, jssp, Operand(source_reg_offset));
}
}
__ Call(start, RelocInfo::EXTERNAL_REFERENCE);
__ bind(&done);
- __ add(sp, sp, Operand(kDoubleSize));
+ __ Drop(1, kDoubleSize);
- // Make sure no registers have been unexpectedly clobbered
+ // // Make sure no registers have been unexpectedly clobbered
for (--reg_num; reg_num >= 0; --reg_num) {
Register reg = Register::from_code(reg_num);
if (!reg.is(destination_reg)) {
- __ ldr(ip, MemOperand(sp, 0));
- __ cmp(reg, ip);
+ __ Pop(ip0);
+ __ cmp(reg, ip0);
__ Assert(eq, kRegisterWasClobbered);
- __ add(sp, sp, Operand(kPointerSize));
}
}
- __ add(sp, sp, Operand(kDoubleSize));
+ __ Drop(1, kDoubleSize);
- if (!destination_reg.is(r0))
- __ mov(r0, destination_reg);
+ if (!destination_reg.is(x0))
+ __ Mov(x0, destination_reg);
// Restore callee save registers.
- __ Pop(lr);
- __ Pop(r7, r6, r5, r4);
+ __ Mov(csp, jssp);
+ __ SetStackPointer(csp);
+ __ PopCalleeSavedRegisters();
- __ Ret(0);
+ __ Ret();
CodeDesc desc;
masm.GetCode(&desc);
@@ -142,7 +137,9 @@ static Isolate* GetIsolateFrom(LocalContext* context) {
int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func,
double from) {
#ifdef USE_SIMULATOR
- return CALL_GENERATED_FP_INT(func, from, 0);
+ return Simulator::current(Isolate::Current())->CallInt64(
+ FUNCTION_ADDR(func), Simulator::CallArgument(from),
+ Simulator::CallArgument::End());
#else
return (*func)(from);
#endif
@@ -162,8 +159,12 @@ TEST(ConvertDToI) {
RunAllTruncationTests(&ConvertDToICVersion);
#endif
- Register source_registers[] = {sp, r0, r1, r2, r3, r4, r5, r6, r7};
- Register dest_registers[] = {r0, r1, r2, r3, r4, r5, r6, r7};
+ Register source_registers[] = {jssp, x0, x1, x2, x3, x4, x5, x6, x7, x8, x9,
+ x10, x11, x12, x13, x14, x15, x18, x19, x20,
+ x21, x22, x23, x24};
+ Register dest_registers[] = {x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11,
+ x12, x13, x14, x15, x18, x19, x20, x21, x22, x23,
+ x24};
for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) {
for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
« no previous file with comments | « test/cctest/test-code-stubs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698