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

Unified Diff: src/mips64/macro-assembler-mips64.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/mips64/macro-assembler-mips64.h ('k') | test/cctest/test-macro-assembler-mips.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 53b4ef2beae2f7bdbe002910ff951bbb8a48b0b8..4c21a8fbccf72ecf5b195fc2660c21ce2d28dcdf 100644
--- a/src/mips64/macro-assembler-mips64.cc
+++ b/src/mips64/macro-assembler-mips64.cc
@@ -1357,45 +1357,47 @@ void MacroAssembler::Bnvc(Register rs, Register rt, Label* L) {
// ------------Pseudo-instructions-------------
// Change endianness
-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 ||
operand_size == 8);
DCHECK(kArchVariant == kMips64r6 || kArchVariant == kMips64r2);
if (operand_size == 1) {
- seb(reg, reg);
- sll(reg, reg, 0);
- dsbh(reg, reg);
- dshd(reg, reg);
+ seb(src, src);
+ sll(src, src, 0);
+ dsbh(dest, src);
+ dshd(dest, dest);
} else if (operand_size == 2) {
- seh(reg, reg);
- sll(reg, reg, 0);
- dsbh(reg, reg);
- dshd(reg, reg);
+ seh(src, src);
+ sll(src, src, 0);
+ dsbh(dest, src);
+ dshd(dest, dest);
} else if (operand_size == 4) {
- sll(reg, reg, 0);
- dsbh(reg, reg);
- dshd(reg, reg);
+ sll(src, src, 0);
+ dsbh(dest, src);
+ dshd(dest, dest);
} else {
- dsbh(reg, reg);
- dshd(reg, reg);
+ dsbh(dest, src);
+ dshd(dest, dest);
}
}
-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 || operand_size == 4);
if (operand_size == 1) {
- andi(reg, reg, 0xFF);
- dsbh(reg, reg);
- dshd(reg, reg);
+ andi(src, src, 0xFF);
+ dsbh(dest, src);
+ dshd(dest, dest);
} else if (operand_size == 2) {
- andi(reg, reg, 0xFFFF);
- dsbh(reg, reg);
- dshd(reg, reg);
- } else {
- dsll32(reg, reg, 0);
- dsrl32(reg, reg, 0);
- dsbh(reg, reg);
- dshd(reg, reg);
+ andi(src, src, 0xFFFF);
+ dsbh(dest, src);
+ dshd(dest, dest);
+ } else {
+ dsll32(src, src, 0);
+ dsrl32(src, src, 0);
+ dsbh(dest, src);
+ dshd(dest, dest);
}
}
« no previous file with comments | « src/mips64/macro-assembler-mips64.h ('k') | test/cctest/test-macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698