To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit a920e0b6 authored by John Zhang's avatar John Zhang
Browse files

Merge branch 'mu-benchmarks' into apicodegen

parents 54ae4170 016b3cd1
#!/bin/bash
PYTHONPATH=$MU/pythonbinding LD_LIBRARY_PATH=$MU/cbinding:$LD_LIBRARYPATH python $PYPY_MU/rpython/mucli/murpy.py --noSourceInfo --vmLog=ERROR --sosSize=780M --losSize=780M $PYPY_MU/pypy/bin/pypy-mu.mu -- "$@"
...@@ -828,6 +828,9 @@ def make_array(mytype): ...@@ -828,6 +828,9 @@ def make_array(mytype):
return rffi.cast(lltype.Unsigned, self.buffer) return rffi.cast(lltype.Unsigned, self.buffer)
def _charbuf_stop(self): def _charbuf_stop(self):
from rpython.rlib.objectmodel import fetch_translated_config
if fetch_translated_config().translation.backend == "mu":
return # In mu backend, keepalive -> unpin. Here 'self' is not pinned. This will be an error.
keepalive_until_here(self) keepalive_until_here(self)
def w_getitem(self, space, idx): def w_getitem(self, space, idx):
......
...@@ -1086,7 +1086,10 @@ def _llop2mu_direct_arrayitems(ptr, res=None, llopname='direct_arrayitems'): ...@@ -1086,7 +1086,10 @@ def _llop2mu_direct_arrayitems(ptr, res=None, llopname='direct_arrayitems'):
# ---------------- # ----------------
# address operations # address operations
def _llop2mu_keepalive(ptr, res=None, llopname='keepalive'): def _llop2mu_keepalive(ptr, res=None, llopname='keepalive'):
return [muops.NATIVE_UNPIN(ptr, result=res)] if isinstance(ptr.mu_type, mutype.MuRef):
return [muops.NATIVE_UNPIN(ptr, result=res)]
else:
return [], res
from rpython.rlib.rposix import eci from rpython.rlib.rposix import eci
......
...@@ -9,7 +9,7 @@ RPYC_DIR = ../../c ...@@ -9,7 +9,7 @@ RPYC_DIR = ../../c
RPYC_SRC_DIR = $(RPYC_DIR)/src RPYC_SRC_DIR = $(RPYC_DIR)/src
PYPY_MOD_DIR = ../../../../pypy/module PYPY_MOD_DIR = ../../../../pypy/module
CC = cc CC = cc
OBJS = dtoa.o utils.o errno.o tscmp.o linux_debug.o fakestack.o OBJS = dtoa.o utils.o errno.o tscmp.o linux_debug.o fakestack.o bitcastfloat.o
FLAGS = -D__MU__ FLAGS = -D__MU__
dtoa.o: $(RPYC_SRC_DIR)/dtoa.c $(RPYC_SRC_DIR)/dtoa.h dtoa.o: $(RPYC_SRC_DIR)/dtoa.c $(RPYC_SRC_DIR)/dtoa.h
...@@ -30,6 +30,9 @@ linux_debug.o: src/linux_debug.c ...@@ -30,6 +30,9 @@ linux_debug.o: src/linux_debug.c
fakestack.o: src/fakestack.c fakestack.o: src/fakestack.c
$(CC) -fPIC $(FLAGS) -c -o $@ $< $(CC) -fPIC $(FLAGS) -c -o $@ $<
bitcastfloat.o: src/bitcastfloat.c
$(CC) -fPIC $(FLAGS) -c -o $@ $<
librpyc.so: $(OBJS) librpyc.so: $(OBJS)
$(CC) -shared -o $@ $(OBJS) $(CC) -shared -o $@ $(OBJS)
rm $(OBJS) rm $(OBJS)
......
#include <string.h>
#include <assert.h>
float pypy__uint2singlefloat(unsigned int x) {
float ff;
assert(sizeof(float) == 4 && sizeof(unsigned int) == 4);
memcpy(&ff, &x, 4);
return ff;
}
unsigned int pypy__singlefloat2uint(float x) {
unsigned int ii;
assert(sizeof(float) == 4 && sizeof(unsigned int) == 4);
memcpy(&ii, &x, 4);
return ii;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment