more direct mask_none all-bits-zeroes check

This commit is contained in:
dzaima 2025-02-03 03:05:33 +02:00
parent 25faa71995
commit 91800ddd1e
2 changed files with 2 additions and 1 deletions

View File

@ -206,6 +206,7 @@ if_inline (hasarch{'X86_64'}) {
include './avx'
include './avx2'
include './avx512'
def any_bit{x:[_]_} = ~and_bit_none{x, x}
} else if_inline (hasarch{'AARCH64'}) {
include 'arch/neon_intrin/basic'
include 'arch/neon_intrin/select'

View File

@ -28,7 +28,7 @@ def anyne_positive{x:V=[_]_, y:V, M if M{0}==1} = {
}
def mask_none{x} = x
def mask_none{x, 'all bits zeroes'} = and_bit_none{x, x}
def mask_none{x, 'all bits zeroes'} = ~any_bit{x}
def mask_first{n} = {
def mask{x:X, 'all bits zeroes'} = and_bit_none{x, X~~mask_of_first_bits{X,n}}