Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc6a43c2

Browse files
committed
Fix broken cast on MSVC
Per buildfarm animal drongo, casting a vector type to the same typecauses a compile error. We still need the cast on ARM64, so invent awrapper function that does the casting only where necessary.Discussion:https://www.postgresql.org/message-id/CAFBsxsEouaTwbmpqV%2BEW2%3DwFbhw2vHRe26NQTRcd0%3DNaOFDy7A%40mail.gmail.com
1 parent82739d4 commitc6a43c2

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

‎src/include/port/pg_lfind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pg_lfind32(uint32 key, uint32 *base, uint32 nelem)
151151
result=vector32_or(tmp1,tmp2);
152152

153153
/* see if there was a match */
154-
if (vector8_is_highbit_set((Vector8)result))
154+
if (vector32_is_highbit_set(result))
155155
{
156156
Assert(assert_result== true);
157157
return true;

‎src/include/port/simd.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,28 @@ vector8_is_highbit_set(const Vector8 v)
274274
#endif
275275
}
276276

277+
/*
278+
* Exactly like vector32_is_highbit_set except for the input type, so it
279+
* looks at each byte separately.
280+
*
281+
* XXX x86 uses the same underlying type for 8-bit, 16-bit, and 32-bit
282+
* integer elements, but Arm does not, hence the need for a separate
283+
* function. We could instead adopt the behavior of Arm's vmaxvq_u32(), i.e.
284+
* check each 32-bit element, but that would require an additional mask
285+
* operation on x86.
286+
*/
287+
#ifndefUSE_NO_SIMD
288+
staticinlinebool
289+
vector32_is_highbit_set(constVector32v)
290+
{
291+
#if defined(USE_NEON)
292+
returnvector8_is_highbit_set((Vector8)v);
293+
#else
294+
returnvector8_is_highbit_set(v);
295+
#endif
296+
}
297+
#endif/* ! USE_NO_SIMD */
298+
277299
/*
278300
* Return the bitwise OR of the inputs
279301
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp