Reviewers: mtbrandyberry, michael_dawson,

Description:
PPC: smi test optimization

[email protected], [email protected]
BUG=

Please review this at https://codereview.chromium.org/1177263002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+7, -2 lines):
  M src/ppc/macro-assembler-ppc.h


Index: src/ppc/macro-assembler-ppc.h
diff --git a/src/ppc/macro-assembler-ppc.h b/src/ppc/macro-assembler-ppc.h
index 491167b227d531009629d7fb4a7d44ad3b6a238c..019ca2217cb072d86137dfd5c690fd80502022c2 100644
--- a/src/ppc/macro-assembler-ppc.h
+++ b/src/ppc/macro-assembler-ppc.h
@@ -1063,11 +1063,16 @@ class MacroAssembler : public Assembler {
     DCHECK(rangeStart >= rangeEnd && rangeStart < kBitsPerPointer);
     int rotate = (rangeEnd == 0) ? 0 : kBitsPerPointer - rangeEnd;
     int width = rangeStart - rangeEnd + 1;
+    if (rc == SetRC && rangeEnd == 0 && width <= 16) {
+      andi(dst, src, Operand((1 << width) - 1));
+    } else {
 #if V8_TARGET_ARCH_PPC64
-    rldicl(dst, src, rotate, kBitsPerPointer - width, rc);
+      rldicl(dst, src, rotate, kBitsPerPointer - width, rc);
 #else
- rlwinm(dst, src, rotate, kBitsPerPointer - width, kBitsPerPointer - 1, rc); + rlwinm(dst, src, rotate, kBitsPerPointer - width, kBitsPerPointer - 1,
+             rc);
 #endif
+    }
   }

   inline void ExtractBit(Register dst, Register src, uint32_t bitNumber,


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to