[pypy-svn] r76493 - pypy/trunk/pypy/jit/backend/x86
jcreigh at codespeak.net
jcreigh at codespeak.net
Thu Aug 5 22:25:20 CEST 2010
Author: jcreigh
Date: Thu Aug 5 22:25:18 2010
New Revision: 76493
Modified:
pypy/trunk/pypy/jit/backend/x86/assembler.py
pypy/trunk/pypy/jit/backend/x86/regalloc.py
pypy/trunk/pypy/jit/backend/x86/regloc.py
Log:
revert r76491 (grr, doesn't translate)
Modified: pypy/trunk/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/x86/assembler.py (original)
+++ pypy/trunk/pypy/jit/backend/x86/assembler.py Thu Aug 5 22:25:18 2010
@@ -819,8 +819,10 @@
for i in range(start, len(arglocs)):
loc = arglocs[i]
+ assert isinstance(loc, RegLoc) or isinstance(loc, ImmedLoc) or isinstance(loc, StackLoc)
+
# XXX: Should be much simplier to tell whether a location is a float!
- if (isinstance(loc, RegLoc) and loc.is_xmm) or (loc.is_memory_reference() and loc.type == FLOAT):
+ if (isinstance(loc, RegLoc) and loc.is_xmm) or (isinstance(loc, StackLoc) and loc.type == FLOAT):
if len(unused_xmm) > 0:
xmm_src_locs.append(loc)
xmm_dst_locs.append(unused_xmm.pop())
Modified: pypy/trunk/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/x86/regalloc.py (original)
+++ pypy/trunk/pypy/jit/backend/x86/regalloc.py Thu Aug 5 22:25:18 2010
@@ -53,7 +53,6 @@
def __init__(self):
self.cur_array_free = 0
- self.const_id = 0
def _get_new_array(self):
n = self.BASE_CONSTANT_SIZE
@@ -69,8 +68,7 @@
n = self.cur_array_free - 1
arr[n] = floatval
self.cur_array_free = n
- self.const_id += 1
- return (self.const_id, rffi.cast(lltype.Signed, arr) + n * 8)
+ return rffi.cast(lltype.Signed, arr) + n * 8
class X86XMMRegisterManager(RegisterManager):
@@ -91,8 +89,8 @@
self.float_constants = assembler._float_constants
def convert_to_imm(self, c):
- const_id, adr = self.float_constants.record_float(c.getfloat())
- return ConstFloatLoc(adr, const_id)
+ adr = self.float_constants.record_float(c.getfloat())
+ return AddressLoc(ImmedLoc(adr), ImmedLoc(0), 0, 0)
def after_call(self, v):
# the result is stored in st0, but we don't have this around,
Modified: pypy/trunk/pypy/jit/backend/x86/regloc.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/x86/regloc.py (original)
+++ pypy/trunk/pypy/jit/backend/x86/regloc.py Thu Aug 5 22:25:18 2010
@@ -5,7 +5,6 @@
from pypy.tool.sourcetools import func_with_new_name
from pypy.rlib.objectmodel import specialize
from pypy.rlib.rarithmetic import intmask
-from pypy.jit.metainterp.history import FLOAT
#
# This module adds support for "locations", which can be either in a Const,
@@ -146,28 +145,6 @@
def value_m(self):
return self.loc_m
-class ConstFloatLoc(AssemblerLocation):
- # XXX: We have to use this class instead of just AddressLoc because
- # AddressLoc is "untyped" and also we to have need some sort of unique
- # identifier that we can use in _getregkey (for jump.py)
-
- _immutable_ = True
-
- width = 8
- type = FLOAT
-
- def __init__(self, address, const_id):
- self.value = address
- self.const_id = const_id
-
- def _getregkey(self):
- # XXX: 1000 is kind of magic: We just don't want to be confused
- # with any registers
- return 1000 + self.const_id
-
- def location_code(self):
- return 'j'
-
REGLOCS = [RegLoc(i, is_xmm=False) for i in range(16)]
XMMREGLOCS = [RegLoc(i, is_xmm=True) for i in range(16)]
eax, ecx, edx, ebx, esp, ebp, esi, edi, r8, r9, r10, r11, r12, r13, r14, r15 = REGLOCS
More information about the Pypy-commit
mailing list