Reviewers: Lasse Reichstein,

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

Please review this at http://codereview.chromium.org/164472

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/x64/assembler-x64.cc


Index: src/x64/assembler-x64.cc
===================================================================
--- src/x64/assembler-x64.cc    (revision 2675)
+++ src/x64/assembler-x64.cc    (working copy)
@@ -1609,6 +1609,11 @@

  void Assembler::testl(Register reg, Immediate mask) {
    EnsureSpace ensure_space(this);
+  // testl with a mask that fits in the low byte is exactly testb.
+  if ((mask.value_ & 0xFFFFFF00) == 0) {
+    testb(reg, mask);
+    return;
+  }
    last_pc_ = pc_;
    if (reg.is(rax)) {
      emit(0xA9);
@@ -1624,6 +1629,11 @@

  void Assembler::testl(const Operand& op, Immediate mask) {
    EnsureSpace ensure_space(this);
+  // testl with a mask that fits in the low byte is exactly testb.
+  if ((mask.value_ & 0xFFFFFF00) == 0) {
+    testb(op, mask);
+    return;
+  }
    last_pc_ = pc_;
    emit_optional_rex_32(rax, op);
    emit(0xF7);



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to