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

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

Issue 1939763003: S390X: Prevent upper 32bit corruption in 32bit ops (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use macroassembler Created 4 years, 8 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/s390/macro-assembler-s390.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/macro-assembler-s390.cc
diff --git a/src/s390/macro-assembler-s390.cc b/src/s390/macro-assembler-s390.cc
index ea1079e4d658244bd75002fedb368afde0500ea2..120b208ae7d79669ea469c229c5fa192dace6a6b 100644
--- a/src/s390/macro-assembler-s390.cc
+++ b/src/s390/macro-assembler-s390.cc
@@ -1925,7 +1925,7 @@ void MacroAssembler::AllocateTwoByteString(Register result, Register length,
// observing object alignment.
DCHECK((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0);
- ShiftLeft(scratch1, length, Operand(1)); // Length in bytes, not chars.
+ ShiftLeftP(scratch1, length, Operand(1)); // Length in bytes, not chars.
AddP(scratch1, Operand(kObjectAlignmentMask + SeqTwoByteString::kHeaderSize));
AndP(scratch1, Operand(~kObjectAlignmentMask));
@@ -4895,6 +4895,15 @@ void MacroAssembler::StoreMultipleW(Register src1, Register src2,
}
// Load 32-bits and sign extend if necessary.
+void MacroAssembler::LoadW(Register dst, Register src) {
+#if V8_TARGET_ARCH_S390X
+ lgfr(dst, src);
+#else
+ if (!dst.is(src)) lr(dst, src);
+#endif
+}
+
+// Load 32-bits and sign extend if necessary.
void MacroAssembler::LoadW(Register dst, const MemOperand& mem,
Register scratch) {
int offset = mem.offset();
@@ -4920,6 +4929,15 @@ void MacroAssembler::LoadW(Register dst, const MemOperand& mem,
}
}
+// Load 32-bits and zero extend if necessary.
+void MacroAssembler::LoadlW(Register dst, Register src) {
+#if V8_TARGET_ARCH_S390X
+ llgfr(dst, src);
+#else
+ if (!dst.is(src)) lr(dst, src);
+#endif
+}
+
// Variable length depending on whether offset fits into immediate field
// MemOperand of RX or RXY format
void MacroAssembler::LoadlW(Register dst, const MemOperand& mem,
« no previous file with comments | « src/s390/macro-assembler-s390.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698