[pypy-svn] r16052 - in pypy/dist/pypy/translator/llvm2: . module

ericvrp at codespeak.net ericvrp at codespeak.net
Sat Aug 13 22:52:34 CEST 2005


Author: ericvrp
Date: Sat Aug 13 22:52:33 2005
New Revision: 16052

Modified:
   pypy/dist/pypy/translator/llvm2/codewriter.py
   pypy/dist/pypy/translator/llvm2/module/ll_math.py
   pypy/dist/pypy/translator/llvm2/module/ll_os.py
   pypy/dist/pypy/translator/llvm2/module/support.py
Log:
- removed check for SSA breaking, errors were probably caused by not supplying -no-o to translate_pypy.py
- added dummy function for the remaining external functions
- fixed int_floordiv_ovf_zer, wrong function name was emitted


Modified: pypy/dist/pypy/translator/llvm2/codewriter.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/codewriter.py	(original)
+++ pypy/dist/pypy/translator/llvm2/codewriter.py	Sat Aug 13 22:52:33 2005
@@ -97,12 +97,13 @@
             ["[%s, %%%s]" % item 
                 for item in zip(refs, blocknames)])
         s = "%s = phi %s %s" % (targetvar, type_, mergelist)
-        for ref in refs:
-            if targetvar == ref:
-                self.comment('breaks SSA form: ' + s)
-                break
-        else:
-            self.indent(s)
+        #for ref in refs:
+        #    if targetvar == ref:
+        #        self.comment('breaks SSA form: ' + s)
+        #        break
+        #else:
+        #    self.indent(s)
+        self.indent(s)
 
     def binaryop(self, name, targetvar, type_, ref1, ref2):
         self.indent("%s = %s %s %s, %s" % (targetvar, name, type_, ref1, ref2))

Modified: pypy/dist/pypy/translator/llvm2/module/ll_math.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/ll_math.py	(original)
+++ pypy/dist/pypy/translator/llvm2/module/ll_math.py	Sat Aug 13 22:52:33 2005
@@ -40,3 +40,38 @@
 for params, functions in simple_functions:
     for function in functions:
         extfunctions["%ll_math_" + function] = ((), simple_function_template % locals())
+
+extfunctions["%ll_math_frexp"] = ((), """
+internal fastcc %structtype.tuple2.6* %ll_math_frexp(double %x) {
+    ; XXX: TODO: ll_math_frexp
+    ret %structtype.tuple2.6* null
+}
+""")
+
+extfunctions["%ll_math_hypot"] = ((), """
+internal fastcc double %ll_math_hypot(double %x, double %y) {
+    ; XXX: TODO: ll_math_hypot
+    ret double 0.0
+}
+""")
+
+extfunctions["%ll_math_ldexp"] = ((), """
+internal fastcc double %ll_math_ldexp(double %x, int %y) {
+    ; XXX: TODO: ll_math_ldexp
+    ret double 0.0
+}
+""")
+
+extfunctions["%ll_math_modf"] = ((), """
+internal fastcc %structtype.tuple2.7* %ll_math_modf(double %x) {
+    ; XXX: TODO: ll_math_modf
+    ret %structtype.tuple2.7* null
+}
+""")
+
+extfunctions["%ll_math_pow"] = ((), """
+internal fastcc double %ll_math_pow(double %x, double %y) {
+    ; XXX: TODO: ll_math_pow
+    ret double 0.0
+}
+""")

Modified: pypy/dist/pypy/translator/llvm2/module/ll_os.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/ll_os.py	(original)
+++ pypy/dist/pypy/translator/llvm2/module/ll_os.py	Sat Aug 13 22:52:33 2005
@@ -85,18 +85,37 @@
 
 """)
 
-#struct stat {
-#     0 : dev_t         res2 : st_dev;      /* device */
-#     1 : ino_t         res1 : st_ino;      /* inode */
-#     2 : mode_t        res0 : st_mode;     /* protection */
-#     3 : nlink_t       res3 : st_nlink;    /* number of hard links */
-#     4 : uid_t         res4 : st_uid;      /* user ID of owner */
-#     5 : gid_t         res5 : st_gid;      /* group ID of owner */
-#     6 : dev_t              : st_rdev;     /* device type (if inode device) */
-#     7 : off_t         res6 : st_size;     /* total size, in bytes */
-#     8 : blksize_t          : st_blksize;  /* blocksize for filesystem I/O */
-#     9 : blkcnt_t           : st_blocks;   /* number of blocks allocated */
-#    10 : time_t        res7 : st_atime;    /* time of last access */
-#    11 : time_t        res8 : st_mtime;    /* time of last modification */
-#    12 : time_t        res9 : st_ctime;    /* time of last status change */
-#};
+extfunctions["%ll_os_ftruncate"] = ((), """
+internal fastcc void %ll_os_ftruncate(int %x, int %y) {
+    ; XXX: TODO: ll_os_ftruncate
+    ret void
+}
+""")
+
+extfunctions["%ll_os_lseek"] = ((), """
+internal fastcc int %ll_os_lseek(int %x, int %y, int %z) {
+    ; XXX: TODO: ll_os_lseek
+    ret int 0
+}
+""")
+
+extfunctions["%ll_os_stat"] = ((), """
+internal fastcc %structtype.tuple10* %ll_os_stat(%structtype.rpy_string* %s) {
+    ; XXX: TODO: ll_os_stat
+    ret %structtype.tuple10* null
+}
+""")
+
+extfunctions["%ll_strtod_formatd"] = ((), """
+internal fastcc %structtype.rpy_string* %ll_strtod_formatd(%structtype.rpy_string* %s, double %x) {
+    ; XXX: TODO: ll_strtod_formatd
+    ret %structtype.rpy_string* null
+}
+""")
+
+extfunctions["%"] = ((), """
+internal fastcc double %ll_strtod_parts_to_float(%structtype.rpy_string* s0, %structtype.rpy_string* s1, %structtype.rpy_string* s2, %structtype.rpy_string* s3) {
+    ; XXX: TODO: ll_strtod_parts_to_float
+    ret double 0.0
+}
+""")

Modified: pypy/dist/pypy/translator/llvm2/module/support.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/support.py	(original)
+++ pypy/dist/pypy/translator/llvm2/module/support.py	Sat Aug 13 22:52:33 2005
@@ -182,12 +182,12 @@
 #binary with OverflowError and ZeroDivisionError
 
 extfunctions["%int_floordiv_ovf_zer"] = (("%__prepare_OverflowError","%__prepare_ZeroDivisionError"), """
-internal fastcc int %%int_floordiv_zer_val(int %%x, int %%y) {
+internal fastcc int %%int_floordiv_ovf_zer(int %%x, int %%y) {
     %(int_zer_test)s
     %%t = div int %%x, %%y
     %(int_ovf_test)s
 return_block:
-    ; XXX: TEST int_floordiv_zer_val checking
+    ; XXX: TEST int_floordiv_ovf_zer checking
     ret int %%t
 }
 """ % locals())



More information about the Pypy-commit mailing list