[libc-commits] [libc] [libc][mathvec] Initial commit for LIBC vector math component (PR #173058)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Jan 9 13:51:35 PST 2026


================
@@ -0,0 +1,21 @@
+//===-- Implementation header for SIMD expf ---------------------*- 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_MATHVEC_EXPF_H
+#define LLVM_LIBC_SRC_MATHVEC_EXPF_H
+
+#include "src/__support/CPP/simd.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+cpp::simd<float> expf(cpp::simd<float> x);
----------------
jhuber6 wrote:

`cpp::simd<float>` will go to the width that's native for the current target. I think what we will want to do is just keep everything native and compile this file with multiple different ABIs set. (i.e. -msse4_2, -mavx2, -mavx512). Those variants will all produce different mangled functions that will be used if someone calls these functions with the corresponding ABI. Set this up for `tgmath` and it should be automatic if using a vector type, GNU, LLVM or otherwise.

https://github.com/llvm/llvm-project/pull/173058


More information about the libc-commits mailing list