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

Unified Diff: src/mips64/macro-assembler-mips64.cc

Issue 2477453005: MIPS[64]: Optimize kMips[64]Tst in code-generator-mips[64].cc (Closed)
Patch Set: Address code review remarks Created 4 years, 1 month 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/mips64/macro-assembler-mips64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/macro-assembler-mips64.cc
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc
index d1d84ba40870f813dcb62ddb887b462c9263dd07..a3ab4a8840913fa973c23303a0646141ac80cbaa 100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -1758,11 +1758,27 @@ void MacroAssembler::Ext(Register rt,
ext_(rt, rs, pos, size);
}
+void MacroAssembler::ExtractBits(Register rt, Register rs, uint16_t pos,
+ uint16_t size) {
+ DCHECK(pos < 64);
+ DCHECK(size > 0 && size <= 64);
+ DCHECK(pos + size <= 64);
+ if (pos < 32) {
+ if (size <= 32) {
+ Dext(rt, rs, pos, size);
+ } else {
+ Dextm(rt, rs, pos, size);
+ }
+ } else if (pos < 64) {
miran.karic 2016/11/10 16:31:56 This if after else and DCHECK line below are redun
ivica.bogosavljevic 2016/11/15 09:14:06 This is true, but I would like to leave this as it
+ DCHECK(size <= 32);
+ Dextu(rt, rs, pos, size);
+ }
+}
void MacroAssembler::Dext(Register rt, Register rs, uint16_t pos,
uint16_t size) {
DCHECK(pos < 32);
- DCHECK(pos + size < 33);
+ DCHECK(size > 0 && size <= 32);
dext_(rt, rs, pos, size);
}
@@ -1770,7 +1786,8 @@ void MacroAssembler::Dext(Register rt, Register rs, uint16_t pos,
void MacroAssembler::Dextm(Register rt, Register rs, uint16_t pos,
uint16_t size) {
DCHECK(pos < 32);
- DCHECK(size <= 64);
+ DCHECK(size > 32 && size <= 64);
+ DCHECK((pos + size) > 32 && (pos + size) <= 64);
dextm(rt, rs, pos, size);
}
@@ -1778,7 +1795,8 @@ void MacroAssembler::Dextm(Register rt, Register rs, uint16_t pos,
void MacroAssembler::Dextu(Register rt, Register rs, uint16_t pos,
uint16_t size) {
DCHECK(pos >= 32 && pos < 64);
- DCHECK(size < 33);
+ DCHECK(size > 0 && size <= 32);
+ DCHECK((pos + size) > 32 && (pos + size) <= 64);
dextu(rt, rs, pos, size);
}
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698