Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: src/ppc/assembler-ppc.h

Issue 1259723002: PPC: Support for conditional return instruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ppc/assembler-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | src/ppc/assembler-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698