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

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

Issue 1776623002: MIPS: Fix '[wasm] add rotate opcodes' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: code clean up according to review. 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/assembler-mips64.cc ('k') | src/mips64/simulator-mips64.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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 sltu(rd, rs, at); 1218 sltu(rd, rs, at);
1219 } 1219 }
1220 } 1220 }
1221 } 1221 }
1222 1222
1223 1223
1224 void MacroAssembler::Ror(Register rd, Register rs, const Operand& rt) { 1224 void MacroAssembler::Ror(Register rd, Register rs, const Operand& rt) {
1225 if (rt.is_reg()) { 1225 if (rt.is_reg()) {
1226 rotrv(rd, rs, rt.rm()); 1226 rotrv(rd, rs, rt.rm());
1227 } else { 1227 } else {
1228 rotr(rd, rs, rt.imm64_); 1228 int64_t ror_value = rt.imm64_ % 32;
1229 if (ror_value < 0) {
1230 ror_value += 32;
1231 }
1232 rotr(rd, rs, ror_value);
1229 } 1233 }
1230 } 1234 }
1231 1235
1232 1236
1233 void MacroAssembler::Dror(Register rd, Register rs, const Operand& rt) { 1237 void MacroAssembler::Dror(Register rd, Register rs, const Operand& rt) {
1234 if (rt.is_reg()) { 1238 if (rt.is_reg()) {
1235 drotrv(rd, rs, rt.rm()); 1239 drotrv(rd, rs, rt.rm());
1236 } else { 1240 } else {
1237 drotr(rd, rs, rt.imm64_); 1241 int64_t dror_value = rt.imm64_ % 64;
1242 if (dror_value < 0) dror_value += 64;
1243 if (dror_value <= 31) {
1244 drotr(rd, rs, dror_value);
1245 } else {
1246 drotr32(rd, rs, dror_value - 32);
1247 }
1238 } 1248 }
1239 } 1249 }
1240 1250
1241 1251
1242 void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) { 1252 void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) {
1243 pref(hint, rs); 1253 pref(hint, rs);
1244 } 1254 }
1245 1255
1246 1256
1247 void MacroAssembler::Lsa(Register rd, Register rt, Register rs, uint8_t sa, 1257 void MacroAssembler::Lsa(Register rd, Register rt, Register rs, uint8_t sa,
(...skipping 5476 matching lines...) Expand 10 before | Expand all | Expand 10 after
6724 if (mag.shift > 0) sra(result, result, mag.shift); 6734 if (mag.shift > 0) sra(result, result, mag.shift);
6725 srl(at, dividend, 31); 6735 srl(at, dividend, 31);
6726 Addu(result, result, Operand(at)); 6736 Addu(result, result, Operand(at));
6727 } 6737 }
6728 6738
6729 6739
6730 } // namespace internal 6740 } // namespace internal
6731 } // namespace v8 6741 } // namespace v8
6732 6742
6733 #endif // V8_TARGET_ARCH_MIPS64 6743 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/assembler-mips64.cc ('k') | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698