Skip to content

Guard F16C intrinsic behind compiler feature macro#1

Closed
AuthenticSm1les wants to merge 1 commit intoMis012:with-patches-appliedfrom
AuthenticSm1les:codex/guard-f16c-intrinsic
Closed

Guard F16C intrinsic behind compiler feature macro#1
AuthenticSm1les wants to merge 1 commit intoMis012:with-patches-appliedfrom
AuthenticSm1les:codex/guard-f16c-intrinsic

Conversation

@AuthenticSm1les
Copy link
Copy Markdown

@AuthenticSm1les AuthenticSm1les commented Apr 9, 2026

Summary

Guard the AVX F16C skcms path behind F16C so generic x86_64 builds with Clang 22 do not try to use __builtin_ia32_vcvtph2ps256 when the compiler target does not enable F16C.

Root cause

The current code in modules/skcms/src/Transform_inl.h uses:

#elif defined(USING_AVX_F16C)
typedef int16_t attribute((vector_size(16))) I16;
return __builtin_ia32_vcvtph2ps256((I16)half);

In the failing package build, skcms.cc is compiled with a generic x86-64 target (-march=x86-64 -mtune=generic) and without -mf16c. Under Clang 22 that means the builtin is not declared, so the build fails with:

  • use of undeclared identifier __builtin_ia32_vcvtph2ps256
  • the follow-on type mismatch error from the failed builtin resolution

Why this change

Changing the condition to defined(USING_AVX_F16C) && defined(F16C) makes the fast path depend on the compiler target actually enabling F16C. If F16C is not enabled, the existing scalar fallback is used instead.

Impact

This unblocks the current AUR skia-sharp-atl build used by android_translation_layer on Arch Linux with Clang 22, while preserving the optimized path for builds that do enable F16C.

Validation

  • Reproduced the original AUR failure in skia-sharp-atl
  • Verified the failing file and line on with-patches-applied at ced64f6
  • Applied this one-line guard in the same branch

@AuthenticSm1les AuthenticSm1les closed this by deleting the head repository Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant