Closed ctruta closed 6 months ago
@XiWeiGu @jinboson Could you please help us with this? https://github.com/pnggroup/libpng/blob/14a348ddc839be9539a10e9085e76d3a6fdcb58b/configure.ac#L624
I'm asking because it is not clear to me whether that section is truly needed for your platform. (It's not needed for any other SIMD-enabled platform.)
I would also appreciate it if you could please test and confirm that everything is fine and nothing got broken after the integration of commit 14a348ddc839be9539a10e9085e76d3a6fdcb58b.
Thank you, I will proceed to confirm.
I would also appreciate it if you could please test and confirm that everything is fine and nothing got broken after the integration of commit 14a348d.
Everything is fine, thank you.
I'm asking because it is not clear to me whether that section is truly needed for your platform. (It's not needed for any other SIMD-enabled platform.)
The LSX vector instruction compiler detection on the LoongArch platform is somewhat unconventional compared to other platforms, as it checks whether the compiler supports LSX during configuration. The LoongArch toolchain does not have "__loongarch_sx" by default, so the "-mlsx" option needs to be explicitly added. If the conventional method used on other platforms is followed by passing CFLGAS='-mlsx' to enable LSX optimization, the '-mlsx' flag would apply globally instead of being restricted to files under the 'loongarch' directory. This would lead to automatic vectorization in files outside the 'loongarch' directory, potentially generating 'LSX' instructions. Thus, even with runtime detection enabled, issues could still arise.
I understand. Thank you very much for the clarification.
Considering the response by @XiWeiGu, I deleted the FIXME note in commit 890231026d265f20299f47f14e47838276b2cbb4, and I released libpng-1.6.43. Hopefully, everything LSX-related is in 100% working order.
In commit 14a348ddc839be9539a10e9085e76d3a6fdcb58b, we placed the following line in configure.ac
under the guard of the Loongson platform, because it only applies to that platform.
However, we only did this as an interim solution. A full solution, in line with the rest of the
configure.ac
patterns concering SIMD optimizations, is TODO.