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

Side by Side Diff: src/mips64/macro-assembler-mips64.cc

Issue 2386673002: MIPS: Fix Sltu macro instruction. (Closed)
Patch Set: Fix nits. Created 4 years, 2 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/base/division-by-constant.h" 9 #include "src/base/division-by-constant.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 slt(rd, rs, at); 1251 slt(rd, rs, at);
1252 } 1252 }
1253 } 1253 }
1254 } 1254 }
1255 1255
1256 1256
1257 void MacroAssembler::Sltu(Register rd, Register rs, const Operand& rt) { 1257 void MacroAssembler::Sltu(Register rd, Register rs, const Operand& rt) {
1258 if (rt.is_reg()) { 1258 if (rt.is_reg()) {
1259 sltu(rd, rs, rt.rm()); 1259 sltu(rd, rs, rt.rm());
1260 } else { 1260 } else {
1261 if (is_int16(rt.imm64_) && !MustUseReg(rt.rmode_)) { 1261 const uint64_t int16_min = std::numeric_limits<int16_t>::min();
1262 if (is_uint15(rt.imm64_) && !MustUseReg(rt.rmode_)) {
1263 // Imm range is: [0, 32767].
1262 sltiu(rd, rs, static_cast<int32_t>(rt.imm64_)); 1264 sltiu(rd, rs, static_cast<int32_t>(rt.imm64_));
1265 } else if (is_uint15(rt.imm64_ - int16_min) && !MustUseReg(rt.rmode_)) {
1266 // Imm range is: [max_unsigned-32767,max_unsigned].
1267 sltiu(rd, rs, static_cast<uint16_t>(rt.imm64_));
1263 } else { 1268 } else {
1264 // li handles the relocation. 1269 // li handles the relocation.
1265 DCHECK(!rs.is(at)); 1270 DCHECK(!rs.is(at));
1266 li(at, rt); 1271 li(at, rt);
1267 sltu(rd, rs, at); 1272 sltu(rd, rs, at);
1268 } 1273 }
1269 } 1274 }
1270 } 1275 }
1271 1276
1272 1277
(...skipping 6135 matching lines...) Expand 10 before | Expand all | Expand 10 after
7408 if (mag.shift > 0) sra(result, result, mag.shift); 7413 if (mag.shift > 0) sra(result, result, mag.shift);
7409 srl(at, dividend, 31); 7414 srl(at, dividend, 31);
7410 Addu(result, result, Operand(at)); 7415 Addu(result, result, Operand(at));
7411 } 7416 }
7412 7417
7413 7418
7414 } // namespace internal 7419 } // namespace internal
7415 } // namespace v8 7420 } // namespace v8
7416 7421
7417 #endif // V8_TARGET_ARCH_MIPS64 7422 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« 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