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

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

Issue 1714283002: MIPS64: Fix 'MIPS: use DAHI/DATH for li macro on mips64r6.' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | 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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 ori(rd, zero_reg, (j.imm64_ & kImm16Mask)); 1371 ori(rd, zero_reg, (j.imm64_ & kImm16Mask));
1372 } else if (!(j.imm64_ & kImm16Mask)) { 1372 } else if (!(j.imm64_ & kImm16Mask)) {
1373 lui(rd, (j.imm64_ >> kLuiShift) & kImm16Mask); 1373 lui(rd, (j.imm64_ >> kLuiShift) & kImm16Mask);
1374 } else { 1374 } else {
1375 lui(rd, (j.imm64_ >> kLuiShift) & kImm16Mask); 1375 lui(rd, (j.imm64_ >> kLuiShift) & kImm16Mask);
1376 ori(rd, rd, (j.imm64_ & kImm16Mask)); 1376 ori(rd, rd, (j.imm64_ & kImm16Mask));
1377 } 1377 }
1378 } else { 1378 } else {
1379 if (kArchVariant == kMips64r6) { 1379 if (kArchVariant == kMips64r6) {
1380 int64_t imm = j.imm64_; 1380 int64_t imm = j.imm64_;
1381 bool lui_emited = false; 1381 lui(rd, (imm >> kLuiShift) & kImm16Mask);
1382 if (((imm >> kLuiShift) & kImm16Mask) != 0) {
1383 lui(rd, (imm >> kLuiShift) & kImm16Mask);
1384 lui_emited = true;
1385 }
1386 if ((imm & kImm16Mask) != 0) { 1382 if ((imm & kImm16Mask) != 0) {
1387 ori(rd, rd, (imm & kImm16Mask)); 1383 ori(rd, rd, (imm & kImm16Mask));
1388 } else if (!lui_emited) {
1389 or_(rd, zero_reg, zero_reg);
1390 } 1384 }
balazs.kilvady 2016/02/23 19:56:23 If I got it correctly at late evening then you use
Alan Li 2016/02/25 03:05:40 Done.
1391 if ((imm >> 31) & 0x1) { 1385 if ((imm >> 31) & 0x1) {
balazs.kilvady 2016/02/23 19:56:23 Don't we have kImm32Mask? If not yet then I think
Alan Li 2016/02/25 03:05:39 Consolidated into shiftAndFixSignExtension. On 20
1392 imm = (imm >> 32) + 1; 1386 imm = (imm >> 32) + 1;
1393 } else { 1387 } else {
1394 imm = imm >> 32; 1388 imm = imm >> 32;
1395 } 1389 }
1396 if (imm & kImm16Mask) { 1390 if (imm & kImm16Mask) {
1397 dahi(rd, imm & kImm16Mask); 1391 dahi(rd, imm & kImm16Mask);
1398 } 1392 }
1399 if (!is_int48(j.imm64_)) { 1393 if (!is_int48(j.imm64_)) {
1400 if ((imm >> 15) & 0x1) { 1394 if ((imm >> 15) & 0x1) {
1401 imm = (imm >> 16) + 1; 1395 imm = (imm >> 16) + 1;
1402 } else { 1396 } else {
1403 imm = imm >> 16; 1397 imm = imm >> 16;
1404 } 1398 }
balazs.kilvady 2016/02/23 19:56:23 I guess the above if () {} else {} is for fixing s
Alan Li 2016/02/25 03:05:40 Done.
Alan Li 2016/02/25 03:05:40 Done.
1405 if (imm & kImm16Mask) { 1399 if (imm & kImm16Mask) {
1406 dati(rd, imm & kImm16Mask); 1400 dati(rd, imm & kImm16Mask);
1407 } 1401 }
1408 } 1402 }
1409 } else { 1403 } else {
1410 if (is_int48(j.imm64_)) { 1404 if (is_int48(j.imm64_)) {
1411 if ((j.imm64_ >> 32) & kImm16Mask) { 1405 if ((j.imm64_ >> 32) & kImm16Mask) {
1412 lui(rd, (j.imm64_ >> 32) & kImm16Mask); 1406 lui(rd, (j.imm64_ >> 32) & kImm16Mask);
1413 if ((j.imm64_ >> 16) & kImm16Mask) { 1407 if ((j.imm64_ >> 16) & kImm16Mask) {
1414 ori(rd, rd, (j.imm64_ >> 16) & kImm16Mask); 1408 ori(rd, rd, (j.imm64_ >> 16) & kImm16Mask);
(...skipping 5246 matching lines...) Expand 10 before | Expand all | Expand 10 after
6661 if (mag.shift > 0) sra(result, result, mag.shift); 6655 if (mag.shift > 0) sra(result, result, mag.shift);
6662 srl(at, dividend, 31); 6656 srl(at, dividend, 31);
6663 Addu(result, result, Operand(at)); 6657 Addu(result, result, Operand(at));
6664 } 6658 }
6665 6659
6666 6660
6667 } // namespace internal 6661 } // namespace internal
6668 } // namespace v8 6662 } // namespace v8
6669 6663
6670 #endif // V8_TARGET_ARCH_MIPS64 6664 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698