Skip to content

Commit 0e91f6c

Browse files
authored
Fix TernaryLogic inline assembly in ppc_vsx-inl.h
Updated GCC PPC10 TernaryLogic inline assembly workaround in ppc_vsx-inl.h to prevent kTernLogOp from being incorrectly sign-extended if kTernLogOp >= 128 is true.
1 parent f444adc commit 0e91f6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hwy/ops/ppc_vsx-inl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ HWY_INLINE V TernaryLogic(V a, V b, V c) {
361361
typename detail::Raw128<TFromV<VU>>::type raw_ternlog_result;
362362
__asm__("xxeval %x0,%x1,%x2,%x3,%4"
363363
: "=wa"(raw_ternlog_result)
364-
: "wa"(a_raw), "wa"(b_raw), "wa"(c_raw), "n"(kTernLogOp)
364+
: "wa"(a_raw), "wa"(b_raw), "wa"(c_raw),
365+
"n"(static_cast<unsigned>(kTernLogOp))
365366
:);
366367
#else
367368
const auto raw_ternlog_result =

0 commit comments

Comments
 (0)