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

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 11428137: ARM: Make use of d16-d31 when available. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use an ExternalReference to check CpuFeatures in generated code Created 7 years, 11 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
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 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 3, 2059 3,
2060 1); 2060 1);
2061 } 2061 }
2062 2062
2063 2063
2064 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { 2064 void StoreBufferOverflowStub::Generate(MacroAssembler* masm) {
2065 // We don't allow a GC during a store buffer overflow so there is no need to 2065 // We don't allow a GC during a store buffer overflow so there is no need to
2066 // store the registers in any particular way, but we do have to store and 2066 // store the registers in any particular way, but we do have to store and
2067 // restore them. 2067 // restore them.
2068 __ stm(db_w, sp, kCallerSaved | lr.bit()); 2068 __ stm(db_w, sp, kCallerSaved | lr.bit());
2069
2070 const Register scratch = r1;
2071
2069 if (save_doubles_ == kSaveFPRegs) { 2072 if (save_doubles_ == kSaveFPRegs) {
2070 CpuFeatures::Scope scope(VFP2); 2073 CpuFeatures::Scope scope(VFP2);
2074 // Check CPU flags for number of registers.
2075 // 16 regs => Z==1, 32 regs => Z==0.
2076 __ mov(scratch, Operand(ExternalReference::cpu_features()));
2077 __ ldr(scratch, MemOperand(scratch));
2078 __ and_(scratch, scratch, Operand(1u << VFP32DREGS), SetCC);
2079
2071 __ sub(sp, sp, Operand(kDoubleSize * DwVfpRegister::kNumRegisters)); 2080 __ sub(sp, sp, Operand(kDoubleSize * DwVfpRegister::kNumRegisters));
2072 for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) { 2081 for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) {
2073 DwVfpRegister reg = DwVfpRegister::from_code(i); 2082 DwVfpRegister reg = DwVfpRegister::from_code(i);
2074 __ vstr(reg, MemOperand(sp, i * kDoubleSize)); 2083 __ vstr(reg, MemOperand(sp, i * kDoubleSize), i < 16 ? al : ne);
2075 } 2084 }
2076 } 2085 }
2077 const int argument_count = 1; 2086 const int argument_count = 1;
2078 const int fp_argument_count = 0; 2087 const int fp_argument_count = 0;
2079 const Register scratch = r1;
2080 2088
2081 AllowExternalCallThatCantCauseGC scope(masm); 2089 AllowExternalCallThatCantCauseGC scope(masm);
2082 __ PrepareCallCFunction(argument_count, fp_argument_count, scratch); 2090 __ PrepareCallCFunction(argument_count, fp_argument_count, scratch);
2083 __ mov(r0, Operand(ExternalReference::isolate_address())); 2091 __ mov(r0, Operand(ExternalReference::isolate_address()));
2084 __ CallCFunction( 2092 __ CallCFunction(
2085 ExternalReference::store_buffer_overflow_function(masm->isolate()), 2093 ExternalReference::store_buffer_overflow_function(masm->isolate()),
2086 argument_count); 2094 argument_count);
2087 if (save_doubles_ == kSaveFPRegs) { 2095 if (save_doubles_ == kSaveFPRegs) {
2088 CpuFeatures::Scope scope(VFP2); 2096 CpuFeatures::Scope scope(VFP2);
2097
2098 // Check CPU flags for number of registers.
2099 // 16 regs => Z==1, 32 regs => Z==0.
2100 __ mov(scratch, Operand(ExternalReference::cpu_features()));
2101 __ ldr(scratch, MemOperand(scratch));
2102 __ and_(scratch, scratch, Operand(1u << VFP32DREGS), SetCC);
2103
2089 for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) { 2104 for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) {
2090 DwVfpRegister reg = DwVfpRegister::from_code(i); 2105 DwVfpRegister reg = DwVfpRegister::from_code(i);
2091 __ vldr(reg, MemOperand(sp, i * kDoubleSize)); 2106 __ vldr(reg, MemOperand(sp, i * kDoubleSize), i < 16 ? al : ne);
2092 } 2107 }
2093 __ add(sp, sp, Operand(kDoubleSize * DwVfpRegister::kNumRegisters)); 2108 __ add(sp, sp, Operand(kDoubleSize * DwVfpRegister::kNumRegisters));
2094 } 2109 }
2095 __ ldm(ia_w, sp, kCallerSaved | pc.bit()); // Also pop pc to get Ret(0). 2110 __ ldm(ia_w, sp, kCallerSaved | pc.bit()); // Also pop pc to get Ret(0).
2096 } 2111 }
2097 2112
2098 2113
2099 void UnaryOpStub::PrintName(StringStream* stream) { 2114 void UnaryOpStub::PrintName(StringStream* stream) {
2100 const char* op_name = Token::Name(op_); 2115 const char* op_name = Token::Name(op_);
2101 const char* overwrite_name = NULL; // Make g++ happy. 2116 const char* overwrite_name = NULL; // Make g++ happy.
(...skipping 5648 matching lines...) Expand 10 before | Expand all | Expand 10 after
7750 7765
7751 __ Pop(lr, r5, r1); 7766 __ Pop(lr, r5, r1);
7752 __ Ret(); 7767 __ Ret();
7753 } 7768 }
7754 7769
7755 #undef __ 7770 #undef __
7756 7771
7757 } } // namespace v8::internal 7772 } } // namespace v8::internal
7758 7773
7759 #endif // V8_TARGET_ARCH_ARM 7774 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698