OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution 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 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions 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 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 if (!CpuFeatures::IsSupported(FPU)) return &exp; | 65 if (!CpuFeatures::IsSupported(FPU)) return &exp; |
66 if (!FLAG_fast_math) return &exp; | 66 if (!FLAG_fast_math) return &exp; |
67 size_t actual_size; | 67 size_t actual_size; |
68 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); | 68 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); |
69 if (buffer == NULL) return &exp; | 69 if (buffer == NULL) return &exp; |
70 ExternalReference::InitializeMathExpData(); | 70 ExternalReference::InitializeMathExpData(); |
71 | 71 |
72 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); | 72 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); |
73 | 73 |
74 { | 74 { |
75 CpuFeatures::Scope use_fpu(FPU); | 75 CpuFeatureScope use_fpu(&masm, FPU); |
76 DoubleRegister input = f12; | 76 DoubleRegister input = f12; |
77 DoubleRegister result = f0; | 77 DoubleRegister result = f0; |
78 DoubleRegister double_scratch1 = f4; | 78 DoubleRegister double_scratch1 = f4; |
79 DoubleRegister double_scratch2 = f6; | 79 DoubleRegister double_scratch2 = f6; |
80 Register temp1 = t0; | 80 Register temp1 = t0; |
81 Register temp2 = t1; | 81 Register temp2 = t1; |
82 Register temp3 = t2; | 82 Register temp3 = t2; |
83 | 83 |
84 if (!IsMipsSoftFloatABI) { | 84 if (!IsMipsSoftFloatABI) { |
85 // Input value is in f12 anyway, nothing to do. | 85 // Input value is in f12 anyway, nothing to do. |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 // Convert and copy elements. | 272 // Convert and copy elements. |
273 __ bind(&loop); | 273 __ bind(&loop); |
274 __ lw(t5, MemOperand(a3)); | 274 __ lw(t5, MemOperand(a3)); |
275 __ Addu(a3, a3, kIntSize); | 275 __ Addu(a3, a3, kIntSize); |
276 // t5: current element | 276 // t5: current element |
277 __ UntagAndJumpIfNotSmi(t5, t5, &convert_hole); | 277 __ UntagAndJumpIfNotSmi(t5, t5, &convert_hole); |
278 | 278 |
279 // Normal smi, convert to double and store. | 279 // Normal smi, convert to double and store. |
280 if (fpu_supported) { | 280 if (fpu_supported) { |
281 CpuFeatures::Scope scope(FPU); | 281 CpuFeatureScope scope(masm, FPU); |
282 __ mtc1(t5, f0); | 282 __ mtc1(t5, f0); |
283 __ cvt_d_w(f0, f0); | 283 __ cvt_d_w(f0, f0); |
284 __ sdc1(f0, MemOperand(t3)); | 284 __ sdc1(f0, MemOperand(t3)); |
285 __ Addu(t3, t3, kDoubleSize); | 285 __ Addu(t3, t3, kDoubleSize); |
286 } else { | 286 } else { |
287 FloatingPointHelper::ConvertIntToDouble(masm, | 287 FloatingPointHelper::ConvertIntToDouble(masm, |
288 t5, | 288 t5, |
289 FloatingPointHelper::kCoreRegisters, | 289 FloatingPointHelper::kCoreRegisters, |
290 f0, | 290 f0, |
291 a0, | 291 a0, |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); | 720 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
721 } | 721 } |
722 } | 722 } |
723 | 723 |
724 | 724 |
725 #undef __ | 725 #undef __ |
726 | 726 |
727 } } // namespace v8::internal | 727 } } // namespace v8::internal |
728 | 728 |
729 #endif // V8_TARGET_ARCH_MIPS | 729 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |