From 4cbee4620ab9f0a01b34d8da19e2786389f730a1 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 12 Jan 2014 17:19:37 -0800 Subject: [PATCH] Fixing branch CTR compare. Maybe. --- src/alloy/frontend/ppc/ppc_emit_control.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/alloy/frontend/ppc/ppc_emit_control.cc b/src/alloy/frontend/ppc/ppc_emit_control.cc index cfc314608..eb2205baa 100644 --- a/src/alloy/frontend/ppc/ppc_emit_control.cc +++ b/src/alloy/frontend/ppc/ppc_emit_control.cc @@ -138,6 +138,7 @@ XEEMITTER(bcx, 0x40000000, B )(PPCHIRBuilder& f, InstrData& i) { ctr = f.Sub(ctr, f.LoadConstant((int64_t)1)); f.StoreCTR(ctr); // Ctr check. + ctr = f.Truncate(ctr, INT32_TYPE); // TODO(benvanik): could do something similar to cond and avoid the // is_true/branch_true pairing. if (XESELECTBITS(i.B.BO, 1, 1)) { @@ -243,6 +244,7 @@ XEEMITTER(bclrx, 0x4C000020, XL )(PPCHIRBuilder& f, InstrData& i) { ctr = f.Sub(ctr, f.LoadConstant((int64_t)1)); f.StoreCTR(ctr); // Ctr check. + ctr = f.Truncate(ctr, INT32_TYPE); // TODO(benvanik): could do something similar to cond and avoid the // is_true/branch_true pairing. if (XESELECTBITS(i.XL.BO, 1, 1)) {