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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 UnaryMathFunction CreateSqrtFunction() { | 528 UnaryMathFunction CreateSqrtFunction() { |
529 #if defined(USE_SIMULATOR) | 529 #if defined(USE_SIMULATOR) |
530 return &std::sqrt; | 530 return &std::sqrt; |
531 #else | 531 #else |
532 size_t actual_size; | 532 size_t actual_size; |
533 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); | 533 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); |
534 if (buffer == NULL) return &std::sqrt; | 534 if (buffer == NULL) return &std::sqrt; |
535 | 535 |
536 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); | 536 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); |
537 | 537 |
538 __ GetFromCDoubleArguments(f12); | 538 __ MovFromFloatParameter(f12); |
539 __ sqrt_d(f0, f12); | 539 __ sqrt_d(f0, f12); |
540 __ SetForCDoubleResult(f0); | 540 __ MovToFloatResult(f0); |
541 __ Ret(); | 541 __ Ret(); |
542 | 542 |
543 CodeDesc desc; | 543 CodeDesc desc; |
544 masm.GetCode(&desc); | 544 masm.GetCode(&desc); |
545 ASSERT(!RelocInfo::RequiresRelocation(desc)); | 545 ASSERT(!RelocInfo::RequiresRelocation(desc)); |
546 | 546 |
547 CPU::FlushICache(buffer, actual_size); | 547 CPU::FlushICache(buffer, actual_size); |
548 OS::ProtectCode(buffer, actual_size); | 548 OS::ProtectCode(buffer, actual_size); |
549 return FUNCTION_CAST<UnaryMathFunction>(buffer); | 549 return FUNCTION_CAST<UnaryMathFunction>(buffer); |
550 #endif | 550 #endif |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 patcher.masm()->nop(); // Pad the empty space. | 1109 patcher.masm()->nop(); // Pad the empty space. |
1110 } | 1110 } |
1111 } | 1111 } |
1112 | 1112 |
1113 | 1113 |
1114 #undef __ | 1114 #undef __ |
1115 | 1115 |
1116 } } // namespace v8::internal | 1116 } } // namespace v8::internal |
1117 | 1117 |
1118 #endif // V8_TARGET_ARCH_MIPS | 1118 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |