Commit 7509cd65 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

s390x:[liftoff] implement AtomicStore

Change-Id: I9ca5ffe40f6d548b032609d98a6bf6df23f31e0a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2805933Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#73814}
parent 6880cc2d
......@@ -424,7 +424,56 @@ void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr,
void LiftoffAssembler::AtomicStore(Register dst_addr, Register offset_reg,
uintptr_t offset_imm, LiftoffRegister src,
StoreType type, LiftoffRegList pinned) {
bailout(kAtomics, "AtomicStore");
lay(ip,
MemOperand(dst_addr, offset_reg == no_reg ? r0 : offset_reg, offset_imm));
switch (type.value()) {
case StoreType::kI32Store8:
case StoreType::kI64Store8: {
AtomicExchangeU8(ip, src.gp(), r1, r0);
break;
}
case StoreType::kI32Store16:
case StoreType::kI64Store16: {
#ifdef V8_TARGET_BIG_ENDIAN
lrvr(r1, src.gp());
ShiftRightU32(r1, r1, Operand(16));
#else
LoadU16(r1, src.gp());
#endif
Push(r2);
AtomicExchangeU16(ip, r1, r2, r0);
Pop(r2);
break;
}
case StoreType::kI32Store:
case StoreType::kI64Store32: {
#ifdef V8_TARGET_BIG_ENDIAN
lrvr(r1, src.gp());
#else
LoadU32(r1, src.gp());
#endif
Label do_cs;
bind(&do_cs);
cs(r0, r1, MemOperand(ip));
bne(&do_cs, Label::kNear);
break;
}
case StoreType::kI64Store: {
#ifdef V8_TARGET_BIG_ENDIAN
lrvgr(r1, src.gp());
#else
mov(r1, src.gp());
#endif
Label do_cs;
bind(&do_cs);
csg(r0, r1, MemOperand(ip));
bne(&do_cs, Label::kNear);
break;
}
default:
UNREACHABLE();
}
}
void LiftoffAssembler::AtomicAdd(Register dst_addr, Register offset_reg,
......
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