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 288383002: Allow comparison in UINT32 mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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/mips/lithium-codegen-mips.cc ('k') | 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "x64/lithium-codegen-x64.h" 9 #include "x64/lithium-codegen-x64.h"
10 #include "code-stubs.h" 10 #include "code-stubs.h"
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 if (shift_count != 0) { 1598 if (shift_count != 0) {
1599 __ rorl(ToRegister(left), Immediate(shift_count)); 1599 __ rorl(ToRegister(left), Immediate(shift_count));
1600 } 1600 }
1601 break; 1601 break;
1602 case Token::SAR: 1602 case Token::SAR:
1603 if (shift_count != 0) { 1603 if (shift_count != 0) {
1604 __ sarl(ToRegister(left), Immediate(shift_count)); 1604 __ sarl(ToRegister(left), Immediate(shift_count));
1605 } 1605 }
1606 break; 1606 break;
1607 case Token::SHR: 1607 case Token::SHR:
1608 if (shift_count == 0 && instr->can_deopt()) { 1608 if (shift_count != 0) {
1609 __ shrl(ToRegister(left), Immediate(shift_count));
1610 } else if (instr->can_deopt()) {
1609 __ testl(ToRegister(left), ToRegister(left)); 1611 __ testl(ToRegister(left), ToRegister(left));
1610 DeoptimizeIf(negative, instr->environment()); 1612 DeoptimizeIf(negative, instr->environment());
1611 } else {
1612 __ shrl(ToRegister(left), Immediate(shift_count));
1613 } 1613 }
1614 break; 1614 break;
1615 case Token::SHL: 1615 case Token::SHL:
1616 if (shift_count != 0) { 1616 if (shift_count != 0) {
1617 if (instr->hydrogen_value()->representation().IsSmi()) { 1617 if (instr->hydrogen_value()->representation().IsSmi()) {
1618 __ shlp(ToRegister(left), Immediate(shift_count)); 1618 __ shlp(ToRegister(left), Immediate(shift_count));
1619 } else { 1619 } else {
1620 __ shll(ToRegister(left), Immediate(shift_count)); 1620 __ shll(ToRegister(left), Immediate(shift_count));
1621 } 1621 }
1622 } 1622 }
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 default: 2227 default:
2228 UNREACHABLE(); 2228 UNREACHABLE();
2229 } 2229 }
2230 return cond; 2230 return cond;
2231 } 2231 }
2232 2232
2233 2233
2234 void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) { 2234 void LCodeGen::DoCompareNumericAndBranch(LCompareNumericAndBranch* instr) {
2235 LOperand* left = instr->left(); 2235 LOperand* left = instr->left();
2236 LOperand* right = instr->right(); 2236 LOperand* right = instr->right();
2237 Condition cc = TokenToCondition(instr->op(), instr->is_double()); 2237 bool is_unsigned =
2238 instr->is_double() || instr->hydrogen()->CheckFlag(HInstruction::kUint32);
2239 Condition cc = TokenToCondition(instr->op(), is_unsigned);
2238 2240
2239 if (left->IsConstantOperand() && right->IsConstantOperand()) { 2241 if (left->IsConstantOperand() && right->IsConstantOperand()) {
2240 // We can statically evaluate the comparison. 2242 // We can statically evaluate the comparison.
2241 double left_val = ToDouble(LConstantOperand::cast(left)); 2243 double left_val = ToDouble(LConstantOperand::cast(left));
2242 double right_val = ToDouble(LConstantOperand::cast(right)); 2244 double right_val = ToDouble(LConstantOperand::cast(right));
2243 int next_block = EvalComparison(instr->op(), left_val, right_val) ? 2245 int next_block = EvalComparison(instr->op(), left_val, right_val) ?
2244 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); 2246 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_);
2245 EmitGoto(next_block); 2247 EmitGoto(next_block);
2246 } else { 2248 } else {
2247 if (instr->is_double()) { 2249 if (instr->is_double()) {
(...skipping 3477 matching lines...) Expand 10 before | Expand all | Expand 10 after
5725 __ bind(deferred->exit()); 5727 __ bind(deferred->exit());
5726 __ bind(&done); 5728 __ bind(&done);
5727 } 5729 }
5728 5730
5729 5731
5730 #undef __ 5732 #undef __
5731 5733
5732 } } // namespace v8::internal 5734 } } // namespace v8::internal
5733 5735
5734 #endif // V8_TARGET_ARCH_X64 5736 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698