Commit 074de64e authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[wasm][liftoff][mips] Detect NaNs for fuzzing

Port: e699762e

Bug: v8:11856
Change-Id: Ib832dfcee864b21b4e56498fca54e9ae01c44ae7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2983711
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#75350}
parent 79b16467
......@@ -3004,6 +3004,21 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
void LiftoffAssembler::MaybeOSR() {}
void LiftoffAssembler::emit_set_if_nan(Register dst, FPURegister src,
ValueKind kind) {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
li(scratch, 1);
if (kind == kF32) {
CompareIsNanF32(src, src);
} else {
DCHECK_EQ(kind, kF64);
CompareIsNanF64(src, src);
}
LoadZeroIfNotFPUCondition(scratch);
Sw(scratch, MemOperand(dst));
}
void LiftoffStackSlots::Construct(int param_slots) {
DCHECK_LT(0, slots_.size());
SortInPushOrder();
......
......@@ -3172,6 +3172,21 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
void LiftoffAssembler::MaybeOSR() {}
void LiftoffAssembler::emit_set_if_nan(Register dst, FPURegister src,
ValueKind kind) {
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
li(scratch, 1);
if (kind == kF32) {
CompareIsNanF32(src, src);
} else {
DCHECK_EQ(kind, kF64);
CompareIsNanF64(src, src);
}
LoadZeroIfNotFPUCondition(scratch);
Sd(scratch, MemOperand(dst));
}
void LiftoffStackSlots::Construct(int param_slots) {
DCHECK_LT(0, slots_.size());
SortInPushOrder();
......
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