[libc-commits] [libc] [libc][mathvec] Add loop over scalar for unary FP32 (PR #199273)
via libc-commits
libc-commits at lists.llvm.org
Tue Jul 7 08:56:48 PDT 2026
================
@@ -0,0 +1,34 @@
+//===-- Implementation header for SIMD acosf ------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC___SUPPORT_MATHVEC_ACOSF_H
+#define LLVM_LIBC_SRC___SUPPORT_MATHVEC_ACOSF_H
+
+#include "src/__support/CPP/simd.h"
+#define LIBC_MATH (LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)
+#include "src/__support/math/acosf.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+namespace mathvec {
+
+template <size_t N>
+LIBC_INLINE cpp::simd<float, N> acosf(cpp::simd<float, N> x) {
+ cpp::simd<float, N> result;
----------------
lntue wrote:
+1 on @jhuber6 's comment. We did some discussion on this earlier, and in the end we opted for not providing the entire C++ SIMD wrapper class. At the initial phase of implementations, I would prefer somewhat nimble and lightweight, with a bit of extra code duplication, that will allow us to modify / make local adjustment independently without affecting much of other parts. Once the implementations are solidified, we can think of cleaning up / abstracting things more. But otherwise, we will have to deal with abstractions / target support / comparing with Highway / ... without much benefits on the actual implementations.
https://github.com/llvm/llvm-project/pull/199273
More information about the libc-commits
mailing list