From 15c1d23fbc8f910f3bd11b34bae3d5a7ce0f0af1 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Fri, 2 Aug 2013 08:55:26 +0000 Subject: [PATCH] Use test(reg, imm) when the operand is a register on ia32 R=jkummerow@chromium.org Review URL: https://codereview.chromium.org/21521002 Patch from Weiliang Lin . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16020 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ia32/assembler-ia32.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc index e0ae006655..7bea373025 100644 --- a/src/ia32/assembler-ia32.cc +++ b/src/ia32/assembler-ia32.cc @@ -1227,6 +1227,10 @@ void Assembler::test_b(Register reg, const Operand& op) { void Assembler::test(const Operand& op, const Immediate& imm) { + if (op.is_reg_only()) { + test(op.reg(), imm); + return; + } EnsureSpace ensure_space(this); EMIT(0xF7); emit_operand(eax, op);