Fixing branch CTR compare. Maybe.

This commit is contained in:
Ben Vanik 2014-01-12 17:19:37 -08:00
parent d224dd94c1
commit 4cbee4620a
1 changed files with 2 additions and 0 deletions

View File

@ -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)) {