[pypy-svn] r35574 - in pypy/dist/pypy/jit/codegen: i386/test llvm/test

arigo at codespeak.net arigo at codespeak.net
Mon Dec 11 15:07:58 CET 2006


Author: arigo
Date: Mon Dec 11 15:07:54 2006
New Revision: 35574

Modified:
   pypy/dist/pypy/jit/codegen/i386/test/test_operation.py
   pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py
Log:
Answering to eric who just left #pypy :-)


Modified: pypy/dist/pypy/jit/codegen/i386/test/test_operation.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/test/test_operation.py	(original)
+++ pypy/dist/pypy/jit/codegen/i386/test/test_operation.py	Mon Dec 11 15:07:54 2006
@@ -8,6 +8,7 @@
 from pypy.rpython.memory.lltypelayout import convert_offset_to_int
 from pypy.rlib.rarithmetic import r_uint
 from ctypes import cast, c_void_p, CFUNCTYPE, c_int
+from pypy import conftest
 
 def conv(n):
     if not isinstance(n, int):
@@ -52,6 +53,8 @@
         t.buildannotator().build_types(ll_function, argtypes)
         t.buildrtyper().specialize()
         graph = graphof(t, ll_function)
+        if conftest.option.view:
+            graph.show()
         rgenop = self.RGenOp()
         self.rgenop = rgenop      # keep this alive!
         gv_generated = graph2rgenop.compile_graph(rgenop, graph)

Modified: pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py	(original)
+++ pypy/dist/pypy/jit/codegen/llvm/test/test_operation.py	Mon Dec 11 15:07:54 2006
@@ -21,6 +21,13 @@
 
     test_unsigned = skip
     #XXX -r_uint(n) generated op_int_sub(0,n) , why not op_uint_sub?
+    # -AR- for me it crashes on the 'x%y' test.  The LLVM ref manual
+    #      seems to mention only 'srem' and 'urem' instructions and
+    #      not 'rem'.  Same for 'sdiv' and 'udiv' and no 'div'.
+    #      Strange, the translator/llvm backend seems to produce
+    #      'div' and 'rem' anyway...
+    # -AR- I see in llvm.rgenop that op_uint_invert uses an IntConst
+    #      (should be UIntConst).
 
     test_float_arithmetic = skip
     #XXX bool(f - 2.0) generated op_float_sub(f,IntConst(2)) , why not FloatConst(2.0) ?
@@ -28,6 +35,13 @@
     #   >           ArgumentError: argument 1: exceptions.TypeError: int expected instead of float instance
 
     #   [/mnt/hdb3/projects.eric/pypy-dist/pypy/jit/codegen/i386/test/test_operation.py:240]
+    # -AR- the ctypes function type need to be fixed in rgen() in
+    #      i386.test.test_operation.  For now it assumes that all args are
+    #      c_int.  The llvm.rgenop.genconst() method should have more cases
+    #      instead of always returning IntConst for any Primitive type;
+    #      e.g. return UIntConst for unsigned integer types, FloatConst for
+    #      float types, and possibly things like CharConst UniCharConst etc.
+    #      based on what T is (the same kind of checks as in kindToken())
 
     test_char_array = skip
     test_char_varsize_array = skip



More information about the Pypy-commit mailing list