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

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

Issue 1222133004: PPC: perf enhancement: omit redundant compare with 0 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « src/ppc/assembler-ppc.h ('k') | src/ppc/constants-ppc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/assembler-ppc.cc
diff --git a/src/ppc/assembler-ppc.cc b/src/ppc/assembler-ppc.cc
index 571a9fc8a2f75e6adb7adc189f5abf5583c597f7..b74a9f17cbe9ac9098c76ba3f1d3cf53a85878fd 100644
--- a/src/ppc/assembler-ppc.cc
+++ b/src/ppc/assembler-ppc.cc
@@ -219,6 +219,7 @@ Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size)
kMaxBlockTrampolineSectionSize;
internal_trampoline_exception_ = false;
last_bound_pos_ = 0;
+ optimizable_cmpi_pos_ = -1;
trampoline_emitted_ = FLAG_force_long_branches;
unbound_labels_count_ = 0;
ClearRecordedAstId();
@@ -1030,9 +1031,17 @@ void Assembler::cmpl(Register src1, Register src2, CRegister cr) {
void Assembler::cmpwi(Register src1, const Operand& src2, CRegister cr) {
intptr_t imm16 = src2.imm_;
int L = 0;
+ int pos = pc_offset();
DCHECK(is_int16(imm16));
DCHECK(cr.code() >= 0 && cr.code() <= 7);
imm16 &= kImm16Mask;
+
+ // For cmpwi against 0, save postition and cr for later examination
+ // of potential optimization.
+ if (imm16 == 0 && pos > 0 && last_bound_pos_ != pos) {
+ optimizable_cmpi_pos_ = pos;
+ cmpi_cr_ = cr;
+ }
emit(CMPI | cr.code() * B23 | L * B21 | src1.code() * B16 | imm16);
}
« no previous file with comments | « src/ppc/assembler-ppc.h ('k') | src/ppc/constants-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698