Author: Richard Plangger <[email protected]>
Branch: s390x-backend
Changeset: r80238:96207b27efbe
Date: 2015-10-15 15:13 +0200
http://bitbucket.org/pypy/pypy/changeset/96207b27efbe/
Log: SIY extended 20 bit base displacement encoding
diff --git a/rpython/jit/backend/zarch/codebuilder.py
b/rpython/jit/backend/zarch/codebuilder.py
--- a/rpython/jit/backend/zarch/codebuilder.py
+++ b/rpython/jit/backend/zarch/codebuilder.py
@@ -96,6 +96,16 @@
encode_base_displace(self, base_displace)
return encode_si
+def build_siy(mnemonic, (opcode1,opcode2)):
+ def encode_siy(self, base_displace, uimm8):
+ self.writechar(opcode1)
+ self.writechar(chr(uimm8))
+ encode_base_displace(self, base_displace)
+ displace = base_displace.displace
+ self.writechar(chr(displace >> 12 & 0xff))
+ self.writechar(opcode2)
+ return encode_siy
+
_mnemonic_codes = {
'AR': (build_rr, ['\x1A']),
'AGR': (build_rre, ['\xB9\x08']),
@@ -106,6 +116,7 @@
'AGF': (build_rxy, ['\xE3','\x18']),
'AHI': (build_ri, ['\xA7','\x0A']),
'NI': (build_si, ['\x94']),
+ 'NIY': (build_siy, ['\xEB','\x54']),
}
def build_instr_codes(clazz):
diff --git a/rpython/jit/backend/zarch/test/test_auto_encoding.py
b/rpython/jit/backend/zarch/test/test_auto_encoding.py
--- a/rpython/jit/backend/zarch/test/test_auto_encoding.py
+++ b/rpython/jit/backend/zarch/test/test_auto_encoding.py
@@ -109,6 +109,7 @@
accept_unnecessary_prefix = None
methname = '?'
BASE_DISPLACE = build_base_disp(8,12)
+ BASE_DISPLACE_LONG = build_base_disp(8,20)
INDEX_BASE_DISPLACE = build_idx_base_disp(8,8,12)
INDEX_BASE_DISPLACE_LONG = build_idx_base_disp(8,8,20)
@@ -247,10 +248,6 @@
return oplist, as_code
def modes(self, mode):
- if mode == "rxy":
- return "ry"
- if mode == "rre":
- return "rr"
return mode
def make_all_tests(self, methname, modes, args=[]):
@@ -261,11 +258,19 @@
'i': lambda i: self.imm_tests(methname, modes, i),
's': lambda i: self.BASE_DISPLACE,
}
- combinations = []
- for i,m in enumerate(modes):
- elems = tests[m](i)
- random.shuffle(elems)
- combinations.append(elems)
+ tests_all = {
+ 'rxy': (tests['r'], tests['y']),
+ 'siy': (lambda i: self.BASE_DISPLACE_LONG, tests['i']),
+ 'rre': (tests['r'], tests['r'])
+ }
+ if modes in tests_all:
+ combinations = [f(i) for i,f in enumerate(tests_all[modes])]
+ else:
+ combinations = []
+ for i,m in enumerate(modes):
+ elems = tests[m](i)
+ random.shuffle(elems)
+ combinations.append(elems)
results = []
for args in itertools.product(*combinations):
results.append(args)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit