X64: Change testl to testb if mask fits in 1 byte. Shortens smi test.

Review URL: http://codereview.chromium.org/164472

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
whesse@chromium.org 2009-08-13 12:35:09 +00:00
parent c540fc7de6
commit 5a3998c1f4

View File

@ -1608,6 +1608,11 @@ void Assembler::testl(Register dst, Register src) {
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(Register reg, Immediate mask) {
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);