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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/assembler-mips64.cc ('k') | src/mips64/simulator-mips64.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 831dbc5ac70cfd1daea291be24620e81c6a78127..6102abf151374613e628d5f5ad73eb3a42b6326b 100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -1225,7 +1225,11 @@ void MacroAssembler::Ror(Register rd, Register rs, const Operand& rt) {
if (rt.is_reg()) {
rotrv(rd, rs, rt.rm());
} else {
- rotr(rd, rs, rt.imm64_);
+ int64_t ror_value = rt.imm64_ % 32;
+ if (ror_value < 0) {
+ ror_value += 32;
+ }
+ rotr(rd, rs, ror_value);
}
}
@@ -1234,7 +1238,13 @@ void MacroAssembler::Dror(Register rd, Register rs, const Operand& rt) {
if (rt.is_reg()) {
drotrv(rd, rs, rt.rm());
} else {
- drotr(rd, rs, rt.imm64_);
+ int64_t dror_value = rt.imm64_ % 64;
+ if (dror_value < 0) dror_value += 64;
+ if (dror_value <= 31) {
+ drotr(rd, rs, dror_value);
+ } else {
+ drotr32(rd, rs, dror_value - 32);
+ }
}
}
« 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