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

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

Issue 23156006: [v8-dev] ARM: Improve Lithium register constraints. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 ASSERT(!input.is(result)); 767 ASSERT(!input.is(result));
768 ASSERT(!input.is(double_scratch1)); 768 ASSERT(!input.is(double_scratch1));
769 ASSERT(!input.is(double_scratch2)); 769 ASSERT(!input.is(double_scratch2));
770 ASSERT(!result.is(double_scratch1)); 770 ASSERT(!result.is(double_scratch1));
771 ASSERT(!result.is(double_scratch2)); 771 ASSERT(!result.is(double_scratch2));
772 ASSERT(!double_scratch1.is(double_scratch2)); 772 ASSERT(!double_scratch1.is(double_scratch2));
773 ASSERT(!temp1.is(temp2)); 773 ASSERT(!temp1.is(temp2));
774 ASSERT(!temp1.is(temp3)); 774 ASSERT(!temp1.is(temp3));
775 ASSERT(!temp2.is(temp3)); 775 ASSERT(!temp2.is(temp3));
776 ASSERT(ExternalReference::math_exp_constants(0).address() != NULL); 776 ASSERT(ExternalReference::math_exp_constants(0).address() != NULL);
777 // Register input isn't modified. All other registers are clobbered.
danno 2013/08/20 14:53:20 nit: You already have a comment in the header abou
vincent.belliard.fr 2013/08/22 12:35:48 I will discard it in the next release.
777 778
778 Label done; 779 Label done;
779 780
780 __ mov(temp3, Operand(ExternalReference::math_exp_constants(0))); 781 __ mov(temp3, Operand(ExternalReference::math_exp_constants(0)));
781 782
782 __ vldr(double_scratch1, ExpConstant(0, temp3)); 783 __ vldr(double_scratch1, ExpConstant(0, temp3));
783 __ vmov(result, kDoubleRegZero); 784 __ vmov(result, kDoubleRegZero);
784 __ VFPCompareAndSetFlags(double_scratch1, input); 785 __ VFPCompareAndSetFlags(double_scratch1, input);
785 __ b(ge, &done); 786 __ b(ge, &done);
786 __ vldr(double_scratch2, ExpConstant(1, temp3)); 787 __ vldr(double_scratch2, ExpConstant(1, temp3));
787 __ VFPCompareAndSetFlags(input, double_scratch2); 788 __ VFPCompareAndSetFlags(input, double_scratch2);
788 __ vldr(result, ExpConstant(2, temp3)); 789 __ vldr(result, ExpConstant(2, temp3));
789 __ b(ge, &done); 790 __ b(ge, &done);
790 __ vldr(double_scratch1, ExpConstant(3, temp3)); 791 __ vldr(double_scratch1, ExpConstant(3, temp3));
791 __ vldr(result, ExpConstant(4, temp3)); 792 __ vldr(result, ExpConstant(4, temp3));
792 __ vmul(double_scratch1, double_scratch1, input); 793 __ vmul(double_scratch1, double_scratch1, input);
793 __ vadd(double_scratch1, double_scratch1, result); 794 __ vadd(double_scratch1, double_scratch1, result);
794 __ vmov(temp2, temp1, double_scratch1); 795 __ vmov(temp2, temp1, double_scratch1);
795 __ vsub(double_scratch1, double_scratch1, result); 796 __ vsub(double_scratch1, double_scratch1, result);
796 __ vldr(result, ExpConstant(6, temp3)); 797 __ vldr(result, ExpConstant(6, temp3));
797 __ vldr(double_scratch2, ExpConstant(5, temp3)); 798 __ vldr(double_scratch2, ExpConstant(5, temp3));
798 __ vmul(double_scratch1, double_scratch1, double_scratch2); 799 __ vmul(double_scratch1, double_scratch1, double_scratch2);
799 __ vsub(double_scratch1, double_scratch1, input); 800 __ vsub(double_scratch1, double_scratch1, input);
800 __ vsub(result, result, double_scratch1); 801 __ vsub(result, result, double_scratch1);
801 __ vmul(input, double_scratch1, double_scratch1); 802 __ vmul(double_scratch2, double_scratch1, double_scratch1);
802 __ vmul(result, result, input); 803 __ vmul(result, result, double_scratch2);
803 __ mov(temp1, Operand(temp2, LSR, 11)); 804 __ mov(temp1, Operand(temp2, LSR, 11));
804 __ vldr(double_scratch2, ExpConstant(7, temp3)); 805 __ vldr(double_scratch2, ExpConstant(7, temp3));
805 __ vmul(result, result, double_scratch2); 806 __ vmul(result, result, double_scratch2);
806 __ vsub(result, result, double_scratch1); 807 __ vsub(result, result, double_scratch1);
807 __ vldr(double_scratch2, ExpConstant(8, temp3)); 808 __ vldr(double_scratch2, ExpConstant(8, temp3));
808 __ vadd(result, result, double_scratch2); 809 __ vadd(result, result, double_scratch2);
809 __ movw(ip, 0x7ff); 810 __ movw(ip, 0x7ff);
810 __ and_(temp2, temp2, Operand(ip)); 811 __ and_(temp2, temp2, Operand(ip));
811 __ add(temp1, temp1, Operand(0x3ff)); 812 __ add(temp1, temp1, Operand(0x3ff));
812 __ mov(temp1, Operand(temp1, LSL, 20)); 813 __ mov(temp1, Operand(temp1, LSL, 20));
813 814
814 // Must not call ExpConstant() after overwriting temp3! 815 // Must not call ExpConstant() after overwriting temp3!
815 __ mov(temp3, Operand(ExternalReference::math_exp_log_table())); 816 __ mov(temp3, Operand(ExternalReference::math_exp_log_table()));
816 __ ldr(ip, MemOperand(temp3, temp2, LSL, 3)); 817 __ ldr(ip, MemOperand(temp3, temp2, LSL, 3));
817 __ add(temp3, temp3, Operand(kPointerSize)); 818 __ add(temp3, temp3, Operand(kPointerSize));
818 __ ldr(temp2, MemOperand(temp3, temp2, LSL, 3)); 819 __ ldr(temp2, MemOperand(temp3, temp2, LSL, 3));
819 __ orr(temp1, temp1, temp2); 820 __ orr(temp1, temp1, temp2);
820 __ vmov(input, ip, temp1); 821 __ vmov(double_scratch1, ip, temp1);
821 __ vmul(result, result, input); 822 __ vmul(result, result, double_scratch1);
822 __ bind(&done); 823 __ bind(&done);
823 } 824 }
824 825
825 #undef __ 826 #undef __
826 827
827 // add(r0, pc, Operand(-8)) 828 // add(r0, pc, Operand(-8))
828 static const uint32_t kCodeAgePatchFirstInstruction = 0xe24f0008; 829 static const uint32_t kCodeAgePatchFirstInstruction = 0xe24f0008;
829 830
830 static byte* GetNoCodeAgeSequence(uint32_t* length) { 831 static byte* GetNoCodeAgeSequence(uint32_t* length) {
831 // The sequence of instructions that is patched out for aging code is the 832 // The sequence of instructions that is patched out for aging code is the
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 patcher.masm()->add(r0, pc, Operand(-8)); 885 patcher.masm()->add(r0, pc, Operand(-8));
885 patcher.masm()->ldr(pc, MemOperand(pc, -4)); 886 patcher.masm()->ldr(pc, MemOperand(pc, -4));
886 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); 887 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
887 } 888 }
888 } 889 }
889 890
890 891
891 } } // namespace v8::internal 892 } } // namespace v8::internal
892 893
893 #endif // V8_TARGET_ARCH_ARM 894 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.h ('k') | src/arm/lithium-arm.h » ('j') | src/arm/lithium-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698