[pypy-svn] r79693 - pypy/branch/jit-free-asm2/pypy/jit/backend/x86
arigo at codespeak.net
arigo at codespeak.net
Tue Nov 30 17:58:21 CET 2010
Author: arigo
Date: Tue Nov 30 17:58:19 2010
New Revision: 79693
Modified:
pypy/branch/jit-free-asm2/pypy/jit/backend/x86/assembler.py
Log:
Now we really win: use MachineDataBlockWrapper to replace the hacks done
at start-up to allocate the float constants with a 16-bytes alignment.
Modified: pypy/branch/jit-free-asm2/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/jit-free-asm2/pypy/jit/backend/x86/assembler.py (original)
+++ pypy/branch/jit-free-asm2/pypy/jit/backend/x86/assembler.py Tue Nov 30 17:58:19 2010
@@ -151,13 +151,9 @@
debug_stop('jit-backend-counts')
def _build_float_constants(self):
- # 44 bytes: 32 bytes for the data, and up to 12 bytes for alignment
- addr = lltype.malloc(rffi.CArray(lltype.Char), 44, flavor='raw',
- track_allocation=False)
- if not we_are_translated():
- self._keepalive_malloced_float_consts = addr
- float_constants = rffi.cast(lltype.Signed, addr)
- float_constants = (float_constants + 15) & ~15 # align to 16 bytes
+ datablockwrapper = MachineDataBlockWrapper(self.cpu.asmmemmgr, [])
+ float_constants = datablockwrapper.malloc_aligned(32, alignment=16)
+ datablockwrapper.done()
addr = rffi.cast(rffi.CArrayPtr(lltype.Char), float_constants)
qword_padding = '\x00\x00\x00\x00\x00\x00\x00\x00'
# 0x8000000000000000
More information about the Pypy-commit
mailing list