From 2cdc462f3a6033ba254ec8ca606c34054e2eb08d Mon Sep 17 00:00:00 2001 From: anutosh491 Date: Mon, 9 Oct 2023 14:53:14 +0530 Subject: [PATCH] Implemented isnan through emulation --- include/xsimd/arch/xsimd_wasm.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/xsimd/arch/xsimd_wasm.hpp b/include/xsimd/arch/xsimd_wasm.hpp index 73369bc89..59110f85a 100644 --- a/include/xsimd/arch/xsimd_wasm.hpp +++ b/include/xsimd/arch/xsimd_wasm.hpp @@ -385,6 +385,18 @@ namespace xsimd return wasm_f64x2_gt(self, other); } + // isnan + template + inline batch_bool isnan(batch const& self, requires_arch) noexcept + { + return wasm_v128_or(wasm_f32x4_ne(self, self), wasm_f32x4_ne(self, self)); + } + template + inline batch_bool isnan(batch const& self, requires_arch) noexcept + { + return wasm_v128_or(wasm_f64x2_ne(self, self), wasm_f64x2_ne(self, self)); + } + // le template inline batch_bool le(batch const& self, batch const& other, requires_arch) noexcept