From 6c748a898eb35753fb42414b77850b19ef9774d8 Mon Sep 17 00:00:00 2001 From: Auburn Date: Mon, 2 Dec 2024 22:55:39 +0000 Subject: [PATCH] Add Trunc, Modulus, SignBit functions (WASM ARM) --- include/FastSIMD/ToolSet/ARM/128/f32x4.h | 6 ++++++ include/FastSIMD/ToolSet/Generic/Functions.h | 1 + include/FastSIMD/ToolSet/WASM/128/f32x4.h | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/include/FastSIMD/ToolSet/ARM/128/f32x4.h b/include/FastSIMD/ToolSet/ARM/128/f32x4.h index 1a6f35f..e00600c 100644 --- a/include/FastSIMD/ToolSet/ARM/128/f32x4.h +++ b/include/FastSIMD/ToolSet/ARM/128/f32x4.h @@ -176,6 +176,12 @@ namespace FS { return vrndpq_f32( a.native ); } + + template>> + FS_FORCEINLINE f32<4, SIMD> Trunc( const f32<4, SIMD>& a ) + { + return vrndq_f32( a.native ); + } template>> FS_FORCEINLINE f32<4, SIMD> Min( const f32<4, SIMD>& a, const f32<4, SIMD>& b ) diff --git a/include/FastSIMD/ToolSet/Generic/Functions.h b/include/FastSIMD/ToolSet/Generic/Functions.h index 768e65c..01978bd 100644 --- a/include/FastSIMD/ToolSet/Generic/Functions.h +++ b/include/FastSIMD/ToolSet/Generic/Functions.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include "Register.h" diff --git a/include/FastSIMD/ToolSet/WASM/128/f32x4.h b/include/FastSIMD/ToolSet/WASM/128/f32x4.h index 98326bc..1dbd036 100644 --- a/include/FastSIMD/ToolSet/WASM/128/f32x4.h +++ b/include/FastSIMD/ToolSet/WASM/128/f32x4.h @@ -147,6 +147,12 @@ namespace FS return wasm_f32x4_floor( a.native ); } + template>> + FS_FORCEINLINE f32<4, SIMD> Trunc( const f32<4, SIMD>& a ) + { + return wasm_f32x4_trunc( a.native ); + } + template>> FS_FORCEINLINE f32<4, SIMD> Ceil( const f32<4, SIMD>& a ) {