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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 157543002: A64: Synchronize with r18581. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/frames-arm.h » ('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 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #if defined(USE_SIMULATOR) 43 #if defined(USE_SIMULATOR)
44 byte* fast_exp_arm_machine_code = NULL; 44 byte* fast_exp_arm_machine_code = NULL;
45 double fast_exp_simulator(double x) { 45 double fast_exp_simulator(double x) {
46 return Simulator::current(Isolate::Current())->CallFPReturnsDouble( 46 return Simulator::current(Isolate::Current())->CallFPReturnsDouble(
47 fast_exp_arm_machine_code, x, 0); 47 fast_exp_arm_machine_code, x, 0);
48 } 48 }
49 #endif 49 #endif
50 50
51 51
52 UnaryMathFunction CreateExpFunction() { 52 UnaryMathFunction CreateExpFunction() {
53 if (!FLAG_fast_math) return &exp; 53 if (!FLAG_fast_math) return &std::exp;
54 size_t actual_size; 54 size_t actual_size;
55 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true)); 55 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true));
56 if (buffer == NULL) return &exp; 56 if (buffer == NULL) return &std::exp;
57 ExternalReference::InitializeMathExpData(); 57 ExternalReference::InitializeMathExpData();
58 58
59 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); 59 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size));
60 60
61 { 61 {
62 DwVfpRegister input = d0; 62 DwVfpRegister input = d0;
63 DwVfpRegister result = d1; 63 DwVfpRegister result = d1;
64 DwVfpRegister double_scratch1 = d2; 64 DwVfpRegister double_scratch1 = d2;
65 DwVfpRegister double_scratch2 = d3; 65 DwVfpRegister double_scratch2 = d3;
66 Register temp1 = r4; 66 Register temp1 = r4;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 masm.GetCode(&desc); 340 masm.GetCode(&desc);
341 341
342 CPU::FlushICache(buffer, actual_size); 342 CPU::FlushICache(buffer, actual_size);
343 OS::ProtectCode(buffer, actual_size); 343 OS::ProtectCode(buffer, actual_size);
344 344
345 return FUNCTION_CAST<OS::MemCopyUint16Uint8Function>(buffer); 345 return FUNCTION_CAST<OS::MemCopyUint16Uint8Function>(buffer);
346 #endif 346 #endif
347 } 347 }
348 #endif 348 #endif
349 349
350 UnaryMathFunction CreateSqrtFunction() {
351 #if defined(USE_SIMULATOR)
352 return &std::sqrt;
353 #else
354 size_t actual_size;
355 byte* buffer = static_cast<byte*>(OS::Allocate(1 * KB, &actual_size, true));
356 if (buffer == NULL) return &std::sqrt;
357
358 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size));
359
360 __ MovFromFloatParameter(d0);
361 __ vsqrt(d0, d0);
362 __ MovToFloatResult(d0);
363 __ Ret();
364
365 CodeDesc desc;
366 masm.GetCode(&desc);
367 ASSERT(!RelocInfo::RequiresRelocation(desc));
368
369 CPU::FlushICache(buffer, actual_size);
370 OS::ProtectCode(buffer, actual_size);
371 return FUNCTION_CAST<UnaryMathFunction>(buffer);
372 #endif
373 }
374
350 #undef __ 375 #undef __
351 376
352 377
353 UnaryMathFunction CreateSqrtFunction() {
354 return &sqrt;
355 }
356
357
358 // ------------------------------------------------------------------------- 378 // -------------------------------------------------------------------------
359 // Platform-specific RuntimeCallHelper functions. 379 // Platform-specific RuntimeCallHelper functions.
360 380
361 void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const { 381 void StubRuntimeCallHelper::BeforeCall(MacroAssembler* masm) const {
362 masm->EnterFrame(StackFrame::INTERNAL); 382 masm->EnterFrame(StackFrame::INTERNAL);
363 ASSERT(!masm->has_frame()); 383 ASSERT(!masm->has_frame());
364 masm->set_has_frame(true); 384 masm->set_has_frame(true);
365 } 385 }
366 386
367 387
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 patcher.masm()->add(r0, pc, Operand(-8)); 908 patcher.masm()->add(r0, pc, Operand(-8));
889 patcher.masm()->ldr(pc, MemOperand(pc, -4)); 909 patcher.masm()->ldr(pc, MemOperand(pc, -4));
890 patcher.masm()->emit_code_stub_address(stub); 910 patcher.masm()->emit_code_stub_address(stub);
891 } 911 }
892 } 912 }
893 913
894 914
895 } } // namespace v8::internal 915 } } // namespace v8::internal
896 916
897 #endif // V8_TARGET_ARCH_ARM 917 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/frames-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698