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

Side by Side Diff: test/cctest/test-code-stubs-mips.cc

Issue 2751973002: MIPS: Move ldc1/sdc1 to macro-assembler. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | test/cctest/test-macro-assembler-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Rrdistribution and use in source and binary forms, with or without 2 // Rrdistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Rrdistributions of source code must retain the above copyright 6 // * Rrdistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Rrdistributions in binary form must reproduce the above 8 // * Rrdistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 __ MultiPushFPU(kCalleeSavedFPU); 68 __ MultiPushFPU(kCalleeSavedFPU);
69 // Set up the reserved register for 0.0. 69 // Set up the reserved register for 0.0.
70 __ Move(kDoubleRegZero, 0.0); 70 __ Move(kDoubleRegZero, 0.0);
71 71
72 // For softfp, move the input value into f12. 72 // For softfp, move the input value into f12.
73 if (IsMipsSoftFloatABI) { 73 if (IsMipsSoftFloatABI) {
74 __ Move(f12, a0, a1); 74 __ Move(f12, a0, a1);
75 } 75 }
76 // Push the double argument. 76 // Push the double argument.
77 __ Subu(sp, sp, Operand(kDoubleSize)); 77 __ Subu(sp, sp, Operand(kDoubleSize));
78 __ sdc1(f12, MemOperand(sp)); 78 __ Sdc1(f12, MemOperand(sp));
79 __ Move(source_reg, sp); 79 __ Move(source_reg, sp);
80 80
81 // Save registers make sure they don't get clobbered. 81 // Save registers make sure they don't get clobbered.
82 int source_reg_offset = kDoubleSize; 82 int source_reg_offset = kDoubleSize;
83 int reg_num = 2; 83 int reg_num = 2;
84 for (; reg_num < Register::kNumRegisters; ++reg_num) { 84 for (; reg_num < Register::kNumRegisters; ++reg_num) {
85 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode( 85 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode(
86 reg_num)) { 86 reg_num)) {
87 Register reg = Register::from_code(reg_num); 87 Register reg = Register::from_code(reg_num);
88 if (!reg.is(destination_reg)) { 88 if (!reg.is(destination_reg)) {
89 __ push(reg); 89 __ push(reg);
90 source_reg_offset += kPointerSize; 90 source_reg_offset += kPointerSize;
91 } 91 }
92 } 92 }
93 } 93 }
94 94
95 // Re-push the double argument. 95 // Re-push the double argument.
96 __ Subu(sp, sp, Operand(kDoubleSize)); 96 __ Subu(sp, sp, Operand(kDoubleSize));
97 __ sdc1(f12, MemOperand(sp)); 97 __ Sdc1(f12, MemOperand(sp));
98 98
99 // Call through to the actual stub 99 // Call through to the actual stub
100 if (inline_fastpath) { 100 if (inline_fastpath) {
101 __ ldc1(f12, MemOperand(source_reg)); 101 __ Ldc1(f12, MemOperand(source_reg));
102 __ TryInlineTruncateDoubleToI(destination_reg, f12, &done); 102 __ TryInlineTruncateDoubleToI(destination_reg, f12, &done);
103 if (destination_reg.is(source_reg) && !source_reg.is(sp)) { 103 if (destination_reg.is(source_reg) && !source_reg.is(sp)) {
104 // Restore clobbered source_reg. 104 // Restore clobbered source_reg.
105 __ Addu(source_reg, sp, Operand(source_reg_offset)); 105 __ Addu(source_reg, sp, Operand(source_reg_offset));
106 } 106 }
107 } 107 }
108 __ Call(start, RelocInfo::EXTERNAL_REFERENCE); 108 __ Call(start, RelocInfo::EXTERNAL_REFERENCE);
109 __ bind(&done); 109 __ bind(&done);
110 110
111 __ Addu(sp, sp, Operand(kDoubleSize)); 111 __ Addu(sp, sp, Operand(kDoubleSize));
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 false)); 196 false));
197 RunAllTruncationTests( 197 RunAllTruncationTests(
198 RunGeneratedCodeCallWrapper, 198 RunGeneratedCodeCallWrapper,
199 MakeConvertDToIFuncTrampoline(isolate, 199 MakeConvertDToIFuncTrampoline(isolate,
200 source_registers[s], 200 source_registers[s],
201 dest_registers[d], 201 dest_registers[d],
202 true)); 202 true));
203 } 203 }
204 } 204 }
205 } 205 }
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | test/cctest/test-macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698