From 77edc734e86027b29c0e4ad2d8e66e4c5529bf32 Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 15 Dec 2022 00:37:17 +0200 Subject: [PATCH] move storeLow & loadLow to sse3 & avx; fix NEON __not --- src/singeli/src/avx.singeli | 7 +++++++ src/singeli/src/bitops.singeli | 2 +- src/singeli/src/mask.singeli | 19 ------------------- src/singeli/src/neon.singeli | 2 +- src/singeli/src/sse3.singeli | 11 +++++++++++ 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/singeli/src/avx.singeli b/src/singeli/src/avx.singeli index dfbc59da..40b017e1 100644 --- a/src/singeli/src/avx.singeli +++ b/src/singeli/src/avx.singeli @@ -28,6 +28,13 @@ def storea{a:T, n, v & w256f{eltype{T},64}} = emit{void, '_mm256_store_pd', *f6 def store {a:T, n, v & w256f{eltype{T},32}} = emit{void, '_mm256_storeu_ps', *f32 ~~ (a+n), v} def storea{a:T, n, v & w256f{eltype{T},32}} = emit{void, '_mm256_store_ps', *f32 ~~ (a+n), v} +def loadLow{ptr:P, w & w256{eltype{P}} & w<=128} = undefPromote{eltype{P}, loadLow{*[16]u8 ~~ ptr, w}} +def loadLow{ptr:P, w & w256{eltype{P}} & w==256} = load{ptr} + +def storeLow{ptr:P, w, x:T & w256{T} & w<=128} = storeLow{ptr, w, half{x, 0}} +def storeLow{ptr:P, w, x:T & w256{T} & w==256} = store{*T~~ptr, 0, x} + + # broadcast def broadcast{T, v & w256i{T, 8}} = emit{T, '_mm256_set1_epi8', promote{eltype{T},v}} def broadcast{T, v & w256i{T, 16}} = emit{T, '_mm256_set1_epi16', promote{eltype{T},v}} diff --git a/src/singeli/src/bitops.singeli b/src/singeli/src/bitops.singeli index 091aa012..18507fe6 100644 --- a/src/singeli/src/bitops.singeli +++ b/src/singeli/src/bitops.singeli @@ -56,7 +56,7 @@ def spreadBits{T==[32]u8, a:u32} = { e:= make{[32]u8, 1<