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

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

Issue 131823004: DoubleToIStub can't use ip on armv6, because the ubfx impl will clobber it (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Push/Pop in two steps Created 6 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
« no previous file with comments | « no previous file | no next file » | 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 601
602 void DoubleToIStub::Generate(MacroAssembler* masm) { 602 void DoubleToIStub::Generate(MacroAssembler* masm) {
603 Label out_of_range, only_low, negate, done; 603 Label out_of_range, only_low, negate, done;
604 Register input_reg = source(); 604 Register input_reg = source();
605 Register result_reg = destination(); 605 Register result_reg = destination();
606 606
607 int double_offset = offset(); 607 int double_offset = offset();
608 // Account for saved regs if input is sp. 608 // Account for saved regs if input is sp.
609 if (input_reg.is(sp)) double_offset += 2 * kPointerSize; 609 if (input_reg.is(sp)) double_offset += 2 * kPointerSize;
610 610
611 // Immediate values for this stub fit in instructions, so it's safe to use ip. 611 Register scratch = GetRegisterThatIsNotOneOf(input_reg, result_reg);
612 Register scratch = ip;
613 Register scratch_low = 612 Register scratch_low =
614 GetRegisterThatIsNotOneOf(input_reg, result_reg, scratch); 613 GetRegisterThatIsNotOneOf(input_reg, result_reg, scratch);
615 Register scratch_high = 614 Register scratch_high =
616 GetRegisterThatIsNotOneOf(input_reg, result_reg, scratch, scratch_low); 615 GetRegisterThatIsNotOneOf(input_reg, result_reg, scratch, scratch_low);
617 LowDwVfpRegister double_scratch = kScratchDoubleReg; 616 LowDwVfpRegister double_scratch = kScratchDoubleReg;
618 617
618 __ Push(scratch);
619 __ Push(scratch_high, scratch_low); 619 __ Push(scratch_high, scratch_low);
rmcilroy 2014/01/14 14:23:30 Since Benedikt has fixed the Push/Pop typo, please
Mostyn Bramley-Moore 2014/01/14 14:30:58 Done. I have verified that this works on master n
620 620
621 if (!skip_fastpath()) { 621 if (!skip_fastpath()) {
622 // Load double input. 622 // Load double input.
623 __ vldr(double_scratch, MemOperand(input_reg, double_offset)); 623 __ vldr(double_scratch, MemOperand(input_reg, double_offset));
624 __ vmov(scratch_low, scratch_high, double_scratch); 624 __ vmov(scratch_low, scratch_high, double_scratch);
625 625
626 // Do fast-path convert from double to int. 626 // Do fast-path convert from double to int.
627 __ vcvt_s32_f64(double_scratch.low(), double_scratch); 627 __ vcvt_s32_f64(double_scratch.low(), double_scratch);
628 __ vmov(result_reg, double_scratch.low()); 628 __ vmov(result_reg, double_scratch.low());
629 629
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 // New result = (result eor 0) + 0 = result. 693 // New result = (result eor 0) + 0 = result.
694 // If the input was negative, we have to negate the result. 694 // If the input was negative, we have to negate the result.
695 // Input_high ASR 31 equals 0xffffffff and scratch_high LSR 31 equals 1. 695 // Input_high ASR 31 equals 0xffffffff and scratch_high LSR 31 equals 1.
696 // New result = (result eor 0xffffffff) + 1 = 0 - result. 696 // New result = (result eor 0xffffffff) + 1 = 0 - result.
697 __ eor(result_reg, result_reg, Operand(scratch_high, ASR, 31)); 697 __ eor(result_reg, result_reg, Operand(scratch_high, ASR, 31));
698 __ add(result_reg, result_reg, Operand(scratch_high, LSR, 31)); 698 __ add(result_reg, result_reg, Operand(scratch_high, LSR, 31));
699 699
700 __ bind(&done); 700 __ bind(&done);
701 701
702 __ Pop(scratch_high, scratch_low); 702 __ Pop(scratch_high, scratch_low);
703 __ Pop(scratch);
703 __ Ret(); 704 __ Ret();
704 } 705 }
705 706
706 707
707 void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime( 708 void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(
708 Isolate* isolate) { 709 Isolate* isolate) {
709 WriteInt32ToHeapNumberStub stub1(r1, r0, r2); 710 WriteInt32ToHeapNumberStub stub1(r1, r0, r2);
710 WriteInt32ToHeapNumberStub stub2(r2, r0, r3); 711 WriteInt32ToHeapNumberStub stub2(r2, r0, r3);
711 stub1.GetCode(isolate); 712 stub1.GetCode(isolate);
712 stub2.GetCode(isolate); 713 stub2.GetCode(isolate);
(...skipping 5132 matching lines...) Expand 10 before | Expand all | Expand 10 after
5845 __ bind(&fast_elements_case); 5846 __ bind(&fast_elements_case);
5846 GenerateCase(masm, FAST_ELEMENTS); 5847 GenerateCase(masm, FAST_ELEMENTS);
5847 } 5848 }
5848 5849
5849 5850
5850 #undef __ 5851 #undef __
5851 5852
5852 } } // namespace v8::internal 5853 } } // namespace v8::internal
5853 5854
5854 #endif // V8_TARGET_ARCH_ARM 5855 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698