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

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

Issue 24793002: Thumb2 Backend: Make arithmetic instructions set condition codes by default Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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/builtins-arm.cc ('k') | src/arm/codegen-arm.cc » ('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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 // the_int_ has the answer which is a signed int32 but not a Smi. 666 // the_int_ has the answer which is a signed int32 but not a Smi.
667 // We test for the special value that has a different exponent. This test 667 // We test for the special value that has a different exponent. This test
668 // has the neat side effect of setting the flags according to the sign. 668 // has the neat side effect of setting the flags according to the sign.
669 STATIC_ASSERT(HeapNumber::kSignMask == 0x80000000u); 669 STATIC_ASSERT(HeapNumber::kSignMask == 0x80000000u);
670 __ cmp(the_int_, Operand(0x80000000u)); 670 __ cmp(the_int_, Operand(0x80000000u));
671 __ b(eq, &max_negative_int); 671 __ b(eq, &max_negative_int);
672 // Set up the correct exponent in scratch_. All non-Smi int32s have the same. 672 // Set up the correct exponent in scratch_. All non-Smi int32s have the same.
673 // A non-Smi integer is 1.xxx * 2^30 so the exponent is 30 (biased). 673 // A non-Smi integer is 1.xxx * 2^30 so the exponent is 30 (biased).
674 uint32_t non_smi_exponent = 674 uint32_t non_smi_exponent =
675 (HeapNumber::kExponentBias + 30) << HeapNumber::kExponentShift; 675 (HeapNumber::kExponentBias + 30) << HeapNumber::kExponentShift;
676 __ mov(scratch_, Operand(non_smi_exponent)); 676 __ mov(scratch_, Operand(non_smi_exponent), LeaveCC);
677 // Set the sign bit in scratch_ if the value was negative. 677 // Set the sign bit in scratch_ if the value was negative.
678 __ orr(scratch_, scratch_, Operand(HeapNumber::kSignMask), LeaveCC, cs); 678 __ orr(scratch_, scratch_, Operand(HeapNumber::kSignMask), LeaveCC, cs);
679 // Subtract from 0 if the value was negative. 679 // Subtract from 0 if the value was negative.
680 __ rsb(the_int_, the_int_, Operand::Zero(), LeaveCC, cs); 680 __ rsb(the_int_, the_int_, Operand::Zero(), LeaveCC, cs);
681 // We should be masking the implict first digit of the mantissa away here, 681 // We should be masking the implict first digit of the mantissa away here,
682 // but it just ends up combining harmlessly with the last digit of the 682 // but it just ends up combining harmlessly with the last digit of the
683 // exponent that happens to be 1. The sign bit is 0 so we shift 10 to get 683 // exponent that happens to be 1. The sign bit is 0 so we shift 10 to get
684 // the most significant 1 to hit the last bit of the 12 bit sign and exponent. 684 // the most significant 1 to hit the last bit of the 12 bit sign and exponent.
685 ASSERT(((1 << HeapNumber::kExponentShift) & non_smi_exponent) != 0); 685 ASSERT(((1 << HeapNumber::kExponentShift) & non_smi_exponent) != 0);
686 const int shift_distance = HeapNumber::kNonMantissaBitsInTopWord - 2; 686 const int shift_distance = HeapNumber::kNonMantissaBitsInTopWord - 2;
(...skipping 4114 matching lines...) Expand 10 before | Expand all | Expand 10 after
4801 __ add(count, count, Operand(count), SetCC); 4801 __ add(count, count, Operand(count), SetCC);
4802 } else { 4802 } else {
4803 __ cmp(count, Operand::Zero()); 4803 __ cmp(count, Operand::Zero());
4804 } 4804 }
4805 __ b(eq, &done); 4805 __ b(eq, &done);
4806 4806
4807 // Assume that you cannot read (or write) unaligned. 4807 // Assume that you cannot read (or write) unaligned.
4808 Label byte_loop; 4808 Label byte_loop;
4809 // Must copy at least eight bytes, otherwise just do it one byte at a time. 4809 // Must copy at least eight bytes, otherwise just do it one byte at a time.
4810 __ cmp(count, Operand(8)); 4810 __ cmp(count, Operand(8));
4811 __ add(count, dest, Operand(count)); 4811 __ add(count, dest, Operand(count), LeaveCC);
4812 Register limit = count; // Read until src equals this. 4812 Register limit = count; // Read until src equals this.
4813 __ b(lt, &byte_loop); 4813 __ b(lt, &byte_loop);
4814 4814
4815 if (!dest_always_aligned) { 4815 if (!dest_always_aligned) {
4816 // Align dest by byte copying. Copies between zero and three bytes. 4816 // Align dest by byte copying. Copies between zero and three bytes.
4817 __ and_(scratch4, dest, Operand(kReadAlignmentMask), SetCC); 4817 __ and_(scratch4, dest, Operand(kReadAlignmentMask), SetCC);
4818 Label dest_aligned; 4818 Label dest_aligned;
4819 __ b(eq, &dest_aligned); 4819 __ b(eq, &dest_aligned);
4820 __ cmp(scratch4, Operand(2)); 4820 __ cmp(scratch4, Operand(2));
4821 __ ldrb(scratch1, MemOperand(src, 1, PostIndex)); 4821 __ ldrb(scratch1, MemOperand(src, 1, PostIndex));
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
6347 ASSERT(!elements.is(r1)); 6347 ASSERT(!elements.is(r1));
6348 __ Move(r1, name); 6348 __ Move(r1, name);
6349 __ Move(r0, elements); 6349 __ Move(r0, elements);
6350 } else { 6350 } else {
6351 __ Move(r0, elements); 6351 __ Move(r0, elements);
6352 __ Move(r1, name); 6352 __ Move(r1, name);
6353 } 6353 }
6354 NameDictionaryLookupStub stub(POSITIVE_LOOKUP); 6354 NameDictionaryLookupStub stub(POSITIVE_LOOKUP);
6355 __ CallStub(&stub); 6355 __ CallStub(&stub);
6356 __ cmp(r0, Operand::Zero()); 6356 __ cmp(r0, Operand::Zero());
6357 __ mov(scratch2, Operand(r2)); 6357 __ mov(scratch2, Operand(r2), LeaveCC);
6358 __ ldm(ia_w, sp, spill_mask); 6358 __ ldm(ia_w, sp, spill_mask);
6359 6359
6360 __ b(ne, done); 6360 __ b(ne, done);
6361 __ b(eq, miss); 6361 __ b(eq, miss);
6362 } 6362 }
6363 6363
6364 6364
6365 void NameDictionaryLookupStub::Generate(MacroAssembler* masm) { 6365 void NameDictionaryLookupStub::Generate(MacroAssembler* masm) {
6366 // This stub overrides SometimesSetsUpAFrame() to return false. That means 6366 // This stub overrides SometimesSetsUpAFrame() to return false. That means
6367 // we cannot call anything that could cause a GC from this stub. 6367 // we cannot call anything that could cause a GC from this stub.
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
7177 __ bind(&fast_elements_case); 7177 __ bind(&fast_elements_case);
7178 GenerateCase(masm, FAST_ELEMENTS); 7178 GenerateCase(masm, FAST_ELEMENTS);
7179 } 7179 }
7180 7180
7181 7181
7182 #undef __ 7182 #undef __
7183 7183
7184 } } // namespace v8::internal 7184 } } // namespace v8::internal
7185 7185
7186 #endif // V8_TARGET_ARCH_ARM 7186 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698