[pypy-svn] r75016 - in pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86: . test
jcreigh at codespeak.net
jcreigh at codespeak.net
Tue Jun 1 23:40:46 CEST 2010
Author: jcreigh
Date: Tue Jun 1 23:40:45 2010
New Revision: 75016
Modified:
pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/rx86.py
pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/test/test_rx86_32_auto_encoding.py
pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/test/test_rx86_64_auto_encoding.py
Log:
clean up how instructions which must be manually tested are skipped in test_rx86_(32|64)_auto_encoding.py
Modified: pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/rx86.py
==============================================================================
--- pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/rx86.py (original)
+++ pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/rx86.py Tue Jun 1 23:40:45 2010
@@ -655,39 +655,6 @@
AbstractX86CodeBuilder.MOV_ri(self, R.eax, target)
AbstractX86CodeBuilder.CALL_r(self, R.eax)
- # unsupported -- must use e.g. MOV tmpreg, immed64; MOV reg, [tmpreg]
- def MOV_rj(self, reg, mem_immed):
- py.test.skip("MOV_rj unsupported")
- def MOV_jr(self, mem_immed, reg):
- py.test.skip("MOV_jr unsupported")
- def MOV_ji(self, mem_immed, immed):
- py.test.skip("MOV_ji unsupported")
- def XCHG_rj(self, reg, mem_immed):
- py.test.skip("XCGH_rj unsupported")
- def CMP_ji(self, addr, immed):
- py.test.skip("CMP_ji unsupported")
- def CMP_rj(self, reg, immed):
- py.test.skip("CMP_rj unsupported")
- def MOVSD_xj(self, xmm_reg, mem_immed):
- py.test.skip("MOVSD_rj unsupported")
- def MOVSD_jx(self, xmm_reg, mem_immed):
- py.test.skip("MOVSD_jr unsupported")
- def ADDSD_xj(self, xmm_reg, mem_immed):
- py.test.skip("ADDSD_rj unsupported")
- def SUBSD_xj(self, xmm_reg, mem_immed):
- py.test.skip("SUBSD_rj unsupported")
- def MULSD_xj(self, xmm_reg, mem_immed):
- py.test.skip("MULSD_rj unsupported")
- def DIVSD_xj(self, xmm_reg, mem_immed):
- py.test.skip("DIVSD_rj unsupported")
- def UCOMISD_xj(self, xmm_reg, mem_immed):
- py.test.skip("UCOMISD_rj unsupported")
- def ANDPD_xj(self, xmm_reg, mem_immed):
- py.test.skip("ANDPD_rj unsupported")
- def XORPD_xj(self, xmm_reg, mem_immed):
- py.test.skip("XORPD_rj unsupported")
-
-
# ____________________________________________________________
all_instructions = [name for name in AbstractX86CodeBuilder.__dict__
Modified: pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/test/test_rx86_32_auto_encoding.py
==============================================================================
--- pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/test/test_rx86_32_auto_encoding.py (original)
+++ pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/test/test_rx86_32_auto_encoding.py Tue Jun 1 23:40:45 2010
@@ -230,16 +230,6 @@
return [] # MOV EAX, [immediate]: there is a special encoding
if methname == 'MOV_jr' and args[1] == rx86.R.eax:
return [] # MOV [immediate], EAX: there is a special encoding
- if methname == 'SET_ir':
- py.test.skip("SET_ir: must be tested manually")
- if methname.startswith('SHL') or methname.startswith('SAR') or methname.startswith('SHR'):
- # XXX: Would be nice to test these automatically
- py.test.skip('Shifts must be tested manually')
- if methname == 'FSTP_b':
- # Doesn't work on 64-bit, skipping for now
- py.test.skip('Skipping FSTP')
- if methname == 'CALL_j':
- py.test.skip("CALL_j is actually relative")
return [args]
@@ -248,13 +238,28 @@
pass
return X86_CodeBuilder
+ def should_skip_instruction(self, instrname, argmodes):
+ is_artificial_instruction = instrname[-1].isdigit() or (argmodes != '' and argmodes[-1].isdigit())
+ return (
+ is_artificial_instruction or
+ # XXX: Can't tests shifts automatically at the moment
+ (instrname[:3] in ('SHL', 'SAR', 'SHR')) or
+ # CALL_j is actually relative, so tricky to test
+ (instrname == 'CALL' and argmodes == 'j') or
+ # SET_ir must be tested manually
+ (instrname == 'SET' and argmodes == 'ir')
+ )
+
+
+
def complete_test(self, methname):
if '_' in methname:
instrname, argmodes = methname.split('_')
else:
instrname, argmodes = methname, ''
- if instrname[-1].isdigit() or (argmodes != '' and argmodes[-1].isdigit()):
- print "artificial instruction: %r" % (methname,)
+
+ if self.should_skip_instruction(instrname, argmodes):
+ print "Skipping %s" % methname
return
print "Testing %s with argmodes=%r" % (instrname, argmodes)
Modified: pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/test/test_rx86_64_auto_encoding.py
==============================================================================
--- pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/test/test_rx86_64_auto_encoding.py (original)
+++ pypy/branch/x86-64-jit-backend/pypy/jit/backend/x86/test/test_rx86_64_auto_encoding.py Tue Jun 1 23:40:45 2010
@@ -15,6 +15,14 @@
rx86.R.r8, rx86.R.r9, rx86.R.r10, rx86.R.r11,
rx86.R.r12, rx86.R.r13, rx86.R.r14, rx86.R.r15]
+ def should_skip_instruction(self, instrname, argmodes):
+ return (
+ super(TestRx86_64, self).should_skip_instruction(instrname, argmodes) or
+ ('j' in argmodes) or
+ # Not testing FSTP on 64-bit for now
+ (instrname == 'FSTP')
+ )
+
def array_tests(self):
# reduce a little bit -- we spend too long in these tests
lst = super(TestRx86_64, self).array_tests()
More information about the Pypy-commit
mailing list