OLD | NEW |
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size)); | 55 MacroAssembler masm(isolate, buffer, static_cast<int>(actual_size)); |
56 DoubleToIStub stub(isolate, source_reg, destination_reg, 0, true, | 56 DoubleToIStub stub(isolate, source_reg, destination_reg, 0, true, |
57 inline_fastpath); | 57 inline_fastpath); |
58 | 58 |
59 byte* start = stub.GetCode()->instruction_start(); | 59 byte* start = stub.GetCode()->instruction_start(); |
60 Label done; | 60 Label done; |
61 | 61 |
62 // Save callee save registers. | 62 // Save callee save registers. |
63 __ MultiPush(kCalleeSaved | ra.bit()); | 63 __ MultiPush(kCalleeSaved | ra.bit()); |
64 | 64 |
| 65 // Save callee-saved FPU registers. |
| 66 __ MultiPushFPU(kCalleeSavedFPU); |
| 67 // Set up the reserved register for 0.0. |
| 68 __ Move(kDoubleRegZero, 0.0); |
| 69 |
65 // For softfp, move the input value into f12. | 70 // For softfp, move the input value into f12. |
66 if (IsMipsSoftFloatABI) { | 71 if (IsMipsSoftFloatABI) { |
67 __ Move(f12, a0, a1); | 72 __ Move(f12, a0, a1); |
68 } | 73 } |
69 // Push the double argument. | 74 // Push the double argument. |
70 __ Dsubu(sp, sp, Operand(kDoubleSize)); | 75 __ Dsubu(sp, sp, Operand(kDoubleSize)); |
71 __ sdc1(f12, MemOperand(sp)); | 76 __ sdc1(f12, MemOperand(sp)); |
72 __ Move(source_reg, sp); | 77 __ Move(source_reg, sp); |
73 | 78 |
74 // Save registers make sure they don't get clobbered. | 79 // Save registers make sure they don't get clobbered. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 115 } |
111 } | 116 } |
112 | 117 |
113 __ Daddu(sp, sp, Operand(kDoubleSize)); | 118 __ Daddu(sp, sp, Operand(kDoubleSize)); |
114 | 119 |
115 __ Move(v0, destination_reg); | 120 __ Move(v0, destination_reg); |
116 Label ok; | 121 Label ok; |
117 __ Branch(&ok, eq, v0, Operand(zero_reg)); | 122 __ Branch(&ok, eq, v0, Operand(zero_reg)); |
118 __ bind(&ok); | 123 __ bind(&ok); |
119 | 124 |
| 125 // Restore callee-saved FPU registers. |
| 126 __ MultiPopFPU(kCalleeSavedFPU); |
| 127 |
120 // Restore callee save registers. | 128 // Restore callee save registers. |
121 __ MultiPop(kCalleeSaved | ra.bit()); | 129 __ MultiPop(kCalleeSaved | ra.bit()); |
122 | 130 |
123 Label ok1; | 131 Label ok1; |
124 __ Branch(&ok1, eq, v0, Operand(zero_reg)); | 132 __ Branch(&ok1, eq, v0, Operand(zero_reg)); |
125 __ bind(&ok1); | 133 __ bind(&ok1); |
126 __ Ret(); | 134 __ Ret(); |
127 | 135 |
128 CodeDesc desc; | 136 CodeDesc desc; |
129 masm.GetCode(&desc); | 137 masm.GetCode(&desc); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 false)); | 188 false)); |
181 RunAllTruncationTests( | 189 RunAllTruncationTests( |
182 RunGeneratedCodeCallWrapper, | 190 RunGeneratedCodeCallWrapper, |
183 MakeConvertDToIFuncTrampoline(isolate, | 191 MakeConvertDToIFuncTrampoline(isolate, |
184 source_registers[s], | 192 source_registers[s], |
185 dest_registers[d], | 193 dest_registers[d], |
186 true)); | 194 true)); |
187 } | 195 } |
188 } | 196 } |
189 } | 197 } |
OLD | NEW |