Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 745 | 745 |
| 746 for (int16_t i = kNumRegisters; i > 0; i--) { | 746 for (int16_t i = kNumRegisters; i > 0; i--) { |
| 747 if ((regs & (1 << i)) != 0) { | 747 if ((regs & (1 << i)) != 0) { |
| 748 lw(ToRegister(i), MemOperand(sp, 4 * (NumSaved++))); | 748 lw(ToRegister(i), MemOperand(sp, 4 * (NumSaved++))); |
| 749 } | 749 } |
| 750 } | 750 } |
| 751 addiu(sp, sp, 4 * NumSaved); | 751 addiu(sp, sp, 4 * NumSaved); |
| 752 } | 752 } |
| 753 | 753 |
| 754 | 754 |
| 755 void MacroAssembler::MultiPushFPU(RegList regs) { | |
| 756 CpuFeatures::Scope scope(FPU); | |
| 757 int16_t NumSaved = 0; | |
| 758 int16_t NumToPush = NumberOfBitsSet(regs); | |
| 759 | |
| 760 addiu(sp, sp, -8 * NumToPush); | |
| 761 for (int16_t i = kNumRegisters; i > 0; i--) { | |
| 762 if ((regs & (1 << i)) != 0) { | |
| 763 sdc1(FPURegister::from_code(i), | |
| 764 MemOperand(sp, 8 * (NumToPush - ++NumSaved))); | |
| 765 } | |
| 766 } | |
|
Yang
2011/08/31 12:38:44
Consider - for readability - introducing a stack_o
Paul Lind
2011/09/01 06:50:27
Nice suggestion, the code looks much cleaner now.
| |
| 767 } | |
| 768 | |
| 769 | |
| 770 void MacroAssembler::MultiPushReversedFPU(RegList regs) { | |
| 771 CpuFeatures::Scope scope(FPU); | |
| 772 int16_t NumSaved = 0; | |
| 773 int16_t NumToPush = NumberOfBitsSet(regs); | |
| 774 | |
| 775 addiu(sp, sp, -8 * NumToPush); | |
| 776 for (int16_t i = 0; i < kNumRegisters; i++) { | |
| 777 if ((regs & (1 << i)) != 0) { | |
| 778 sdc1(FPURegister::from_code(i), | |
| 779 MemOperand(sp, 8 * (NumToPush - ++NumSaved))); | |
| 780 } | |
| 781 } | |
| 782 } | |
| 783 | |
| 784 | |
| 785 void MacroAssembler::MultiPopFPU(RegList regs) { | |
| 786 CpuFeatures::Scope scope(FPU); | |
| 787 int16_t NumSaved = 0; | |
| 788 | |
| 789 for (int16_t i = 0; i < kNumRegisters; i++) { | |
| 790 if ((regs & (1 << i)) != 0) { | |
| 791 ldc1(FPURegister::from_code(i), | |
| 792 MemOperand(sp, 8 * (NumSaved++))); | |
| 793 } | |
| 794 } | |
| 795 addiu(sp, sp, 8 * NumSaved); | |
| 796 } | |
| 797 | |
| 798 | |
| 799 void MacroAssembler::MultiPopReversedFPU(RegList regs) { | |
| 800 CpuFeatures::Scope scope(FPU); | |
| 801 int16_t NumSaved = 0; | |
| 802 | |
| 803 for (int16_t i = kNumRegisters; i > 0; i--) { | |
| 804 if ((regs & (1 << i)) != 0) { | |
| 805 ldc1(FPURegister::from_code(i), | |
| 806 MemOperand(sp, 8 * (NumSaved++))); | |
| 807 } | |
| 808 } | |
| 809 addiu(sp, sp, 8 * NumSaved); | |
| 810 } | |
| 811 | |
| 812 | |
| 755 void MacroAssembler::Ext(Register rt, | 813 void MacroAssembler::Ext(Register rt, |
| 756 Register rs, | 814 Register rs, |
| 757 uint16_t pos, | 815 uint16_t pos, |
| 758 uint16_t size) { | 816 uint16_t size) { |
| 759 ASSERT(pos < 32); | 817 ASSERT(pos < 32); |
| 760 ASSERT(pos + size < 33); | 818 ASSERT(pos + size < 33); |
| 761 | 819 |
| 762 if (mips32r2) { | 820 if (mips32r2) { |
| 763 ext_(rt, rs, pos, size); | 821 ext_(rt, rs, pos, size); |
| 764 } else { | 822 } else { |
| (...skipping 3540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4305 opcode == BGTZL); | 4363 opcode == BGTZL); |
| 4306 opcode = (cond == eq) ? BEQ : BNE; | 4364 opcode = (cond == eq) ? BEQ : BNE; |
| 4307 instr = (instr & ~kOpcodeMask) | opcode; | 4365 instr = (instr & ~kOpcodeMask) | opcode; |
| 4308 masm_.emit(instr); | 4366 masm_.emit(instr); |
| 4309 } | 4367 } |
| 4310 | 4368 |
| 4311 | 4369 |
| 4312 } } // namespace v8::internal | 4370 } } // namespace v8::internal |
| 4313 | 4371 |
| 4314 #endif // V8_TARGET_ARCH_MIPS | 4372 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |