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

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

Issue 2386673002: MIPS: Fix Sltu macro instruction. (Closed)
Patch Set: Fix nits. Created 4 years, 3 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/mips/macro-assembler-mips.cc ('k') | test/cctest/test-macro-assembler-mips.cc » ('j') | 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 1ab4a893e34f8baf6b66da99b89c2f06b26922d1..dd12f9b51ad30c5ee00694e2d4501b452c914609 100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -1258,8 +1258,13 @@ void MacroAssembler::Sltu(Register rd, Register rs, const Operand& rt) {
if (rt.is_reg()) {
sltu(rd, rs, rt.rm());
} else {
- if (is_int16(rt.imm64_) && !MustUseReg(rt.rmode_)) {
+ const uint64_t int16_min = std::numeric_limits<int16_t>::min();
+ if (is_uint15(rt.imm64_) && !MustUseReg(rt.rmode_)) {
+ // Imm range is: [0, 32767].
sltiu(rd, rs, static_cast<int32_t>(rt.imm64_));
+ } else if (is_uint15(rt.imm64_ - int16_min) && !MustUseReg(rt.rmode_)) {
+ // Imm range is: [max_unsigned-32767,max_unsigned].
+ sltiu(rd, rs, static_cast<uint16_t>(rt.imm64_));
} else {
// li handles the relocation.
DCHECK(!rs.is(at));
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | test/cctest/test-macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698