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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 6691057: ARM: Add support load/store multiple VFP registers (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments addressed Created 9 years, 8 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/disasm-arm.cc ('k') | src/arm/simulator-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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset)); 742 str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset));
743 743
744 // Save the frame pointer and the context in top. 744 // Save the frame pointer and the context in top.
745 mov(ip, Operand(ExternalReference(Isolate::k_c_entry_fp_address, isolate()))); 745 mov(ip, Operand(ExternalReference(Isolate::k_c_entry_fp_address, isolate())));
746 str(fp, MemOperand(ip)); 746 str(fp, MemOperand(ip));
747 mov(ip, Operand(ExternalReference(Isolate::k_context_address, isolate()))); 747 mov(ip, Operand(ExternalReference(Isolate::k_context_address, isolate())));
748 str(cp, MemOperand(ip)); 748 str(cp, MemOperand(ip));
749 749
750 // Optionally save all double registers. 750 // Optionally save all double registers.
751 if (save_doubles) { 751 if (save_doubles) {
752 sub(sp, sp, Operand(DwVfpRegister::kNumRegisters * kDoubleSize)); 752 DwVfpRegister first = d0;
753 const int offset = -2 * kPointerSize; 753 DwVfpRegister last =
754 for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) { 754 DwVfpRegister::from_code(DwVfpRegister::kNumRegisters - 1);
755 DwVfpRegister reg = DwVfpRegister::from_code(i); 755 vstm(db_w, sp, first, last);
756 vstr(reg, fp, offset - ((i + 1) * kDoubleSize));
757 }
758 // Note that d0 will be accessible at 756 // Note that d0 will be accessible at
759 // fp - 2 * kPointerSize - DwVfpRegister::kNumRegisters * kDoubleSize, 757 // fp - 2 * kPointerSize - DwVfpRegister::kNumRegisters * kDoubleSize,
760 // since the sp slot and code slot were pushed after the fp. 758 // since the sp slot and code slot were pushed after the fp.
761 } 759 }
762 760
763 // Reserve place for the return address and stack space and align the frame 761 // Reserve place for the return address and stack space and align the frame
764 // preparing for calling the runtime function. 762 // preparing for calling the runtime function.
765 const int frame_alignment = MacroAssembler::ActivationFrameAlignment(); 763 const int frame_alignment = MacroAssembler::ActivationFrameAlignment();
766 sub(sp, sp, Operand((stack_space + 1) * kPointerSize)); 764 sub(sp, sp, Operand((stack_space + 1) * kPointerSize));
767 if (frame_alignment > 0) { 765 if (frame_alignment > 0) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 // flag. 802 // flag.
805 return FLAG_sim_stack_alignment; 803 return FLAG_sim_stack_alignment;
806 #endif // defined(V8_HOST_ARCH_ARM) 804 #endif // defined(V8_HOST_ARCH_ARM)
807 } 805 }
808 806
809 807
810 void MacroAssembler::LeaveExitFrame(bool save_doubles, 808 void MacroAssembler::LeaveExitFrame(bool save_doubles,
811 Register argument_count) { 809 Register argument_count) {
812 // Optionally restore all double registers. 810 // Optionally restore all double registers.
813 if (save_doubles) { 811 if (save_doubles) {
814 for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) { 812 // Calculate the stack location of the saved doubles and restore them.
815 DwVfpRegister reg = DwVfpRegister::from_code(i); 813 const int offset = 2 * kPointerSize;
816 const int offset = -2 * kPointerSize; 814 sub(r3, fp, Operand(offset + DwVfpRegister::kNumRegisters * kDoubleSize));
817 vldr(reg, fp, offset - ((i + 1) * kDoubleSize)); 815 DwVfpRegister first = d0;
818 } 816 DwVfpRegister last =
817 DwVfpRegister::from_code(DwVfpRegister::kNumRegisters - 1);
818 vldm(ia, r3, first, last);
819 } 819 }
820 820
821 // Clear top frame. 821 // Clear top frame.
822 mov(r3, Operand(0, RelocInfo::NONE)); 822 mov(r3, Operand(0, RelocInfo::NONE));
823 mov(ip, Operand(ExternalReference(Isolate::k_c_entry_fp_address, isolate()))); 823 mov(ip, Operand(ExternalReference(Isolate::k_c_entry_fp_address, isolate())));
824 str(r3, MemOperand(ip)); 824 str(r3, MemOperand(ip));
825 825
826 // Restore current context from top and clear it in debug mode. 826 // Restore current context from top and clear it in debug mode.
827 mov(ip, Operand(ExternalReference(Isolate::k_context_address, isolate()))); 827 mov(ip, Operand(ExternalReference(Isolate::k_context_address, isolate())));
828 ldr(cp, MemOperand(ip)); 828 ldr(cp, MemOperand(ip));
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2930 void CodePatcher::EmitCondition(Condition cond) { 2930 void CodePatcher::EmitCondition(Condition cond) {
2931 Instr instr = Assembler::instr_at(masm_.pc_); 2931 Instr instr = Assembler::instr_at(masm_.pc_);
2932 instr = (instr & ~kCondMask) | cond; 2932 instr = (instr & ~kCondMask) | cond;
2933 masm_.emit(instr); 2933 masm_.emit(instr);
2934 } 2934 }
2935 2935
2936 2936
2937 } } // namespace v8::internal 2937 } } // namespace v8::internal
2938 2938
2939 #endif // V8_TARGET_ARCH_ARM 2939 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/disasm-arm.cc ('k') | src/arm/simulator-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698