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

Unified Diff: src/mips/macro-assembler-mips.cc

Issue 2235703002: MIPS: [compiler] [wasm] Introduce Word32/64ReverseBytes as TF Optional Opcode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/mips/macro-assembler-mips.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
index 9230f06eaf9673a1d33162ec0d12b6e2ed74b8be..6235c4a1e243e8fdb8dc2955341ece70a222f963 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -1211,74 +1211,76 @@ void MacroAssembler::Bnvc(Register rs, Register rt, Label* L) {
// ------------Pseudo-instructions-------------
// Word Swap Byte
-void MacroAssembler::ByteSwapSigned(Register reg, int operand_size) {
+void MacroAssembler::ByteSwapSigned(Register dest, Register src,
+ int operand_size) {
DCHECK(operand_size == 1 || operand_size == 2 || operand_size == 4);
if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
if (operand_size == 2) {
- seh(reg, reg);
+ seh(src, src);
} else if (operand_size == 1) {
- seb(reg, reg);
+ seb(src, src);
}
// No need to do any preparation if operand_size is 4
- wsbh(reg, reg);
- rotr(reg, reg, 16);
+ wsbh(dest, src);
+ rotr(dest, dest, 16);
} else if (IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kLoongson)) {
if (operand_size == 1) {
- sll(reg, reg, 24);
- sra(reg, reg, 24);
+ sll(src, src, 24);
+ sra(src, src, 24);
} else if (operand_size == 2) {
- sll(reg, reg, 16);
- sra(reg, reg, 16);
+ sll(src, src, 16);
+ sra(src, src, 16);
}
// No need to do any preparation if operand_size is 4
Register tmp = t0;
Register tmp2 = t1;
- andi(tmp2, reg, 0xFF);
+ andi(tmp2, src, 0xFF);
sll(tmp2, tmp2, 24);
or_(tmp, zero_reg, tmp2);
- andi(tmp2, reg, 0xFF00);
+ andi(tmp2, src, 0xFF00);
sll(tmp2, tmp2, 8);
or_(tmp, tmp, tmp2);
- srl(reg, reg, 8);
- andi(tmp2, reg, 0xFF00);
+ srl(src, src, 8);
+ andi(tmp2, src, 0xFF00);
or_(tmp, tmp, tmp2);
- srl(reg, reg, 16);
- andi(tmp2, reg, 0xFF);
+ srl(src, src, 16);
+ andi(tmp2, src, 0xFF);
or_(tmp, tmp, tmp2);
- or_(reg, tmp, zero_reg);
+ or_(dest, tmp, zero_reg);
}
}
-void MacroAssembler::ByteSwapUnsigned(Register reg, int operand_size) {
+void MacroAssembler::ByteSwapUnsigned(Register dest, Register src,
+ int operand_size) {
DCHECK(operand_size == 1 || operand_size == 2);
if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
if (operand_size == 1) {
- andi(reg, reg, 0xFF);
+ andi(src, src, 0xFF);
} else {
- andi(reg, reg, 0xFFFF);
+ andi(src, src, 0xFFFF);
}
// No need to do any preparation if operand_size is 4
- wsbh(reg, reg);
- rotr(reg, reg, 16);
+ wsbh(dest, src);
+ rotr(dest, dest, 16);
} else if (IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kLoongson)) {
if (operand_size == 1) {
- sll(reg, reg, 24);
+ sll(src, src, 24);
} else {
Register tmp = t0;
- andi(tmp, reg, 0xFF00);
- sll(reg, reg, 24);
+ andi(tmp, src, 0xFF00);
+ sll(src, src, 24);
sll(tmp, tmp, 8);
- or_(reg, tmp, reg);
+ or_(dest, tmp, src);
}
}
}
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698