Skip to content

Commit f15d2a3

Browse files
AntoinePrvclaude
andcommitted
Use plain intrinsic call in NEON wrappers (no :: or parens)
On MSVC ARM64, arm64_neon.h defines intrinsics as function-like macros that expand to cast expressions starting with '('. This means: - (OP##_u8)(a,b) → suppresses macro expansion → 'undeclared identifier' - ::OP##_u8(a,b) → expands to ::(cast)expr → C2589 'illegal token after ::' Since the wrapper functions now carry an x_ prefix (e.g. x_vaddq_u8), calling the intrinsic as OP##_u8(a,b) inside the wrapper body cannot recurse, so neither the parenthesis trick nor the :: qualifier is needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1927663 commit f15d2a3

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

include/xsimd/arch/xsimd_neon.hpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333
{ \
3434
XSIMD_INLINE auto(x_##OP##_u8)(uint8x16_t a, uint8x16_t b) noexcept -> RT<uint8x16_t> \
3535
{ \
36-
return ::OP##_u8(a, b); \
36+
return OP##_u8(a, b); \
3737
} \
3838
XSIMD_INLINE auto(x_##OP##_u16)(uint16x8_t a, uint16x8_t b) noexcept -> RT<uint16x8_t> \
3939
{ \
40-
return ::OP##_u16(a, b); \
40+
return OP##_u16(a, b); \
4141
} \
4242
XSIMD_INLINE auto(x_##OP##_u32)(uint32x4_t a, uint32x4_t b) noexcept -> RT<uint32x4_t> \
4343
{ \
44-
return ::OP##_u32(a, b); \
44+
return OP##_u32(a, b); \
4545
} \
4646
}
4747

@@ -51,15 +51,15 @@
5151
{ \
5252
XSIMD_INLINE auto(x_##OP##_s8)(int8x16_t a, int8x16_t b) noexcept -> RT<int8x16_t> \
5353
{ \
54-
return ::OP##_s8(a, b); \
54+
return OP##_s8(a, b); \
5555
} \
5656
XSIMD_INLINE auto(x_##OP##_s16)(int16x8_t a, int16x8_t b) noexcept -> RT<int16x8_t> \
5757
{ \
58-
return ::OP##_s16(a, b); \
58+
return OP##_s16(a, b); \
5959
} \
6060
XSIMD_INLINE auto(x_##OP##_s32)(int32x4_t a, int32x4_t b) noexcept -> RT<int32x4_t> \
6161
{ \
62-
return ::OP##_s32(a, b); \
62+
return OP##_s32(a, b); \
6363
} \
6464
}
6565

@@ -69,11 +69,11 @@
6969
{ \
7070
XSIMD_INLINE auto(x_##OP##_u64)(uint64x2_t a, uint64x2_t b) noexcept -> RT<uint64x2_t> \
7171
{ \
72-
return ::OP##_u64(a, b); \
72+
return OP##_u64(a, b); \
7373
} \
7474
XSIMD_INLINE auto(x_##OP##_s64)(int64x2_t a, int64x2_t b) noexcept -> RT<int64x2_t> \
7575
{ \
76-
return ::OP##_s64(a, b); \
76+
return OP##_s64(a, b); \
7777
} \
7878
}
7979

@@ -82,7 +82,7 @@
8282
{ \
8383
XSIMD_INLINE auto(x_##OP##_f32)(float32x4_t a, float32x4_t b) noexcept -> RT<float32x4_t> \
8484
{ \
85-
return ::OP##_f32(a, b); \
85+
return OP##_f32(a, b); \
8686
} \
8787
}
8888

@@ -91,27 +91,27 @@
9191
{ \
9292
XSIMD_INLINE auto(x_##OP##_u8)(uint8x16_t a) noexcept -> uint8x16_t \
9393
{ \
94-
return ::OP##_u8(a); \
94+
return OP##_u8(a); \
9595
} \
9696
XSIMD_INLINE auto(x_##OP##_s8)(int8x16_t a) noexcept -> int8x16_t \
9797
{ \
98-
return ::OP##_s8(a); \
98+
return OP##_s8(a); \
9999
} \
100100
XSIMD_INLINE auto(x_##OP##_u16)(uint16x8_t a) noexcept -> uint16x8_t \
101101
{ \
102-
return ::OP##_u16(a); \
102+
return OP##_u16(a); \
103103
} \
104104
XSIMD_INLINE auto(x_##OP##_s16)(int16x8_t a) noexcept -> int16x8_t \
105105
{ \
106-
return ::OP##_s16(a); \
106+
return OP##_s16(a); \
107107
} \
108108
XSIMD_INLINE auto(x_##OP##_u32)(uint32x4_t a) noexcept -> uint32x4_t \
109109
{ \
110-
return ::OP##_u32(a); \
110+
return OP##_u32(a); \
111111
} \
112112
XSIMD_INLINE auto(x_##OP##_s32)(int32x4_t a) noexcept -> int32x4_t \
113113
{ \
114-
return ::OP##_s32(a); \
114+
return OP##_s32(a); \
115115
} \
116116
}
117117

@@ -121,11 +121,11 @@
121121
{ \
122122
XSIMD_INLINE auto(x_##OP##_u64)(uint64x2_t a) noexcept -> uint64x2_t \
123123
{ \
124-
return ::OP##_u64(a); \
124+
return OP##_u64(a); \
125125
} \
126126
XSIMD_INLINE auto(x_##OP##_s64)(int64x2_t a) noexcept -> int64x2_t \
127127
{ \
128-
return ::OP##_s64(a); \
128+
return OP##_s64(a); \
129129
} \
130130
}
131131

@@ -134,7 +134,7 @@
134134
{ \
135135
XSIMD_INLINE auto(x_##OP##_f32)(float32x4_t a) noexcept -> float32x4_t \
136136
{ \
137-
return ::OP##_f32(a); \
137+
return OP##_f32(a); \
138138
} \
139139
}
140140

0 commit comments

Comments
 (0)