From 44ee417d408870ec770ac9422f2d5715d3ba9d7a Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 24 Mar 2025 00:29:19 +0200 Subject: [PATCH] use pattern matching for NEON vfold cases --- src/singeli/src/neon.singeli | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/singeli/src/neon.singeli b/src/singeli/src/neon.singeli index e7859887..815f3266 100644 --- a/src/singeli/src/neon.singeli +++ b/src/singeli/src/neon.singeli @@ -62,9 +62,9 @@ def fold_add {a:T=[_]E if nvec{T}} = emit{E, ntyp{'vaddv', T}, a} def fold_addw{a:T=[_]E if nveci{T}} = emit{w_d{E}, ntyp{'vaddlv', T}, a} def fold_min {a:T=[_]E if nvec{T} and ~nveci{T,64}} = emit{E, ntyp{'vminv', T}, a} def fold_max {a:T=[_]E if nvec{T} and ~nveci{T,64}} = emit{E, ntyp{'vmaxv', T}, a} -def vfold{F, x:T if nvec{T} and ~nveci{T,64} and same{F, min}} = fold_min{x} -def vfold{F, x:T if nvec{T} and ~nveci{T,64} and same{F, max}} = fold_max{x} -def vfold{F, x:T if nvec{T} and same{F, +}} = fold_add{x} +def vfold{(min), x:T if nvec{T} and ~nveci{T,64}} = fold_min{x} +def vfold{(max), x:T if nvec{T} and ~nveci{T,64}} = fold_max{x} +def vfold{(+), x:T if nvec{T}} = fold_add{x} def store{ptr:*E, x:V=[_]E, vl if nvec{V} and vl*width{E}<=64} = { def E=ty_u{vl*width{E}}