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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 214493002: Introduce rolp, rorp, rclp, rcrp, shlp, shrp and sarp for x64 port (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 9 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/x64/ic-x64.cc ('k') | src/x64/macro-assembler-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 if (shift_count == 0 && instr->can_deopt()) { 1530 if (shift_count == 0 && instr->can_deopt()) {
1531 __ testl(ToRegister(left), ToRegister(left)); 1531 __ testl(ToRegister(left), ToRegister(left));
1532 DeoptimizeIf(negative, instr->environment()); 1532 DeoptimizeIf(negative, instr->environment());
1533 } else { 1533 } else {
1534 __ shrl(ToRegister(left), Immediate(shift_count)); 1534 __ shrl(ToRegister(left), Immediate(shift_count));
1535 } 1535 }
1536 break; 1536 break;
1537 case Token::SHL: 1537 case Token::SHL:
1538 if (shift_count != 0) { 1538 if (shift_count != 0) {
1539 if (instr->hydrogen_value()->representation().IsSmi()) { 1539 if (instr->hydrogen_value()->representation().IsSmi()) {
1540 __ shl(ToRegister(left), Immediate(shift_count)); 1540 __ shlp(ToRegister(left), Immediate(shift_count));
1541 } else { 1541 } else {
1542 __ shll(ToRegister(left), Immediate(shift_count)); 1542 __ shll(ToRegister(left), Immediate(shift_count));
1543 } 1543 }
1544 } 1544 }
1545 break; 1545 break;
1546 default: 1546 default:
1547 UNREACHABLE(); 1547 UNREACHABLE();
1548 break; 1548 break;
1549 } 1549 }
1550 } 1550 }
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 } 2677 }
2678 if (instr->has_constant_parameter_count()) { 2678 if (instr->has_constant_parameter_count()) {
2679 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, 2679 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize,
2680 rcx); 2680 rcx);
2681 } else { 2681 } else {
2682 Register reg = ToRegister(instr->parameter_count()); 2682 Register reg = ToRegister(instr->parameter_count());
2683 // The argument count parameter is a smi 2683 // The argument count parameter is a smi
2684 __ SmiToInteger32(reg, reg); 2684 __ SmiToInteger32(reg, reg);
2685 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; 2685 Register return_addr_reg = reg.is(rcx) ? rbx : rcx;
2686 __ PopReturnAddressTo(return_addr_reg); 2686 __ PopReturnAddressTo(return_addr_reg);
2687 __ shl(reg, Immediate(kPointerSizeLog2)); 2687 __ shlp(reg, Immediate(kPointerSizeLog2));
2688 __ addp(rsp, reg); 2688 __ addp(rsp, reg);
2689 __ jmp(return_addr_reg); 2689 __ jmp(return_addr_reg);
2690 } 2690 }
2691 if (no_frame_start != -1) { 2691 if (no_frame_start != -1) {
2692 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); 2692 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset());
2693 } 2693 }
2694 } 2694 }
2695 2695
2696 2696
2697 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { 2697 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
3481 __ bind(&slow); 3481 __ bind(&slow);
3482 CallRuntimeFromDeferred( 3482 CallRuntimeFromDeferred(
3483 Runtime::kAllocateHeapNumber, 0, instr, instr->context()); 3483 Runtime::kAllocateHeapNumber, 0, instr, instr->context());
3484 // Set the pointer to the new heap number in tmp. 3484 // Set the pointer to the new heap number in tmp.
3485 if (!tmp.is(rax)) __ movp(tmp, rax); 3485 if (!tmp.is(rax)) __ movp(tmp, rax);
3486 // Restore input_reg after call to runtime. 3486 // Restore input_reg after call to runtime.
3487 __ LoadFromSafepointRegisterSlot(input_reg, input_reg); 3487 __ LoadFromSafepointRegisterSlot(input_reg, input_reg);
3488 3488
3489 __ bind(&allocated); 3489 __ bind(&allocated);
3490 __ movq(tmp2, FieldOperand(input_reg, HeapNumber::kValueOffset)); 3490 __ movq(tmp2, FieldOperand(input_reg, HeapNumber::kValueOffset));
3491 __ shl(tmp2, Immediate(1)); 3491 __ shlq(tmp2, Immediate(1));
3492 __ shr(tmp2, Immediate(1)); 3492 __ shrq(tmp2, Immediate(1));
3493 __ movq(FieldOperand(tmp, HeapNumber::kValueOffset), tmp2); 3493 __ movq(FieldOperand(tmp, HeapNumber::kValueOffset), tmp2);
3494 __ StoreToSafepointRegisterSlot(input_reg, tmp); 3494 __ StoreToSafepointRegisterSlot(input_reg, tmp);
3495 3495
3496 __ bind(&done); 3496 __ bind(&done);
3497 } 3497 }
3498 3498
3499 3499
3500 void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) { 3500 void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) {
3501 Register input_reg = ToRegister(instr->value()); 3501 Register input_reg = ToRegister(instr->value());
3502 __ testl(input_reg, input_reg); 3502 __ testl(input_reg, input_reg);
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after
5094 5094
5095 __ bind(&done); 5095 __ bind(&done);
5096 } 5096 }
5097 5097
5098 5098
5099 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { 5099 void LCodeGen::DoDoubleBits(LDoubleBits* instr) {
5100 XMMRegister value_reg = ToDoubleRegister(instr->value()); 5100 XMMRegister value_reg = ToDoubleRegister(instr->value());
5101 Register result_reg = ToRegister(instr->result()); 5101 Register result_reg = ToRegister(instr->result());
5102 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { 5102 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) {
5103 __ movq(result_reg, value_reg); 5103 __ movq(result_reg, value_reg);
5104 __ shr(result_reg, Immediate(32)); 5104 __ shrq(result_reg, Immediate(32));
5105 } else { 5105 } else {
5106 __ movd(result_reg, value_reg); 5106 __ movd(result_reg, value_reg);
5107 } 5107 }
5108 } 5108 }
5109 5109
5110 5110
5111 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { 5111 void LCodeGen::DoConstructDouble(LConstructDouble* instr) {
5112 Register hi_reg = ToRegister(instr->hi()); 5112 Register hi_reg = ToRegister(instr->hi());
5113 Register lo_reg = ToRegister(instr->lo()); 5113 Register lo_reg = ToRegister(instr->lo());
5114 XMMRegister result_reg = ToDoubleRegister(instr->result()); 5114 XMMRegister result_reg = ToDoubleRegister(instr->result());
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
5166 } 5166 }
5167 5167
5168 __ bind(deferred->exit()); 5168 __ bind(deferred->exit());
5169 5169
5170 if (instr->hydrogen()->MustPrefillWithFiller()) { 5170 if (instr->hydrogen()->MustPrefillWithFiller()) {
5171 if (instr->size()->IsConstantOperand()) { 5171 if (instr->size()->IsConstantOperand()) {
5172 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5172 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5173 __ movl(temp, Immediate((size / kPointerSize) - 1)); 5173 __ movl(temp, Immediate((size / kPointerSize) - 1));
5174 } else { 5174 } else {
5175 temp = ToRegister(instr->size()); 5175 temp = ToRegister(instr->size());
5176 __ sar(temp, Immediate(kPointerSizeLog2)); 5176 __ sarp(temp, Immediate(kPointerSizeLog2));
5177 __ decl(temp); 5177 __ decl(temp);
5178 } 5178 }
5179 Label loop; 5179 Label loop;
5180 __ bind(&loop); 5180 __ bind(&loop);
5181 __ Move(FieldOperand(result, temp, times_pointer_size, 0), 5181 __ Move(FieldOperand(result, temp, times_pointer_size, 0),
5182 isolate()->factory()->one_pointer_filler_map()); 5182 isolate()->factory()->one_pointer_filler_map());
5183 __ decl(temp); 5183 __ decl(temp);
5184 __ j(not_zero, &loop); 5184 __ j(not_zero, &loop);
5185 } 5185 }
5186 } 5186 }
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
5650 FixedArray::kHeaderSize - kPointerSize)); 5650 FixedArray::kHeaderSize - kPointerSize));
5651 __ bind(&done); 5651 __ bind(&done);
5652 } 5652 }
5653 5653
5654 5654
5655 #undef __ 5655 #undef __
5656 5656
5657 } } // namespace v8::internal 5657 } } // namespace v8::internal
5658 5658
5659 #endif // V8_TARGET_ARCH_X64 5659 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/ic-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698