Author: Alex Gaynor <alex.gay...@gmail.com>
Branch: extradoc
Changeset: r3887:0839f40cc0e0
Date: 2011-08-23 12:21 -0500
http://bitbucket.org/pypy/extradoc/changeset/0839f40cc0e0/

Log:    added a ask for branchless INT_ABS resop

diff --git a/planning/jit.txt b/planning/jit.txt
--- a/planning/jit.txt
+++ b/planning/jit.txt
@@ -11,7 +11,7 @@
 ---------
 
 - have benchmarks for jit compile time and jit memory usage
-  
+
 - maybe refactor a bit the x86 backend, particularly the register
   allocation
 
@@ -36,7 +36,18 @@
 - implement small tuples, there are a lot of places where they are hashed and
   compared
 
-- support single floats in the JIT
+- implement INT_ABS in the JIT, currently jtransform generates a call to an
+  inlined function, which does the trivial branching. However, GCC shows that
+  it can be done branchless in the ASM (as we do for FLOAT_ABS, which is easier
+  because it has an explicit sign bit). GCC generates:
+
+    movq    %rdi, %rdx
+    sarq    $63, %rdx
+    movq    %rdx, %rax
+    xorq    %rdi, %rax
+    subq    %rdx, %rax
+    ret
+
 
 OPTIMIZATIONS
 -------------
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to