Skip to content

xsimd: fix architecture deduction on amd64 with march=native

Building Krita with march=native breaks a few assumptions existing in my and Dmitry's code, namely:

  • KoOptimizedPixelDataScalerU8ToU16 can't deduce the AVX batch type correctly on <= SSE4.1

  • KoRgbaInterleavers can't select the correct implementation for AVX, because the AVX2 implementation is ifdef'd in instead of the AVX version

These assumptions are correct when building Krita with standard compiler flags, which is why this bug cannot be reproduced in CI or locally out of the box.

BUG: 458033

Test Plan

Configure and build Krita with the environment variables CFLAGS="-march=native" and CXXFLAGS="-march=native" set.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports