Commit c07f0225 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC64: [turbofan] Fix checked loads/stores.

This refines e7d521fb -- as we still
require clean up of the uint index register.

TEST=mjsunit/asm/float32array-negative-offset
R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, bjaideep@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1919003004

Cr-Commit-Position: refs/heads/master@{#35778}
parent d565ba8f
...@@ -525,6 +525,12 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) { ...@@ -525,6 +525,12 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
} while (0) } while (0)
#if V8_TARGET_ARCH_PPC64
// TODO(mbrandy): fix paths that produce garbage in offset's upper 32-bits.
#define CleanUInt32(x) __ ClearLeftImm(x, x, Operand(32))
#else
#define CleanUInt32(x)
#endif
#define ASSEMBLE_CHECKED_LOAD_FLOAT(asm_instr, asm_instrx, width) \ #define ASSEMBLE_CHECKED_LOAD_FLOAT(asm_instr, asm_instrx, width) \
do { \ do { \
...@@ -544,13 +550,13 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) { ...@@ -544,13 +550,13 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
if (mode == kMode_MRI) { \ if (mode == kMode_MRI) { \
__ asm_instr(result, operand); \ __ asm_instr(result, operand); \
} else { \ } else { \
CleanUInt32(offset); \
__ asm_instrx(result, operand); \ __ asm_instrx(result, operand); \
} \ } \
__ bind(ool->exit()); \ __ bind(ool->exit()); \
DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
} while (0) } while (0)
#define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr, asm_instrx) \ #define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr, asm_instrx) \
do { \ do { \
Register result = i.OutputRegister(); \ Register result = i.OutputRegister(); \
...@@ -569,13 +575,13 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) { ...@@ -569,13 +575,13 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
if (mode == kMode_MRI) { \ if (mode == kMode_MRI) { \
__ asm_instr(result, operand); \ __ asm_instr(result, operand); \
} else { \ } else { \
CleanUInt32(offset); \
__ asm_instrx(result, operand); \ __ asm_instrx(result, operand); \
} \ } \
__ bind(ool->exit()); \ __ bind(ool->exit()); \
DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
} while (0) } while (0)
#define ASSEMBLE_CHECKED_STORE_FLOAT32() \ #define ASSEMBLE_CHECKED_STORE_FLOAT32() \
do { \ do { \
Label done; \ Label done; \
...@@ -595,13 +601,13 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) { ...@@ -595,13 +601,13 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
if (mode == kMode_MRI) { \ if (mode == kMode_MRI) { \
__ stfs(kScratchDoubleReg, operand); \ __ stfs(kScratchDoubleReg, operand); \
} else { \ } else { \
CleanUInt32(offset); \
__ stfsx(kScratchDoubleReg, operand); \ __ stfsx(kScratchDoubleReg, operand); \
} \ } \
__ bind(&done); \ __ bind(&done); \
DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
} while (0) } while (0)
#define ASSEMBLE_CHECKED_STORE_DOUBLE() \ #define ASSEMBLE_CHECKED_STORE_DOUBLE() \
do { \ do { \
Label done; \ Label done; \
...@@ -620,13 +626,13 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) { ...@@ -620,13 +626,13 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
if (mode == kMode_MRI) { \ if (mode == kMode_MRI) { \
__ stfd(value, operand); \ __ stfd(value, operand); \
} else { \ } else { \
CleanUInt32(offset); \
__ stfdx(value, operand); \ __ stfdx(value, operand); \
} \ } \
__ bind(&done); \ __ bind(&done); \
DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
} while (0) } while (0)
#define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr, asm_instrx) \ #define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr, asm_instrx) \
do { \ do { \
Label done; \ Label done; \
...@@ -645,6 +651,7 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) { ...@@ -645,6 +651,7 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
if (mode == kMode_MRI) { \ if (mode == kMode_MRI) { \
__ asm_instr(value, operand); \ __ asm_instr(value, operand); \
} else { \ } else { \
CleanUInt32(offset); \
__ asm_instrx(value, operand); \ __ asm_instrx(value, operand); \
} \ } \
__ bind(&done); \ __ bind(&done); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment