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

Unified Diff: src/x64/assembler-x64.cc

Issue 164472: X64: Change testl to testb if mask fits in 1 byte. Shortens smi test. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/assembler-x64.cc
===================================================================
--- src/x64/assembler-x64.cc (revision 2675)
+++ src/x64/assembler-x64.cc (working copy)
@@ -1608,6 +1608,11 @@
void Assembler::testl(Register reg, Immediate mask) {
+ // testl with a mask that fits in the low byte is exactly testb.
+ if (is_uint8(mask.value_) {
+ testb(reg, mask);
+ return;
+ }
EnsureSpace ensure_space(this);
last_pc_ = pc_;
if (reg.is(rax)) {
@@ -1623,6 +1628,11 @@
void Assembler::testl(const Operand& op, Immediate mask) {
+ // testl with a mask that fits in the low byte is exactly testb.
+ if (is_uint8(mask.value_)) {
+ testb(op, mask);
+ return;
+ }
EnsureSpace ensure_space(this);
last_pc_ = pc_;
emit_optional_rex_32(rax, op);
« 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