Skip to content

Commit e58e4c0

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr/abd-widen
2 parents a153a96 + f059d2b commit e58e4c0

File tree

52 files changed

+1118
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1118
-302
lines changed

clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace {
3939
// - LoopCounterName: The entire for loop (as ForStmt).
4040
// - LoopParentName: The body of function f (as CompoundStmt).
4141
// - VectorVarDeclName: 'v' (as VarDecl).
42-
// - VectorVarDeclStmatName: The entire 'std::vector<T> v;' statement (as
42+
// - VectorVarDeclStmtName: The entire 'std::vector<T> v;' statement (as
4343
// DeclStmt).
4444
// - PushBackOrEmplaceBackCallName: 'v.push_back(i)' (as cxxMemberCallExpr).
4545
// - LoopInitVarName: 'i' (as VarDecl).

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static StringRef const StyleNames[] = {
186186
m(ptrdiff_t) \
187187
m(void) \
188188

189-
static StringRef const HungarainNotationPrimitiveTypes[] = {
189+
static StringRef const HungarianNotationPrimitiveTypes[] = {
190190
#define STRINGIZE(v) #v,
191191
HUNGARIAN_NOTATION_PRIMITIVE_TYPES(STRINGIZE)
192192
#undef STRINGIZE
@@ -222,7 +222,7 @@ static StringRef const HungarainNotationPrimitiveTypes[] = {
222222
m(UINT64) \
223223
m(PVOID) \
224224

225-
static StringRef const HungarainNotationUserDefinedTypes[] = {
225+
static StringRef const HungarianNotationUserDefinedTypes[] = {
226226
#define STRINGIZE(v) #v,
227227
HUNGARIAN_NOTATION_USER_DEFINED_TYPES(STRINGIZE)
228228
#undef STRINGIZE
@@ -488,7 +488,7 @@ void IdentifierNamingCheck::HungarianNotation::loadFileConfig(
488488

489489
Buffer = {Section, "PrimitiveType."};
490490
DefSize = Buffer.size();
491-
for (const auto &PrimType : HungarainNotationPrimitiveTypes) {
491+
for (const auto &PrimType : HungarianNotationPrimitiveTypes) {
492492
Buffer.truncate(DefSize);
493493
Buffer.append(PrimType);
494494
StringRef Val = Options.get(Buffer, "");
@@ -501,7 +501,7 @@ void IdentifierNamingCheck::HungarianNotation::loadFileConfig(
501501

502502
Buffer = {Section, "UserDefinedType."};
503503
DefSize = Buffer.size();
504-
for (const auto &Type : HungarainNotationUserDefinedTypes) {
504+
for (const auto &Type : HungarianNotationUserDefinedTypes) {
505505
Buffer.truncate(DefSize);
506506
Buffer.append(Type);
507507
StringRef Val = Options.get(Buffer, "");

clang-tools-extra/clang-tidy/readability/MathMissingParenthesesCheck.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static int getPrecedence(const BinaryOperator *BinOp) {
4848
return 0;
4949
}
5050
}
51-
static void addParantheses(const BinaryOperator *BinOp,
51+
static void addParentheses(const BinaryOperator *BinOp,
5252
const BinaryOperator *ParentBinOp,
5353
ClangTidyCheck *Check,
5454
const clang::SourceManager &SM,
@@ -81,9 +81,9 @@ static void addParantheses(const BinaryOperator *BinOp,
8181
}
8282
}
8383

84-
addParantheses(dyn_cast<BinaryOperator>(BinOp->getLHS()->IgnoreImpCasts()),
84+
addParentheses(dyn_cast<BinaryOperator>(BinOp->getLHS()->IgnoreImpCasts()),
8585
BinOp, Check, SM, LangOpts);
86-
addParantheses(dyn_cast<BinaryOperator>(BinOp->getRHS()->IgnoreImpCasts()),
86+
addParentheses(dyn_cast<BinaryOperator>(BinOp->getRHS()->IgnoreImpCasts()),
8787
BinOp, Check, SM, LangOpts);
8888
}
8989

@@ -92,7 +92,7 @@ void MathMissingParenthesesCheck::check(
9292
const auto *BinOp = Result.Nodes.getNodeAs<BinaryOperator>("binOp");
9393
const SourceManager &SM = *Result.SourceManager;
9494
const clang::LangOptions &LO = Result.Context->getLangOpts();
95-
addParantheses(BinOp, nullptr, this, SM, LO);
95+
addParentheses(BinOp, nullptr, this, SM, LO);
9696
}
9797

9898
} // namespace clang::tidy::readability

clang/test/CodeGen/allow-ubsan-check.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
// TR-NEXT: [[TMP9:%.*]] = and i1 [[TMP5]], [[TMP8]], !nosanitize [[META2]]
5252
// TR-NEXT: br i1 [[TMP9]], label %[[CONT:.*]], label %[[TRAP:.*]], !prof [[PROF3:![0-9]+]], !nosanitize [[META2]]
5353
// TR: [[TRAP]]:
54-
// TR-NEXT: tail call void @llvm.ubsantrap(i8 3) #[[ATTR5:[0-9]+]], !nosanitize [[META2]]
54+
// TR-NEXT: tail call void @llvm.ubsantrap(i8 3) #[[ATTR7:[0-9]+]], !nosanitize [[META2]]
5555
// TR-NEXT: unreachable, !nosanitize [[META2]]
5656
// TR: [[CONT]]:
5757
// TR-NEXT: [[DIV:%.*]] = sdiv i32 [[X]], [[Y]]
@@ -102,14 +102,14 @@ int div(int x, int y) {
102102
// CHECK-NEXT: ret i32 [[TMP2]]
103103
//
104104
// TR-LABEL: define dso_local i32 @null(
105-
// TR-SAME: ptr noundef readonly captures(address_is_null) [[X:%.*]]) local_unnamed_addr #[[ATTR0]] {
105+
// TR-SAME: ptr noundef readonly captures(address_is_null) [[X:%.*]]) local_unnamed_addr #[[ATTR3:[0-9]+]] {
106106
// TR-NEXT: [[ENTRY:.*:]]
107107
// TR-NEXT: [[TMP0:%.*]] = icmp eq ptr [[X]], null, !nosanitize [[META2]]
108108
// TR-NEXT: [[TMP1:%.*]] = tail call i1 @llvm.allow.ubsan.check(i8 29), !nosanitize [[META2]]
109109
// TR-NEXT: [[DOTNOT1:%.*]] = and i1 [[TMP0]], [[TMP1]]
110110
// TR-NEXT: br i1 [[DOTNOT1]], label %[[TRAP:.*]], label %[[CONT:.*]], !prof [[PROF4:![0-9]+]], !nosanitize [[META2]]
111111
// TR: [[TRAP]]:
112-
// TR-NEXT: tail call void @llvm.ubsantrap(i8 22) #[[ATTR5]], !nosanitize [[META2]]
112+
// TR-NEXT: tail call void @llvm.ubsantrap(i8 22) #[[ATTR7]], !nosanitize [[META2]]
113113
// TR-NEXT: unreachable, !nosanitize [[META2]]
114114
// TR: [[CONT]]:
115115
// TR-NEXT: [[TMP2:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA5:![0-9]+]]
@@ -161,7 +161,7 @@ int null(int* x) {
161161
// TR-NEXT: [[DOTDEMORGAN:%.*]] = and i1 [[TMP1]], [[TMP2]]
162162
// TR-NEXT: br i1 [[DOTDEMORGAN]], label %[[TRAP:.*]], label %[[CONT:.*]], !prof [[PROF4]], !nosanitize [[META2]]
163163
// TR: [[TRAP]]:
164-
// TR-NEXT: tail call void @llvm.ubsantrap(i8 0) #[[ATTR5]], !nosanitize [[META2]]
164+
// TR-NEXT: tail call void @llvm.ubsantrap(i8 0) #[[ATTR7]], !nosanitize [[META2]]
165165
// TR-NEXT: unreachable, !nosanitize [[META2]]
166166
// TR: [[CONT]]:
167167
// TR-NEXT: [[TMP3:%.*]] = extractvalue { i32, i1 } [[TMP0]], 0, !nosanitize [[META2]]
@@ -212,11 +212,11 @@ void use(double*);
212212
// CHECK-NEXT: unreachable, !nosanitize [[META2]]
213213
//
214214
// TR-LABEL: define dso_local double @lbounds(
215-
// TR-SAME: i32 noundef [[B:%.*]], i32 noundef [[I:%.*]]) local_unnamed_addr #[[ATTR0]] {
215+
// TR-SAME: i32 noundef [[B:%.*]], i32 noundef [[I:%.*]]) local_unnamed_addr #[[ATTR5:[0-9]+]] {
216216
// TR-NEXT: [[ENTRY:.*:]]
217217
// TR-NEXT: [[TMP0:%.*]] = zext i32 [[B]] to i64
218218
// TR-NEXT: [[VLA:%.*]] = alloca double, i64 [[TMP0]], align 16
219-
// TR-NEXT: call void @use(ptr noundef nonnull [[VLA]]) #[[ATTR6:[0-9]+]]
219+
// TR-NEXT: call void @use(ptr noundef nonnull [[VLA]]) #[[ATTR8:[0-9]+]]
220220
// TR-NEXT: [[IDXPROM:%.*]] = sext i32 [[I]] to i64
221221
// TR-NEXT: [[TMP1:%.*]] = icmp ule i64 [[TMP0]], [[IDXPROM]]
222222
// TR-NEXT: [[TMP2:%.*]] = call i1 @llvm.allow.ubsan.check(i8 71), !nosanitize [[META2]]
@@ -227,7 +227,7 @@ void use(double*);
227227
// TR-NEXT: [[TMP5:%.*]] = load double, ptr [[ARRAYIDX]], align 8, !tbaa [[TBAA9:![0-9]+]]
228228
// TR-NEXT: ret double [[TMP5]]
229229
// TR: [[TRAP]]:
230-
// TR-NEXT: call void @llvm.ubsantrap(i8 71) #[[ATTR5]], !nosanitize [[META2]]
230+
// TR-NEXT: call void @llvm.ubsantrap(i8 71) #[[ATTR7]], !nosanitize [[META2]]
231231
// TR-NEXT: unreachable, !nosanitize [[META2]]
232232
//
233233
// REC-LABEL: define dso_local double @lbounds(

libc/cmake/modules/CheckCompilerFeatures.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ set(
1515
"fixed_point"
1616
"cfloat16"
1717
"cfloat128"
18+
"ext_vector_type"
1819
)
1920

2021
# Making sure ALL_COMPILER_FEATURES is sorted.
@@ -126,6 +127,8 @@ foreach(feature IN LISTS ALL_COMPILER_FEATURES)
126127
set(LIBC_COMPILER_HAS_BUILTIN_ROUND TRUE)
127128
elseif(${feature} STREQUAL "builtin_roundeven")
128129
set(LIBC_COMPILER_HAS_BUILTIN_ROUNDEVEN TRUE)
130+
elseif(${feature} STREQUAL "ext_vector_type")
131+
set(LIBC_COMPILER_HAS_EXT_VECTOR_TYPE TRUE)
129132
endif()
130133
endif()
131134
endforeach()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "src/__support/macros/attributes.h"
2+
3+
#if !LIBC_HAS_VECTOR_TYPE
4+
#error unsupported
5+
#endif
6+
7+
bool [[clang::ext_vector_type(1)]] v;

libc/src/__support/CPP/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ add_object_library(
212212
libc.src.__support.macros.properties.os
213213
)
214214

215+
add_header_library(
216+
tuple
217+
HDRS
218+
tuple.h
219+
DEPENDS
220+
.utility
221+
)
222+
215223
add_header_library(
216224
simd
217225
HDRS

libc/src/__support/CPP/simd.h

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ using get_as_integer_type_t = unsigned _BitInt(sizeof(T) * CHAR_BIT);
3737

3838
#if defined(LIBC_TARGET_CPU_HAS_AVX512F)
3939
template <typename T>
40-
inline constexpr size_t native_vector_size = 64 / sizeof(T);
40+
LIBC_INLINE_VAR constexpr size_t native_vector_size = 64 / sizeof(T);
4141
#elif defined(LIBC_TARGET_CPU_HAS_AVX2)
4242
template <typename T>
43-
inline constexpr size_t native_vector_size = 32 / sizeof(T);
43+
LIBC_INLINE_VAR constexpr size_t native_vector_size = 32 / sizeof(T);
4444
#elif defined(LIBC_TARGET_CPU_HAS_SSE2) || defined(LIBC_TARGET_CPU_HAS_ARM_NEON)
4545
template <typename T>
46-
inline constexpr size_t native_vector_size = 16 / sizeof(T);
46+
LIBC_INLINE_VAR constexpr size_t native_vector_size = 16 / sizeof(T);
4747
#else
48-
template <typename T> inline constexpr size_t native_vector_size = 1;
48+
template <typename T> LIBC_INLINE constexpr size_t native_vector_size = 1;
4949
#endif
5050

5151
template <typename T> LIBC_INLINE constexpr T poison() {
@@ -90,122 +90,127 @@ using enable_if_simd_t = cpp::enable_if_t<is_simd_v<T>, T>;
9090

9191
// Casting.
9292
template <typename To, typename From, size_t N>
93-
LIBC_INLINE constexpr simd<To, N> simd_cast(simd<From, N> v) {
93+
LIBC_INLINE constexpr static simd<To, N> simd_cast(simd<From, N> v) {
9494
return __builtin_convertvector(v, simd<To, N>);
9595
}
9696

9797
// SIMD mask operations.
98-
template <size_t N> LIBC_INLINE constexpr bool all_of(simd<bool, N> m) {
98+
template <size_t N> LIBC_INLINE constexpr static bool all_of(simd<bool, N> m) {
9999
return __builtin_reduce_and(m);
100100
}
101-
template <size_t N> LIBC_INLINE constexpr bool any_of(simd<bool, N> m) {
101+
template <size_t N> LIBC_INLINE constexpr static bool any_of(simd<bool, N> m) {
102102
return __builtin_reduce_or(m);
103103
}
104-
template <size_t N> LIBC_INLINE constexpr bool none_of(simd<bool, N> m) {
104+
template <size_t N> LIBC_INLINE constexpr static bool none_of(simd<bool, N> m) {
105105
return !any_of(m);
106106
}
107-
template <size_t N> LIBC_INLINE constexpr bool some_of(simd<bool, N> m) {
107+
template <size_t N> LIBC_INLINE constexpr static bool some_of(simd<bool, N> m) {
108108
return any_of(m) && !all_of(m);
109109
}
110-
template <size_t N> LIBC_INLINE constexpr int popcount(simd<bool, N> m) {
110+
template <size_t N> LIBC_INLINE constexpr static int popcount(simd<bool, N> m) {
111111
return __builtin_popcountg(m);
112112
}
113-
template <size_t N> LIBC_INLINE constexpr int find_first_set(simd<bool, N> m) {
113+
template <size_t N>
114+
LIBC_INLINE constexpr static int find_first_set(simd<bool, N> m) {
114115
return __builtin_ctzg(m);
115116
}
116-
template <size_t N> LIBC_INLINE constexpr int find_last_set(simd<bool, N> m) {
117+
template <size_t N>
118+
LIBC_INLINE constexpr static int find_last_set(simd<bool, N> m) {
117119
constexpr size_t size = simd_size_v<simd<bool, N>>;
118-
return size - __builtin_clzg(m);
120+
return size - 1 - __builtin_clzg(m);
119121
}
120122

121123
// Elementwise operations.
122124
template <typename T, size_t N>
123-
LIBC_INLINE constexpr simd<T, N> min(simd<T, N> x, simd<T, N> y) {
125+
LIBC_INLINE constexpr static simd<T, N> min(simd<T, N> x, simd<T, N> y) {
124126
return __builtin_elementwise_min(x, y);
125127
}
126128
template <typename T, size_t N>
127-
LIBC_INLINE constexpr simd<T, N> max(simd<T, N> x, simd<T, N> y) {
129+
LIBC_INLINE constexpr static simd<T, N> max(simd<T, N> x, simd<T, N> y) {
128130
return __builtin_elementwise_max(x, y);
129131
}
130132

131133
template <typename T, size_t N>
132-
LIBC_INLINE constexpr simd<T, N> abs(simd<T, N> x) {
134+
LIBC_INLINE constexpr static simd<T, N> abs(simd<T, N> x) {
133135
return __builtin_elementwise_abs(x);
134136
}
135137
template <typename T, size_t N>
136-
LIBC_INLINE constexpr simd<T, N> fma(simd<T, N> x, simd<T, N> y, simd<T, N> z) {
138+
LIBC_INLINE constexpr static simd<T, N> fma(simd<T, N> x, simd<T, N> y,
139+
simd<T, N> z) {
137140
return __builtin_elementwise_fma(x, y, z);
138141
}
139142
template <typename T, size_t N>
140-
LIBC_INLINE constexpr simd<T, N> ceil(simd<T, N> x) {
143+
LIBC_INLINE constexpr static simd<T, N> ceil(simd<T, N> x) {
141144
return __builtin_elementwise_ceil(x);
142145
}
143146
template <typename T, size_t N>
144-
LIBC_INLINE constexpr simd<T, N> floor(simd<T, N> x) {
147+
LIBC_INLINE constexpr static simd<T, N> floor(simd<T, N> x) {
145148
return __builtin_elementwise_floor(x);
146149
}
147150
template <typename T, size_t N>
148-
LIBC_INLINE constexpr simd<T, N> roundeven(simd<T, N> x) {
151+
LIBC_INLINE constexpr static simd<T, N> roundeven(simd<T, N> x) {
149152
return __builtin_elementwise_roundeven(x);
150153
}
151154
template <typename T, size_t N>
152-
LIBC_INLINE constexpr simd<T, N> round(simd<T, N> x) {
155+
LIBC_INLINE constexpr static simd<T, N> round(simd<T, N> x) {
153156
return __builtin_elementwise_round(x);
154157
}
155158
template <typename T, size_t N>
156-
LIBC_INLINE constexpr simd<T, N> trunc(simd<T, N> x) {
159+
LIBC_INLINE constexpr static simd<T, N> trunc(simd<T, N> x) {
157160
return __builtin_elementwise_trunc(x);
158161
}
159162
template <typename T, size_t N>
160-
LIBC_INLINE constexpr simd<T, N> nearbyint(simd<T, N> x) {
163+
LIBC_INLINE constexpr static simd<T, N> nearbyint(simd<T, N> x) {
161164
return __builtin_elementwise_nearbyint(x);
162165
}
163166
template <typename T, size_t N>
164-
LIBC_INLINE constexpr simd<T, N> rint(simd<T, N> x) {
167+
LIBC_INLINE constexpr static simd<T, N> rint(simd<T, N> x) {
165168
return __builtin_elementwise_rint(x);
166169
}
167170
template <typename T, size_t N>
168-
LIBC_INLINE constexpr simd<T, N> canonicalize(simd<T, N> x) {
171+
LIBC_INLINE constexpr static simd<T, N> canonicalize(simd<T, N> x) {
169172
return __builtin_elementwise_canonicalize(x);
170173
}
171174
template <typename T, size_t N>
172-
LIBC_INLINE constexpr simd<T, N> copysign(simd<T, N> x, simd<T, N> y) {
175+
LIBC_INLINE constexpr static simd<T, N> copysign(simd<T, N> x, simd<T, N> y) {
173176
return __builtin_elementwise_copysign(x, y);
174177
}
175178
template <typename T, size_t N>
176-
LIBC_INLINE constexpr simd<T, N> fmod(simd<T, N> x, simd<T, N> y) {
179+
LIBC_INLINE constexpr static simd<T, N> fmod(simd<T, N> x, simd<T, N> y) {
177180
return __builtin_elementwise_fmod(x, y);
178181
}
179182

180183
// Reduction operations.
181184
template <typename T, size_t N, typename Op = cpp::plus<>>
182-
LIBC_INLINE constexpr T reduce(simd<T, N> v, Op op = {}) {
185+
LIBC_INLINE constexpr static T reduce(simd<T, N> v, Op op = {}) {
183186
return reduce(v, op);
184187
}
185188
template <typename T, size_t N>
186-
LIBC_INLINE constexpr T reduce(simd<T, N> v, cpp::plus<>) {
189+
LIBC_INLINE constexpr static T reduce(simd<T, N> v, cpp::plus<>) {
187190
return __builtin_reduce_add(v);
188191
}
189192
template <typename T, size_t N>
190-
LIBC_INLINE constexpr T reduce(simd<T, N> v, cpp::multiplies<>) {
193+
LIBC_INLINE constexpr static T reduce(simd<T, N> v, cpp::multiplies<>) {
191194
return __builtin_reduce_mul(v);
192195
}
193196
template <typename T, size_t N>
194-
LIBC_INLINE constexpr T reduce(simd<T, N> v, cpp::bit_and<>) {
197+
LIBC_INLINE constexpr static T reduce(simd<T, N> v, cpp::bit_and<>) {
195198
return __builtin_reduce_and(v);
196199
}
197200
template <typename T, size_t N>
198-
LIBC_INLINE constexpr T reduce(simd<T, N> v, cpp::bit_or<>) {
201+
LIBC_INLINE constexpr static T reduce(simd<T, N> v, cpp::bit_or<>) {
199202
return __builtin_reduce_or(v);
200203
}
201204
template <typename T, size_t N>
202-
LIBC_INLINE constexpr T reduce(simd<T, N> v, cpp::bit_xor<>) {
205+
LIBC_INLINE constexpr static T reduce(simd<T, N> v, cpp::bit_xor<>) {
203206
return __builtin_reduce_xor(v);
204207
}
205-
template <typename T, size_t N> LIBC_INLINE constexpr T hmin(simd<T, N> v) {
208+
template <typename T, size_t N>
209+
LIBC_INLINE constexpr static T hmin(simd<T, N> v) {
206210
return __builtin_reduce_min(v);
207211
}
208-
template <typename T, size_t N> LIBC_INLINE constexpr T hmax(simd<T, N> v) {
212+
template <typename T, size_t N>
213+
LIBC_INLINE constexpr static T hmax(simd<T, N> v) {
209214
return __builtin_reduce_max(v);
210215
}
211216

@@ -242,28 +247,29 @@ LIBC_INLINE enable_if_simd_t<T> masked_store(simd<bool, simd_size_v<T>> m, T v,
242247
}
243248

244249
// Construction helpers.
245-
template <typename T, size_t N> LIBC_INLINE constexpr simd<T, N> splat(T v) {
250+
template <typename T, size_t N>
251+
LIBC_INLINE constexpr static simd<T, N> splat(T v) {
246252
return simd<T, N>(v);
247253
}
248-
template <typename T> LIBC_INLINE constexpr simd<T> splat(T v) {
254+
template <typename T> LIBC_INLINE constexpr static simd<T> splat(T v) {
249255
return splat<T, simd_size_v<simd<T>>>(v);
250256
}
251257
template <typename T, unsigned N>
252-
LIBC_INLINE constexpr simd<T, N> iota(T base = T(0), T step = T(1)) {
258+
LIBC_INLINE constexpr static simd<T, N> iota(T base = T(0), T step = T(1)) {
253259
simd<T, N> v{};
254260
for (unsigned i = 0; i < N; ++i)
255261
v[i] = base + T(i) * step;
256262
return v;
257263
}
258264
template <typename T>
259-
LIBC_INLINE constexpr simd<T> iota(T base = T(0), T step = T(1)) {
265+
LIBC_INLINE constexpr static simd<T> iota(T base = T(0), T step = T(1)) {
260266
return iota<T, simd_size_v<simd<T>>>(base, step);
261267
}
262268

263269
// Conditional helpers.
264270
template <typename T, size_t N>
265-
LIBC_INLINE constexpr simd<T, N> select(simd<bool, N> m, simd<T, N> x,
266-
simd<T, N> y) {
271+
LIBC_INLINE constexpr static simd<T, N> select(simd<bool, N> m, simd<T, N> x,
272+
simd<T, N> y) {
267273
return m ? x : y;
268274
}
269275

0 commit comments

Comments
 (0)