Re: [PATCH] cmake: Default to PNG_ARM_NEON=off for arm targets

John Bowler <[email protected]> Fri, 14 Oct 2022 13:49:06 -0700
Newsgroups gmane.comp.graphics.png.devel
Message-ID <CAP7U399qXcJaZ3DH+du=MhWuq7t=2BgfOu-2sJs+pm6Zp9uTUQ@mail.gmail.com>
--===============6062431352811464147==
Content-Type: multipart/alternative; boundary="0000000000006f347f05eb04c2bf"

--0000000000006f347f05eb04c2bf
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 14, 2022 at 1:27 PM Martin Storsj=C3=B6 <[email protected]> wrot=
e:

>
> While you do get hardware optimizations enabled by default in both the
> CMake and configure builds, in the CMake build it's done by building
> everything with -DPNG_ARM_NEON_OPT=3D2, while in the case of the configur=
e
> build, it's done by having pngpriv.h enable it based on the compiler's
> default configuration.
>
> I've just verified that by putting #else/#error into pngpriv.h.  My Ubunt=
u
build does error out.

I'll see if I can verify the behavior on armv7l, but I'm pretty sure your
description is accurate for ARM.  I just tried the same #else/#error test
for INTEL SSE and it is doing the same thing, except that it defaults to
'on' and therefore bypasses the compiler checks.  This was hidden before
because of the bug that I fixed, which perma-disabled the optimisations.

There are four different byte-size instruction sets on the various ARM
chips and they can all be supported in the same core; 8-bit(Java),
16-bit(Thumb), 32-bit(original ARM), 64-bit(AArch64).  Switching can be
done at run-time; last time I tried it (building a 16-bit Linux system) it
was possible to intermingle 32-bit and 16-bit functions; the CPU
instruction mode was switched in a trampoline inserted before the actual
function implementation.

--0000000000006f347f05eb04c2bf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Fri, Oct 14, 2022 at 1:27 PM Martin St=
orsj=C3=B6 &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt;=
 wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex"><br>
While you do get hardware optimizations enabled by default in both the <br>
CMake and configure builds, in the CMake build it&#39;s done by building <b=
r>
everything with -DPNG_ARM_NEON_OPT=3D2, while in the case of the configure =
<br>
build, it&#39;s done by having pngpriv.h enable it based on the compiler&#3=
9;s <br>
default configuration.<br><br></blockquote><div>I&#39;ve just verified that=
 by putting #else/#error into pngpriv.h.=C2=A0 My Ubuntu build does error o=
ut.<br></div><div><br></div><div>I&#39;ll see if I can verify the behavior =
on armv7l, but I&#39;m pretty sure your description is accurate for ARM.=C2=
=A0 I just tried the same #else/#error test for INTEL SSE and it is doing t=
he same thing, except that it defaults to &#39;on&#39; and therefore bypass=
es the compiler checks.=C2=A0 This was hidden before because of the bug tha=
t I fixed, which perma-disabled the optimisations.</div><div><br></div><div=
>There are four different byte-size instruction sets on the various ARM chi=
ps and they can all be supported in the same core; 8-bit(Java), 16-bit(Thum=
b), 32-bit(original ARM), 64-bit(AArch64).=C2=A0 Switching can be done at r=
un-time; last time I tried it (building a 16-bit Linux system) it was possi=
ble to intermingle 32-bit and 16-bit functions; the CPU instruction mode wa=
s switched in a trampoline inserted before the actual function implementati=
on.</div><div><br></div></div></div>

--0000000000006f347f05eb04c2bf--


--===============6062431352811464147==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============6062431352811464147==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
png-mng-implement mailing list
png-mng-implement-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

--===============6062431352811464147==--