Commits

Anonymous committed 450839e

Add PPC64 instructions to gen_emit_cmp_op

  • Participants
  • Parent commits 87920fe
  • Branches ppc-jit-backend

Comments (0)

Files changed (1)

pypy/jit/backend/ppc/ppcgen/helper/assembler.py

 import pypy.jit.backend.ppc.ppcgen.condition as c
 from pypy.rlib.rarithmetic import r_uint, r_longlong, intmask
-from pypy.jit.backend.ppc.ppcgen.arch import MAX_REG_PARAMS
+from pypy.jit.backend.ppc.ppcgen.arch import MAX_REG_PARAMS, IS_PPC_32
 from pypy.jit.metainterp.history import FLOAT
 
 def gen_emit_cmp_op(condition, signed=True):
         # do the comparison
         if signed:
             if l1.is_imm():
-                self.mc.cmpwi(0, l0.value, l1.value)
+                if IS_PPC_32:
+                    self.mc.cmpwi(0, l0.value, l1.value)
+                else:
+                    self.mc.cmpdi(0, l0.value, l1.value)
             else:
-                self.mc.cmpw(0, l0.value, l1.value)
+                if IS_PPC_32:
+                    self.mc.cmpw(0, l0.value, l1.value)
+                else:
+                    self.mc.cmpd(0, l0.value, l1.value)
 
             # After the comparison, place the result
             # in the first bit of the CR
 
         else:
             if l1.is_imm():
-                self.mc.cmpli(0, l0.value, l1.value)
+                if IS_PPC_32:
+                    self.mc.cmplwi(0, l0.value, l1.value)
+                else:
+                    self.mc.cmpldi(0, l0.value, l1.value)
             else:
-                self.mc.cmpl(0, l0.value, l1.value)
+                if IS_PPC_32:
+                    self.mc.cmplw(0, l0.value, l1.value)
+                else:
+                    self.mc.cmpld(0, l0.value, l1.value)
 
             if condition == c.U_LT:
                 self.mc.cror(0, 0, 0)