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

Unified Diff: src/compiler/s390/code-generator-s390.cc

Issue 1936953004: S390: Fix storing to below stack to avoid sampler handler corrupting stored value (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove insertdoublehigh/low 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 | « no previous file | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/s390/code-generator-s390.cc
diff --git a/src/compiler/s390/code-generator-s390.cc b/src/compiler/s390/code-generator-s390.cc
index dfe390aa62bda7e33eb958eafe9f6d3f274de495..c4cb96f902f3454ecf6dc3aa55a9b2e8468414bc 100644
--- a/src/compiler/s390/code-generator-s390.cc
+++ b/src/compiler/s390/code-generator-s390.cc
@@ -1304,8 +1304,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
#endif
case kS390_Push:
if (instr->InputAt(0)->IsDoubleRegister()) {
- __ StoreDouble(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize));
__ lay(sp, MemOperand(sp, -kDoubleSize));
+ __ StoreDouble(i.InputDoubleRegister(0), MemOperand(sp));
frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize);
} else {
__ Push(i.InputRegister(0));
@@ -1314,14 +1314,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
case kS390_PushFrame: {
int num_slots = i.InputInt32(1);
+ __ lay(sp, MemOperand(sp, -num_slots * kPointerSize));
if (instr->InputAt(0)->IsDoubleRegister()) {
__ StoreDouble(i.InputDoubleRegister(0),
- MemOperand(sp, -num_slots * kPointerSize));
+ MemOperand(sp));
} else {
__ StoreP(i.InputRegister(0),
- MemOperand(sp, -num_slots * kPointerSize));
+ MemOperand(sp));
}
- __ lay(sp, MemOperand(sp, -num_slots * kPointerSize));
break;
}
case kS390_StoreToStackSlot: {
@@ -1496,36 +1496,30 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ ldebr(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
break;
case kS390_DoubleExtractLowWord32:
- // TODO(john.yan): this can cause problem when interrupting,
- // use freg->greg instruction
- __ stdy(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize));
- __ LoadlW(i.OutputRegister(),
- MemOperand(sp, -kDoubleSize + Register::kMantissaOffset));
+ __ lgdr(i.OutputRegister(), i.InputDoubleRegister(0));
+ __ llgfr(i.OutputRegister(), i.OutputRegister());
break;
case kS390_DoubleExtractHighWord32:
- // TODO(john.yan): this can cause problem when interrupting,
- // use freg->greg instruction
- __ stdy(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize));
- __ LoadlW(i.OutputRegister(),
- MemOperand(sp, -kDoubleSize + Register::kExponentOffset));
+ __ lgdr(i.OutputRegister(), i.InputDoubleRegister(0));
+ __ srlg(i.OutputRegister(), i.OutputRegister(), Operand(32));
break;
case kS390_DoubleInsertLowWord32:
- __ InsertDoubleLow(i.OutputDoubleRegister(), i.InputRegister(1));
+ __ lgdr(kScratchReg, i.OutputDoubleRegister());
+ __ lr(kScratchReg, i.InputRegister(1));
+ __ ldgr(i.OutputDoubleRegister(), kScratchReg);
break;
case kS390_DoubleInsertHighWord32:
- __ InsertDoubleHigh(i.OutputDoubleRegister(), i.InputRegister(1));
+ __ sllg(kScratchReg, i.InputRegister(1), Operand(32));
+ __ lgdr(r0, i.OutputDoubleRegister());
+ __ lr(kScratchReg, r0);
+ __ ldgr(i.OutputDoubleRegister(), kScratchReg);
break;
case kS390_DoubleConstruct:
-// TODO(john.yan): this can cause problem when interrupting,
-// use greg->freg instruction
-#if V8_TARGET_LITTLE_ENDIAN
- __ StoreW(i.InputRegister(0), MemOperand(sp, -kDoubleSize / 2));
- __ StoreW(i.InputRegister(1), MemOperand(sp, -kDoubleSize));
-#else
- __ StoreW(i.InputRegister(1), MemOperand(sp, -kDoubleSize / 2));
- __ StoreW(i.InputRegister(0), MemOperand(sp, -kDoubleSize));
-#endif
- __ ldy(i.OutputDoubleRegister(), MemOperand(sp, -kDoubleSize));
+ __ sllg(kScratchReg, i.InputRegister(0), Operand(32));
+ __ lr(kScratchReg, i.InputRegister(1));
+
+ // Bitwise convert from GPR to FPR
+ __ ldgr(i.OutputDoubleRegister(), kScratchReg);
break;
case kS390_LoadWordS8:
ASSEMBLE_LOAD_INTEGER(LoadlB);
« no previous file with comments | « no previous file | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698