Skip to content

Commit

Permalink
Try #1744:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Nov 2, 2021
2 parents 7c7b228 + 5402d5e commit 00a041f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion arbor/include/arbor/simd/sve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,28 @@ struct sve_double {
return copy_from(r);
}

static svfloat64_t cos(const svfloat64_t& x) {
auto len = svlen_f64(x);
double a[len], r[len];
copy_to(x, a);

for (unsigned i = 0; i<len; ++i) {
r[i] = std::cos(a[i]);
}
return copy_from(r);
}

static svfloat64_t sin(const svfloat64_t& x) {
auto len = svlen_f64(x);
double a[len], r[len];
copy_to(x, a);

for (unsigned i = 0; i<len; ++i) {
r[i] = std::sin(a[i]);
}
return copy_from(r);
}

static unsigned simd_width(const svfloat64_t& m) {
return svlen_f64(m);
}
Expand Down Expand Up @@ -671,7 +693,7 @@ auto name(const typename detail::simd_traits<typename detail::sve_type_to_impl<T

ARB_PP_FOREACH(ARB_SVE_BINARY_ARITHMETIC_, add, sub, mul, div, pow, max, min)
ARB_PP_FOREACH(ARB_SVE_BINARY_ARITHMETIC_, cmp_eq, cmp_neq, cmp_leq, cmp_lt, cmp_geq, cmp_gt, logical_and, logical_or)
ARB_PP_FOREACH(ARB_SVE_UNARY_ARITHMETIC_, logical_not, neg, abs, exp, log, expm1, exprelr)
ARB_PP_FOREACH(ARB_SVE_UNARY_ARITHMETIC_, logical_not, neg, abs, exp, log, expm1, exprelr, cos, sin)

#undef ARB_SVE_UNARY_ARITHMETIC_
#undef ARB_SVE_BINARY_ARITHMETIC_
Expand Down

0 comments on commit 00a041f

Please sign in to comment.