[pypy-commit] pypy s390x-backend: floating point comparison operations
plan_rich
noreply at buildbot.pypy.org
Thu Oct 22 10:42:57 EDT 2015
Author: Richard Plangger <planrichi at gmail.com>
Branch: s390x-backend
Changeset: r80397:6f08bc334a9b
Date: 2015-10-22 16:15 +0200
http://bitbucket.org/pypy/pypy/changeset/6f08bc334a9b/
Log: floating point comparison operations
diff --git a/rpython/jit/backend/zarch/instructions.py b/rpython/jit/backend/zarch/instructions.py
--- a/rpython/jit/backend/zarch/instructions.py
+++ b/rpython/jit/backend/zarch/instructions.py
@@ -146,6 +146,11 @@
'DIEBR': ('rrf', ['\xB3','\x53'], 'r,r,r,m'),
'DIDBR': ('rrf', ['\xB3','\x5B'], 'r,r,r,m'),
+ # COMPARISON
+ 'CEBR': ('rre', ['\xB3','\x09']),
+ 'CDBR': ('rre', ['\xB3','\x19']),
+ 'CEB': ('rxe', ['\xED','\x09'], 'r,bidl,-'),
+ 'CDB': ('rxe', ['\xED','\x19'], 'r,bidl,-'),
}
all_mnemonic_codes = {
diff --git a/rpython/jit/backend/zarch/test/test_assembler.py b/rpython/jit/backend/zarch/test/test_assembler.py
--- a/rpython/jit/backend/zarch/test/test_assembler.py
+++ b/rpython/jit/backend/zarch/test/test_assembler.py
@@ -351,3 +351,16 @@
run_asm(self.a)
assert isclose(mem[0], 12345.0)
+ def test_float_cmp(self):
+ with ActivationRecordCtx(self):
+ with LiteralPoolCtx(self) as pool:
+ pool.float(1.0)
+ pool.float(2.0)
+ self.mc.LD(reg.f0, loc.addr(0, reg.r13))
+ self.mc.LD(reg.f1, loc.addr(8, reg.r13))
+ self.mc.CDBR(reg.f0, reg.f1)
+ self.mc.LGHI(reg.r2, loc.imm(0))
+ self.mc.BCR(con.EQ, reg.r14) # must not branch
+ self.mc.LGHI(reg.r2, loc.imm(1))
+ self.a.jmpto(reg.r14)
+ assert run_asm(self.a) == 1
More information about the pypy-commit
mailing list