Author: Manuel Jacob <[email protected]>
Branch: llvm-translation-backend
Changeset: r75421:13b46ae9604f
Date: 2015-01-08 22:36 +0100
http://bitbucket.org/pypy/pypy/changeset/13b46ae9604f/
Log: Implement int_force_ge_zero() llop.
diff --git a/rpython/translator/llvm/genllvm.py
b/rpython/translator/llvm/genllvm.py
--- a/rpython/translator/llvm/genllvm.py
+++ b/rpython/translator/llvm/genllvm.py
@@ -1306,6 +1306,12 @@
self.w('{t2.V} = icmp slt {b.TV}, {c.V}'.format(**locals()))
self.w('{result.V} = and i1 {t1.V}, {t2.V}'.format(**locals()))
+ def op_int_force_ge_zero(self, result, var):
+ isneg = self._tmp()
+ self.w('{isneg.V} = icmp slt {var.TV}, 0'.format(**locals()))
+ self.w('{result.V} = select i1 {isneg.V}, {var.T} 0, {var.TV}'
+ .format(**locals()))
+
def op_ptr_iszero(self, result, var):
self.w('{result.V} = icmp eq {var.TV}, null'.format(**locals()))
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit