[pypy-commit] pypy testing-cleanup: windows fix
Author: Ronan LamyBranch: testing-cleanup Changeset: r85183:df4238f06f16 Date: 2016-06-15 17:10 +0100 http://bitbucket.org/pypy/pypy/changeset/df4238f06f16/ Log:windows fix diff --git a/pypy/module/cpyext/test/support.py b/pypy/module/cpyext/test/support.py --- a/pypy/module/cpyext/test/support.py +++ b/pypy/module/cpyext/test/support.py @@ -20,7 +20,7 @@ else: so_ext = 'dll' -def c_compile(cfilenames, eci, outputfilename=None, standalone=True): +def c_compile(cfilenames, eci, outputfilename, standalone=True): self = rpy_platform self._ensure_correct_math() self.cfilenames = cfilenames @@ -62,10 +62,7 @@ for framework in self.frameworks: self.link_extra += ['-framework', framework] -if outputfilename is None: -self.outputfilename = py.path.local(cfilenames[0]).new(ext=ext) -else: -self.outputfilename = py.path.local(outputfilename) +self.outputfilename = py.path.local(outputfilename).new(ext=ext) self.eci = eci import distutils.errors basename = self.outputfilename.new(ext='') ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy testing-cleanup: copy and start adapting code from rpython.translator.platform.distutils_platform
Author: Ronan LamyBranch: testing-cleanup Changeset: r85182:bd1fd28ffd7b Date: 2016-06-14 22:08 +0100 http://bitbucket.org/pypy/pypy/changeset/bd1fd28ffd7b/ Log:copy and start adapting code from rpython.translator.platform.distutils_platform diff --git a/pypy/module/cpyext/test/support.py b/pypy/module/cpyext/test/support.py new file mode 100644 --- /dev/null +++ b/pypy/module/cpyext/test/support.py @@ -0,0 +1,133 @@ +import os +import sys +import py +from rpython.translator.platform import log, CompilationError +from rpython.translator.tool import stdoutcapture +from rpython.translator.platform.distutils_platform import DistutilsPlatform + +rpy_platform = DistutilsPlatform() + +def log_spawned_cmd(spawn): +def spawn_and_log(cmd, *args, **kwds): +log.execute(' '.join(cmd)) +return spawn(cmd, *args, **kwds) +return spawn_and_log + +CFLAGS = ['-O3'] + +if os.name != 'nt': +so_ext = 'so' +else: +so_ext = 'dll' + +def c_compile(cfilenames, eci, outputfilename=None, standalone=True): +self = rpy_platform +self._ensure_correct_math() +self.cfilenames = cfilenames +if standalone: +ext = '' +else: +ext = so_ext +self.standalone = standalone +self.libraries = list(eci.libraries) +self.include_dirs = list(eci.include_dirs) +self.library_dirs = list(eci.library_dirs) +self.compile_extra = list(eci.compile_extra) +self.link_extra = list(eci.link_extra) +self.frameworks = list(eci.frameworks) +if not self.name in ('win32', 'darwin', 'cygwin'): # xxx +if 'm' not in self.libraries: +self.libraries.append('m') +self.compile_extra += CFLAGS + ['-fomit-frame-pointer'] +if 'pthread' not in self.libraries: +self.libraries.append('pthread') +if self.name != 'sunos5': +self.compile_extra += ['-pthread'] +self.link_extra += ['-pthread'] +else: +self.compile_extra += ['-pthreads'] +self.link_extra += ['-lpthread'] +if self.name == 'win32': +self.link_extra += ['/DEBUG'] # generate .pdb file +if self.name == 'darwin': +# support Fink & Darwinports +for s in ('/sw/', '/opt/local/'): +if s + 'include' not in self.include_dirs and \ +os.path.exists(s + 'include'): +self.include_dirs.append(s + 'include') +if s + 'lib' not in self.library_dirs and \ +os.path.exists(s + 'lib'): +self.library_dirs.append(s + 'lib') +self.compile_extra += CFLAGS + ['-fomit-frame-pointer'] +for framework in self.frameworks: +self.link_extra += ['-framework', framework] + +if outputfilename is None: +self.outputfilename = py.path.local(cfilenames[0]).new(ext=ext) +else: +self.outputfilename = py.path.local(outputfilename) +self.eci = eci +import distutils.errors +basename = self.outputfilename.new(ext='') +data = '' +try: +saved_environ = os.environ.copy() +c = stdoutcapture.Capture(mixed_out_err=True) +try: +self._build() +finally: +# workaround for a distutils bugs where some env vars can +# become longer and longer every time it is used +for key, value in saved_environ.items(): +if os.environ.get(key) != value: +os.environ[key] = value +foutput, foutput = c.done() +data = foutput.read() +if data: +fdump = basename.new(ext='errors').open("wb") +fdump.write(data) +fdump.close() +except (distutils.errors.CompileError, +distutils.errors.LinkError): +raise CompilationError('', data) +except: +print >>sys.stderr, data +raise +return self.outputfilename + +def _build(self): +from distutils.ccompiler import new_compiler +from distutils import sysconfig +compiler = new_compiler(force=1) +if self.cc is not None: +for c in '''compiler compiler_so compiler_cxx +linker_exe linker_so'''.split(): +compiler.executables[c][0] = self.cc +if not self.standalone: +sysconfig.customize_compiler(compiler) # XXX +compiler.spawn = log_spawned_cmd(compiler.spawn) +objects = [] +for cfile in self.cfilenames: +cfile = py.path.local(cfile) +compile_extra = self.compile_extra[:] + +old = cfile.dirpath().chdir() +try: +res = compiler.compile([cfile.basename], +include_dirs=self.eci.include_dirs, +extra_preargs=compile_extra) +assert len(res) == 1 +cobjfile = py.path.local(res[0]) +assert cobjfile.check() +objects.append(str(cobjfile)) +finally: +
[pypy-commit] pypy testing-cleanup: remove random compiler flags that shouldn't matter for cpyext
Author: Ronan LamyBranch: testing-cleanup Changeset: r85184:efcdfec61cef Date: 2016-06-15 19:30 +0100 http://bitbucket.org/pypy/pypy/changeset/efcdfec61cef/ Log:remove random compiler flags that shouldn't matter for cpyext diff --git a/pypy/module/cpyext/test/support.py b/pypy/module/cpyext/test/support.py --- a/pypy/module/cpyext/test/support.py +++ b/pypy/module/cpyext/test/support.py @@ -13,8 +13,6 @@ return spawn(cmd, *args, **kwds) return spawn_and_log -CFLAGS = ['-O3'] - if os.name != 'nt': so_ext = 'so' else: @@ -22,7 +20,6 @@ def c_compile(cfilenames, eci, outputfilename, standalone=True): self = rpy_platform -self._ensure_correct_math() self.cfilenames = cfilenames if standalone: ext = '' @@ -38,15 +35,8 @@ if not self.name in ('win32', 'darwin', 'cygwin'): # xxx if 'm' not in self.libraries: self.libraries.append('m') -self.compile_extra += CFLAGS + ['-fomit-frame-pointer'] if 'pthread' not in self.libraries: self.libraries.append('pthread') -if self.name != 'sunos5': -self.compile_extra += ['-pthread'] -self.link_extra += ['-pthread'] -else: -self.compile_extra += ['-pthreads'] -self.link_extra += ['-lpthread'] if self.name == 'win32': self.link_extra += ['/DEBUG'] # generate .pdb file if self.name == 'darwin': @@ -58,7 +48,6 @@ if s + 'lib' not in self.library_dirs and \ os.path.exists(s + 'lib'): self.library_dirs.append(s + 'lib') -self.compile_extra += CFLAGS + ['-fomit-frame-pointer'] for framework in self.frameworks: self.link_extra += ['-framework', framework] ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy py3.5: Fix _call_has_no_star_args as starargs and kwargs are not existent anymore
Author: Raffael TfirstBranch: py3.5 Changeset: r85181:49e5e8c90e82 Date: 2016-06-15 20:01 +0200 http://bitbucket.org/pypy/pypy/changeset/49e5e8c90e82/ Log:Fix _call_has_no_star_args as starargs and kwargs are not existent anymore diff --git a/pypy/interpreter/astcompiler/codegen.py b/pypy/interpreter/astcompiler/codegen.py --- a/pypy/interpreter/astcompiler/codegen.py +++ b/pypy/interpreter/astcompiler/codegen.py @@ -1217,7 +1217,15 @@ call.args, call.keywords) def _call_has_no_star_args(self, call): -return not call.starargs and not call.kwargs +if call.args is not None: +for elt in call.args: +if isinstance(elt, ast.Starred): +return False +if call.keywords is not None: +for kw in call.keywords: +if kw.arg is None: +return False +return True def _call_has_simple_args(self, call): return self._call_has_no_star_args(call) and not call.keywords ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy reverse-debugger: first_created_object_uid()
Author: Armin RigoBranch: reverse-debugger Changeset: r85180:91be90845d8d Date: 2016-06-15 16:27 +0200 http://bitbucket.org/pypy/pypy/changeset/91be90845d8d/ Log:first_created_object_uid() diff --git a/rpython/rlib/revdb.py b/rpython/rlib/revdb.py --- a/rpython/rlib/revdb.py +++ b/rpython/rlib/revdb.py @@ -71,6 +71,12 @@ unique id greater or equal.""" return llop.revdb_get_value(lltype.SignedLongLong, 'u') +def first_created_object_uid(): +"""Returns the creation number of the first object dynamically created +by the program. Older objects are either prebuilt or created before +the first stop point.""" +return llop.revdb_get_value(lltype.SignedLongLong, '1') + @specialize.argtype(0) def get_unique_id(x): """Returns the creation number of the object 'x'. For objects created diff --git a/rpython/translator/revdb/src-revdb/revdb.c b/rpython/translator/revdb/src-revdb/revdb.c --- a/rpython/translator/revdb/src-revdb/revdb.c +++ b/rpython/translator/revdb/src-revdb/revdb.c @@ -227,6 +227,7 @@ static uint64_t total_stop_points; static uint64_t stopped_time; static uint64_t stopped_uid; +static uint64_t first_created_uid; static void (*invoke_after_forward)(RPyString *); static RPyString *invoke_argument; @@ -698,6 +699,8 @@ fprintf(stderr, "stop_point_break overflow?\n"); exit(1); } +if (frozen_num_pipes == 0) +first_created_uid = rpy_revdb.unique_id_seen; fprintf(stderr, "[%llu]", (unsigned long long)rpy_revdb.stop_point_seen); @@ -877,6 +880,8 @@ return rpy_revdb.stop_point_break; case 'u': /* currently_created_objects() */ return stopped_uid ? stopped_uid : rpy_revdb.unique_id_seen; +case '1': /* first_created_object_uid() */ +return first_created_uid; default: return -1; } diff --git a/rpython/translator/revdb/test/test_basic.py b/rpython/translator/revdb/test/test_basic.py --- a/rpython/translator/revdb/test/test_basic.py +++ b/rpython/translator/revdb/test/test_basic.py @@ -350,6 +350,9 @@ obj = revdb.get_tracked_object(Stuff) revdb.send_output('None\n' if obj is None else ('obj.x=%d\n' % obj.x)) +if cmdline == 'first-created-uid': +revdb.send_output('first-created-uid=%d\n' % ( +revdb.first_created_object_uid(),)) revdb.send_output('blipped\n') lambda_blip = lambda: blip # @@ -563,3 +566,22 @@ 'obj.x=1001\r\n' 'blipped\r\n' '(2)$ ') + +def test_first_created_uid(self): +child = self.replay() +child.expectx('(3)$ ') +child.sendline('r first-created-uid') +child.expectx('<<>>\r\n') +child.expect('first-created-uid=(\d+)\r\n') +first_created_id = int(child.match.group(1)) +child.expectx('blipped\r\n' + '(3)$ ') +child.sendline('__go 1') +child.expectx('(1)$ ') +child.sendline('r print-id') +child.expect(re.escape('<<>>\r\n') + + r'obj.x=1000 (\d+) (\d+)' + + re.escape('\r\n' + 'blipped\r\n' + '(1)$ ')) +assert int(child.match.group(2)) == first_created_id ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy ppc-vsx-support: a new vector register managed,
Author: Richard PlanggerBranch: ppc-vsx-support Changeset: r85179:fcd54f26d4ff Date: 2016-06-15 16:02 +0200 http://bitbucket.org/pypy/pypy/changeset/fcd54f26d4ff/ Log:a new vector register managed, starting to impl. regalloc for loads diff --git a/rpython/jit/backend/ppc/opassembler.py b/rpython/jit/backend/ppc/opassembler.py --- a/rpython/jit/backend/ppc/opassembler.py +++ b/rpython/jit/backend/ppc/opassembler.py @@ -29,6 +29,7 @@ from rpython.jit.codewriter.effectinfo import EffectInfo from rpython.jit.backend.ppc import callbuilder from rpython.rlib.rarithmetic import r_uint +from rpython.jit.backend.ppc.vector_ext import VectorAssembler class IntOpAssembler(object): @@ -1322,12 +1323,12 @@ mc.b_abs(target) mc.copy_to_raw_memory(oldadr) - class OpAssembler(IntOpAssembler, GuardOpAssembler, MiscOpAssembler, FieldOpAssembler, StrOpAssembler, CallOpAssembler, UnicodeOpAssembler, ForceOpAssembler, - AllocOpAssembler, FloatOpAssembler): + AllocOpAssembler, FloatOpAssembler, + VectorAssembler): _mixin_ = True def nop(self): diff --git a/rpython/jit/backend/ppc/regalloc.py b/rpython/jit/backend/ppc/regalloc.py --- a/rpython/jit/backend/ppc/regalloc.py +++ b/rpython/jit/backend/ppc/regalloc.py @@ -27,6 +27,7 @@ from rpython.jit.codewriter.effectinfo import EffectInfo from rpython.rlib import rgc from rpython.rlib.rarithmetic import r_uint +from rpython.jit.backend.ppc.vector_ext import VectorRegalloc LIMIT_LOOP_BREAK = 15000 # should be much smaller than 32 KB @@ -135,6 +136,17 @@ self.temp_boxes.append(box) return reg +class VectorRegisterManager(RegisterManager): +all_regs = r.MANAGED_VECTOR_REGS +box_types = [INT, FLOAT] +save_around_call_regs = [] # ??? lookup the ABI +assert set(save_around_call_regs).issubset(all_regs) + +def __init__(self, longevity, frame_manager=None, assembler=None): +RegisterManager.__init__(self, longevity, frame_manager, assembler) + +def ensure_reg(self, box): +raise NotImplementedError class PPCFrameManager(FrameManager): def __init__(self, base_ofs): @@ -155,8 +167,7 @@ assert isinstance(loc, locations.StackLocation) return loc.position - -class Regalloc(BaseRegalloc): +class Regalloc(BaseRegalloc, VectorRegalloc): def __init__(self, assembler=None): self.cpu = assembler.cpu @@ -180,6 +191,8 @@ assembler = self.assembler) self.fprm = FPRegisterManager(self.longevity, frame_manager = self.fm, assembler = self.assembler) +self.vrm = VectorRegisterManager(self.longevity, frame_manager = self.fm, + assembler = self.assembler) return operations def prepare_loop(self, inputargs, operations, looptoken, allgcrefs): @@ -287,6 +300,7 @@ self.assembler.mc.mark_op(op) self.rm.position = i self.fprm.position = i +self.vrm.position = i opnum = op.opnum if rop.has_no_side_effect(opnum) and op not in self.longevity: i += 1 @@ -297,6 +311,8 @@ box = op.getarg(j) if box.type != FLOAT: self.rm.temp_boxes.append(box) +elif box.is_vector(): +self.vrm.temp_boxes.append(box) else: self.fprm.temp_boxes.append(box) # @@ -309,6 +325,7 @@ self.possibly_free_var(op) self.rm._check_invariants() self.fprm._check_invariants() +self.vrm._check_invariants() if self.assembler.mc.get_relative_pos() > self.limit_loop_break: self.assembler.break_long_loop() self.limit_loop_break = (self.assembler.mc.get_relative_pos() + diff --git a/rpython/jit/backend/ppc/register.py b/rpython/jit/backend/ppc/register.py --- a/rpython/jit/backend/ppc/register.py +++ b/rpython/jit/backend/ppc/register.py @@ -51,6 +51,8 @@ MANAGED_FP_REGS = VOLATILES_FLOAT #+ NONVOLATILES_FLOAT +MANAGED_VECTOR_REGS = ALL_VECTOR_REGS + assert RCS1 in MANAGED_REGS and RCS1 in NONVOLATILES assert RCS2 in MANAGED_REGS and RCS2 in NONVOLATILES assert RCS3 in MANAGED_REGS and RCS3 in NONVOLATILES diff --git a/rpython/jit/backend/ppc/vector_ext.py b/rpython/jit/backend/ppc/vector_ext.py --- a/rpython/jit/backend/ppc/vector_ext.py +++ b/rpython/jit/backend/ppc/vector_ext.py @@ -17,7 +17,7 @@ llop.debug_print(lltype.Void, msg) raise NotImplementedError(msg) -class PPCVectorAssemblerMixin(object): +class VectorAssembler(object): _mixin_ = True #def genop_guard_vec_guard_true(self, guard_op, guard_token, locs, resloc): @@
[pypy-commit] pypy ppc-vsx-support: test case skip (for cpu that does not support SIMD) changed a little
Author: Richard PlanggerBranch: ppc-vsx-support Changeset: r85178:376a87cb95fe Date: 2016-06-15 15:11 +0200 http://bitbucket.org/pypy/pypy/changeset/376a87cb95fe/ Log:test case skip (for cpu that does not support SIMD) changed a little now the tests are failing because of missing implementations of ppc diff --git a/rpython/jit/backend/ppc/runner.py b/rpython/jit/backend/ppc/runner.py --- a/rpython/jit/backend/ppc/runner.py +++ b/rpython/jit/backend/ppc/runner.py @@ -7,7 +7,7 @@ from rpython.jit.backend.ppc.arch import WORD from rpython.jit.backend.ppc.codebuilder import PPCBuilder from rpython.jit.backend.ppc import register as r - +from rpython.jit.backend.ppc.detect_feature import detect_vsx class PPC_CPU(AbstractLLCPU): diff --git a/rpython/jit/backend/ppc/test/test_ppcvector.py b/rpython/jit/backend/ppc/test/test_ppcvector.py --- a/rpython/jit/backend/ppc/test/test_ppcvector.py +++ b/rpython/jit/backend/ppc/test/test_ppcvector.py @@ -1,6 +1,7 @@ import py from rpython.jit.backend.ppc.test import test_basic from rpython.jit.metainterp.test import test_vector +from rpython.jit.backend.ppc.detect_feature import detect_vsx class TestBasic(test_basic.JitPPCMixin, test_vector.VectorizeTests): @@ -15,6 +16,9 @@ return cpu self.CPUClass = init +def supports_vector_ext(self): +return detect_vsx() + def test_list_vectorize(self): pass # needs support_guard_gc_type, disable for now diff --git a/rpython/jit/backend/x86/test/test_x86vector.py b/rpython/jit/backend/x86/test/test_x86vector.py --- a/rpython/jit/backend/x86/test/test_x86vector.py +++ b/rpython/jit/backend/x86/test/test_x86vector.py @@ -6,7 +6,6 @@ from rpython.jit.metainterp.test import test_vector from rpython.rtyper.lltypesystem import lltype - class TestBasic(test_basic.Jit386Mixin, test_vector.VectorizeTests): # for the individual tests see # > ../../../metainterp/test/test_basic.py @@ -19,6 +18,9 @@ return cpu self.CPUClass = init +def supports_vector_ext(self): +return self.CPUClass.vector_extension + def test_list_vectorize(self): pass # needs support_guard_gc_type, disable for now diff --git a/rpython/jit/metainterp/test/test_vector.py b/rpython/jit/metainterp/test/test_vector.py --- a/rpython/jit/metainterp/test/test_vector.py +++ b/rpython/jit/metainterp/test/test_vector.py @@ -16,8 +16,6 @@ from rpython.jit.backend.detect_cpu import getcpuclass CPU = getcpuclass() -if not CPU.vector_extension: -py.test.skip("this cpu %s has no implemented vector backend" % CPU) @specialize.argtype(0,1) def malloc(T,n): @@ -29,7 +27,8 @@ enable_opts = 'intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll' def setup_method(self, method): -print "RUNNING", method.__name__ +if not self.supports_vector_ext(): +py.test.skip("this cpu %s has no implemented vector backend" % CPU) def meta_interp(self, f, args, policy=None, vec=True, vec_all=False): return ll_meta_interp(f, args, enable_opts=self.enable_opts, ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy ppc-vsx-support: copy vector test from x86 backend.
Author: Richard PlanggerBranch: ppc-vsx-support Changeset: r85177:9d282e6b23dd Date: 2016-06-15 15:00 +0200 http://bitbucket.org/pypy/pypy/changeset/9d282e6b23dd/ Log:copy vector test from x86 backend. some simplifications in the x86 test (removed unused imports) diff --git a/rpython/jit/backend/ppc/runner.py b/rpython/jit/backend/ppc/runner.py --- a/rpython/jit/backend/ppc/runner.py +++ b/rpython/jit/backend/ppc/runner.py @@ -42,13 +42,13 @@ def setup(self): self.assembler = AssemblerPPC(self) -if detect_vsx(): -self.vector_extension = True -# ??? self.vector_horizontal_operations = True @rgc.no_release_gil def setup_once(self): self.assembler.setup_once() +if detect_vsx(): +self.vector_extension = True +# ??? self.vector_horizontal_operations = True @rgc.no_release_gil def finish_once(self): diff --git a/rpython/jit/backend/ppc/test/test_ppcvector.py b/rpython/jit/backend/ppc/test/test_ppcvector.py new file mode 100644 --- /dev/null +++ b/rpython/jit/backend/ppc/test/test_ppcvector.py @@ -0,0 +1,22 @@ +import py +from rpython.jit.backend.ppc.test import test_basic +from rpython.jit.metainterp.test import test_vector + + +class TestBasic(test_basic.JitPPCMixin, test_vector.VectorizeTests): +# for the individual tests see +# > ../../../metainterp/test/test_basic.py +def setup_method(self, method): +clazz = self.CPUClass +def init(*args, **kwargs): +cpu = clazz(*args, **kwargs) +# > 95% can be executed, thus let's cheat here a little +cpu.supports_guard_gc_type = True +return cpu +self.CPUClass = init + +def test_list_vectorize(self): +pass # needs support_guard_gc_type, disable for now + +enable_opts = 'intbounds:rewrite:virtualize:string:earlyforce:pure:heap:unroll' + diff --git a/rpython/jit/backend/x86/test/test_x86vector.py b/rpython/jit/backend/x86/test/test_x86vector.py --- a/rpython/jit/backend/x86/test/test_x86vector.py +++ b/rpython/jit/backend/x86/test/test_x86vector.py @@ -3,11 +3,7 @@ from rpython.jit.backend.x86.test import test_basic from rpython.jit.backend.x86.test.test_assembler import \ (TestRegallocPushPop as BaseTestAssembler) -from rpython.jit.backend.detect_cpu import getcpuclass -from rpython.jit.metainterp.history import ConstFloat -from rpython.jit.metainterp.test import support, test_vector -from rpython.jit.metainterp.warmspot import ll_meta_interp -from rpython.rlib.jit import JitDriver +from rpython.jit.metainterp.test import test_vector from rpython.rtyper.lltypesystem import lltype ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy ppc-vsx-support: detect altivec at runtime on linux
Author: Richard PlanggerBranch: ppc-vsx-support Changeset: r85176:ebfa9b3a75d6 Date: 2016-06-15 14:48 +0200 http://bitbucket.org/pypy/pypy/changeset/ebfa9b3a75d6/ Log:detect altivec at runtime on linux diff --git a/rpython/jit/backend/ppc/detect_feature.py b/rpython/jit/backend/ppc/detect_feature.py new file mode 100644 --- /dev/null +++ b/rpython/jit/backend/ppc/detect_feature.py @@ -0,0 +1,37 @@ +import sys +import struct +import platform +from rpython.rtyper.lltypesystem import lltype, rffi +from rpython.rtyper.tool import rffi_platform +from rpython.rlib.rmmap import alloc, free +from rpython.rlib.rstruct.runpack import runpack + +AT_HWCAP = rffi_platform.getconstantinteger('AT_HWCAP', '#include "linux/auxvec.h"') +AT_NULL = rffi_platform.getconstantinteger('AT_NULL', '#include "linux/auxvec.h"') +PPC_FEATURE_HAS_ALTIVEC = rffi_platform.getconstantinteger('PPC_FEATURE_HAS_ALTIVEC', + '#include "asm/cputable.h"') +SYSTEM = platform.system() + +def detect_vsx_linux(): +with open('/proc/self/auxv', 'rb') as fd: +while True: +buf = fd.read(16) +if not buf: +break +key, value = runpack("LL", buf) +if key == AT_HWCAP: +if value & PPC_FEATURE_HAS_ALTIVEC: +return True +if key == AT_NULL: +return False +return False + +def detect_vsx(): +if SYSTEM == 'Linux': +return detect_vsx_linux() +return False + +if __name__ == '__main__': +print 'The following extensions are supported:' +if detect_vsx(): +print ' - AltiVec' diff --git a/rpython/jit/backend/ppc/runner.py b/rpython/jit/backend/ppc/runner.py --- a/rpython/jit/backend/ppc/runner.py +++ b/rpython/jit/backend/ppc/runner.py @@ -11,6 +11,10 @@ class PPC_CPU(AbstractLLCPU): +vector_extension = False # may be set to true in setup +vector_register_size = 16 +vector_horizontal_operations = False + supports_floats = True # missing: supports_singlefloats @@ -38,6 +42,9 @@ def setup(self): self.assembler = AssemblerPPC(self) +if detect_vsx(): +self.vector_extension = True +# ??? self.vector_horizontal_operations = True @rgc.no_release_gil def setup_once(self): ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy.org extradoc: update the values
Author: Armin RigoBranch: extradoc Changeset: r758:69f7b34a0213 Date: 2016-06-15 13:47 +0200 http://bitbucket.org/pypy/pypy.org/changeset/69f7b34a0213/ Log:update the values diff --git a/don1.html b/don1.html --- a/don1.html +++ b/don1.html @@ -9,13 +9,13 @@ $(function() { $("#progressbar").progressbar({ - value: 61.1 + value: 61.5 }); }); - $64178 of $105000 (61.1%) + $64596 of $105000 (61.5%) @@ -23,7 +23,7 @@ This donation goes towards supporting Python 3 in PyPy. Current status: -we have $9219 left +we have $9600 left in the account. Read proposal diff --git a/don4.html b/don4.html --- a/don4.html +++ b/don4.html @@ -17,7 +17,7 @@ 2nd call: - $30732 of $8 (38.4%) + $30744 of $8 (38.4%) @@ -25,7 +25,7 @@ This donation goes towards supporting the Transactional Memory in PyPy. Current status: -we have $23407 left +we have $23417 left in the account. Read proposal (2nd call) ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy.org extradoc: - Fix link for linux32
Author: Armin RigoBranch: extradoc Changeset: r757:4bea80355a18 Date: 2016-06-15 13:42 +0200 http://bitbucket.org/pypy/pypy.org/changeset/4bea80355a18/ Log:- Fix link for linux32 - Fix Ubuntu version for pypy3 on linux32 diff --git a/source/download.txt b/source/download.txt --- a/source/download.txt +++ b/source/download.txt @@ -92,7 +92,7 @@ * `All our downloads,`__ including previous versions. We also have a mirror_, but please use only if you have troubles accessing the links above -.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.3.0-linux.tar.bz2 +.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.3.0-linux32.tar.bz2 .. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.3.0-linux64.tar.bz2 .. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.3.0-linux-armhf-raspbian.tar.bz2 .. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.3.0-linux-armhf-raring.tar.bz2 @@ -116,7 +116,7 @@ Warning: this is an alpha release supporting the Python 3.3 language. It's also known to be (sometimes much) slower than PyPy 2. -* `Linux x86 binary (32bit, tar.bz2 built on Ubuntu 10.04.4 LTS)`__ (see ``[1]`` below) +* `Linux x86 binary (32bit, tar.bz2 built on Ubuntu 12.04 - 14.04)`__ (see ``[1]`` below) * `Linux x86-64 binary (64bit, tar.bz2 built on Ubuntu 12.04 - 14.04)`__ (see ``[1]`` below) * `ARM Hardfloat Linux binary (ARMHF/gnueabihf, tar.bz2, Raspbian)`__ (see ``[1]`` below) * `ARM Hardfloat Linux binary (ARMHF/gnueabihf, tar.bz2, Ubuntu Raring)`__ (see ``[1]`` below) ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit
[pypy-commit] pypy default: Missing decref in error case
Author: Armin RigoBranch: Changeset: r85175:5ea0348fcbee Date: 2016-06-15 10:15 +0200 http://bitbucket.org/pypy/pypy/changeset/5ea0348fcbee/ Log:Missing decref in error case diff --git a/pypy/module/cpyext/tupleobject.py b/pypy/module/cpyext/tupleobject.py --- a/pypy/module/cpyext/tupleobject.py +++ b/pypy/module/cpyext/tupleobject.py @@ -142,6 +142,7 @@ ref = rffi.cast(PyTupleObject, ref) size = ref.c_ob_size if index < 0 or index >= size: +decref(space, py_obj) raise oefmt(space.w_IndexError, "tuple assignment index out of range") old_ref = ref.c_ob_item[index] ref.c_ob_item[index] = py_obj# consumes a reference ___ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit