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

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

Issue 1749263002: MIPS: Improve Lsa/Dlsa implementations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 9 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/mips64/macro-assembler-mips64.h ('k') | test/cctest/test-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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 } 1287 }
1288 1288
1289 1289
1290 void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) { 1290 void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) {
1291 pref(hint, rs); 1291 pref(hint, rs);
1292 } 1292 }
1293 1293
1294 1294
1295 void MacroAssembler::Lsa(Register rd, Register rt, Register rs, uint8_t sa, 1295 void MacroAssembler::Lsa(Register rd, Register rt, Register rs, uint8_t sa,
1296 Register scratch) { 1296 Register scratch) {
1297 DCHECK(sa >= 1 && sa <= 31);
1297 if (kArchVariant == kMips64r6 && sa <= 4) { 1298 if (kArchVariant == kMips64r6 && sa <= 4) {
1298 lsa(rd, rt, rs, sa); 1299 lsa(rd, rt, rs, sa - 1);
1299 } else { 1300 } else {
1300 Register tmp = rd.is(rt) ? scratch : rd; 1301 Register tmp = rd.is(rt) ? scratch : rd;
1301 DCHECK(!tmp.is(rt)); 1302 DCHECK(!tmp.is(rt));
1302 sll(tmp, rs, sa); 1303 sll(tmp, rs, sa);
1303 Addu(rd, rt, tmp); 1304 Addu(rd, rt, tmp);
1304 } 1305 }
1305 } 1306 }
1306 1307
1307 1308
1308 void MacroAssembler::Dlsa(Register rd, Register rt, Register rs, uint8_t sa, 1309 void MacroAssembler::Dlsa(Register rd, Register rt, Register rs, uint8_t sa,
1309 Register scratch) { 1310 Register scratch) {
1311 DCHECK(sa >= 1 && sa <= 31);
1310 if (kArchVariant == kMips64r6 && sa <= 4) { 1312 if (kArchVariant == kMips64r6 && sa <= 4) {
1311 dlsa(rd, rt, rs, sa); 1313 dlsa(rd, rt, rs, sa - 1);
1312 } else { 1314 } else {
1313 Register tmp = rd.is(rt) ? scratch : rd; 1315 Register tmp = rd.is(rt) ? scratch : rd;
1314 DCHECK(!tmp.is(rt)); 1316 DCHECK(!tmp.is(rt));
1315 dsll(tmp, rs, sa); 1317 dsll(tmp, rs, sa);
1316 Daddu(rd, rt, tmp); 1318 Daddu(rd, rt, tmp);
1317 } 1319 }
1318 } 1320 }
1319 1321
1320 1322
1321 // ------------Pseudo-instructions------------- 1323 // ------------Pseudo-instructions-------------
(...skipping 5459 matching lines...) Expand 10 before | Expand all | Expand 10 after
6781 if (mag.shift > 0) sra(result, result, mag.shift); 6783 if (mag.shift > 0) sra(result, result, mag.shift);
6782 srl(at, dividend, 31); 6784 srl(at, dividend, 31);
6783 Addu(result, result, Operand(at)); 6785 Addu(result, result, Operand(at));
6784 } 6786 }
6785 6787
6786 6788
6787 } // namespace internal 6789 } // namespace internal
6788 } // namespace v8 6790 } // namespace v8
6789 6791
6790 #endif // V8_TARGET_ARCH_MIPS64 6792 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | test/cctest/test-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698