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

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

Issue 14211009: Crankshaft: Recognize (i >>> 0) === i for integer32 inputs and replace (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 8 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/token.h ('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 // 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 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 if (shift_count != 0) { 1491 if (shift_count != 0) {
1492 __ rorl(ToRegister(left), Immediate(shift_count)); 1492 __ rorl(ToRegister(left), Immediate(shift_count));
1493 } 1493 }
1494 break; 1494 break;
1495 case Token::SAR: 1495 case Token::SAR:
1496 if (shift_count != 0) { 1496 if (shift_count != 0) {
1497 __ sarl(ToRegister(left), Immediate(shift_count)); 1497 __ sarl(ToRegister(left), Immediate(shift_count));
1498 } 1498 }
1499 break; 1499 break;
1500 case Token::SHR: 1500 case Token::SHR:
1501 if (shift_count == 0 && instr->can_deopt()) { 1501 if (shift_count != 0) {
1502 __ shrl(ToRegister(left), Immediate(shift_count));
1503 } else if (instr->can_deopt()) {
1502 __ testl(ToRegister(left), ToRegister(left)); 1504 __ testl(ToRegister(left), ToRegister(left));
1503 DeoptimizeIf(negative, instr->environment()); 1505 DeoptimizeIf(negative, instr->environment());
1504 } else { 1506 } else {
1505 __ shrl(ToRegister(left), Immediate(shift_count)); 1507 // Even if the shift is zero, we have to zero out the high bits with
1508 // a movl for negative inputs.
1509 __ movl(ToRegister(left), ToRegister(left));
1506 } 1510 }
1507 break; 1511 break;
1508 case Token::SHL: 1512 case Token::SHL:
1509 if (shift_count != 0) { 1513 if (shift_count != 0) {
1510 __ shll(ToRegister(left), Immediate(shift_count)); 1514 __ shll(ToRegister(left), Immediate(shift_count));
1511 } 1515 }
1512 break; 1516 break;
1513 default: 1517 default:
1514 UNREACHABLE(); 1518 UNREACHABLE();
1515 break; 1519 break;
(...skipping 4170 matching lines...) Expand 10 before | Expand all | Expand 10 after
5686 FixedArray::kHeaderSize - kPointerSize)); 5690 FixedArray::kHeaderSize - kPointerSize));
5687 __ bind(&done); 5691 __ bind(&done);
5688 } 5692 }
5689 5693
5690 5694
5691 #undef __ 5695 #undef __
5692 5696
5693 } } // namespace v8::internal 5697 } } // namespace v8::internal
5694 5698
5695 #endif // V8_TARGET_ARCH_X64 5699 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/token.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698