Index: src/ppc/assembler-ppc.h |
diff --git a/src/ppc/assembler-ppc.h b/src/ppc/assembler-ppc.h |
index 3e3931a0a9520572898ded4e9d3cd4bdc3e96940..a1c08ad0ea34a7c8336e6139b8df3f317a64b134 100644 |
--- a/src/ppc/assembler-ppc.h |
+++ b/src/ppc/assembler-ppc.h |
@@ -726,12 +726,12 @@ class Assembler : public AssemblerBase { |
void CodeTargetAlign(); |
// Branch instructions |
- void bclr(BOfield bo, LKBit lk); |
+ void bclr(BOfield bo, int condition_bit, LKBit lk); |
void blr(); |
void bc(int branch_offset, BOfield bo, int condition_bit, LKBit lk = LeaveLK); |
void b(int branch_offset, LKBit lk); |
- void bcctr(BOfield bo, LKBit lk); |
+ void bcctr(BOfield bo, int condition_bit, LKBit lk); |
void bctr(); |
void bctrl(); |
@@ -819,6 +819,48 @@ class Assembler : public AssemblerBase { |
} |
} |
+ void bclr(Condition cond, CRegister cr = cr7, LKBit lk = LeaveLK) { |
+ DCHECK(cond != al); |
+ DCHECK(cr.code() >= 0 && cr.code() <= 7); |
+ |
+ cr = cmpi_optimization(cr); |
+ |
+ switch (cond) { |
+ case eq: |
+ bclr(BT, encode_crbit(cr, CR_EQ), lk); |
+ break; |
+ case ne: |
+ bclr(BF, encode_crbit(cr, CR_EQ), lk); |
+ break; |
+ case gt: |
+ bclr(BT, encode_crbit(cr, CR_GT), lk); |
+ break; |
+ case le: |
+ bclr(BF, encode_crbit(cr, CR_GT), lk); |
+ break; |
+ case lt: |
+ bclr(BT, encode_crbit(cr, CR_LT), lk); |
+ break; |
+ case ge: |
+ bclr(BF, encode_crbit(cr, CR_LT), lk); |
+ break; |
+ case unordered: |
+ bclr(BT, encode_crbit(cr, CR_FU), lk); |
+ break; |
+ case ordered: |
+ bclr(BF, encode_crbit(cr, CR_FU), lk); |
+ break; |
+ case overflow: |
+ bclr(BT, encode_crbit(cr, CR_SO), lk); |
+ break; |
+ case nooverflow: |
+ bclr(BF, encode_crbit(cr, CR_SO), lk); |
+ break; |
+ default: |
+ UNIMPLEMENTED(); |
+ } |
+ } |
+ |
void isel(Register rt, Register ra, Register rb, int cb); |
void isel(Condition cond, Register rt, Register ra, Register rb, |
CRegister cr = cr7) { |