more F16 tests

This commit is contained in:
Jorijn van der Graaf 2026-03-24 04:41:03 +01:00
commit 6b15089e24
2 changed files with 203 additions and 40 deletions

View file

@ -467,11 +467,12 @@ namespace Crafter {
}
}
constexpr static _Float16 Dot(VectorF16<Len, 1> a, VectorF16<Len, 1> b) {
constexpr static _Float16 Dot(VectorF16<Len, Packing> a, VectorF16<Len, Packing> b) requires(Packing == 1) {
if constexpr(std::is_same_v<VectorType, __m128h>) {
__m128h mul = _mm_mul_ph(a.v, b.v);
return _mm_reduce_add_ph(mul);
} else if constexpr(std::is_same_v<VectorType, __m256h>) {
static_assert(std::is_same_v<decltype(a.v), VectorType>, "a.v is NOT VectorType");
__m256h mul = _mm256_mul_ph(a.v, b.v);
return _mm256_reduce_add_ph(mul);
} else {