Commit 75b7db74 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[arm][simulator] Fix vmin implementation

vmin should return the default NaN if any input is a NaN (regardless of
the default NaN mode), so turn the default NaN mode, canonicalize, then
reset it.

Bug: v8:10835
Change-Id: Ia83c9fbcbc2070029f35bbd07cbb4abf857b594d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2416399Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70005}
parent e95e3f12
......@@ -4610,9 +4610,13 @@ void Simulator::DecodeSpecialCondition(Instruction* instr) {
} else {
// vmin/vmax.f32 Qd, Qm, Qn.
bool min = instr->Bit(21) == 1;
bool saved = FPSCR_default_NaN_mode_;
FPSCR_default_NaN_mode_ = true;
for (int i = 0; i < 4; i++) {
src1[i] = MinMax(src1[i], src2[i], min);
// vmin returns default NaN if any input is NaN.
src1[i] = canonicalizeNaN(MinMax(src1[i], src2[i], min));
}
FPSCR_default_NaN_mode_ = saved;
}
set_neon_register(Vd, src1);
} else {
......
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