From bb9adfdad99656b04af45ae64f7b09e55669c1ed Mon Sep 17 00:00:00 2001 From: John Bowler Date: Thu, 24 Oct 2013 07:45:27 -0500 Subject: [PATCH] [libpng16] Allow clang derived from older GCC versions to use ARM intrinsics. --- ANNOUNCE | 8 ++++++-- CHANGES | 6 +++++- pngpriv.h | 9 +++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 3d7afd2f6..325124aef 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.6.7beta04 - October 19, 2013 +Libpng 1.6.7beta04 - October 24, 2013 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -80,7 +80,11 @@ Version 1.6.7beta03 [October 19, 2013] Cleaned up ARM NEON compilation handling. The tests are now in pngpriv.h and detect the broken GCC compilers. -Version 1.6.7beta04 [October 19, 2013] +Version 1.6.7beta04 [October 24, 2013] + Allow clang derived from older GCC versions to use ARM intrinsics. This + causes all clang builds that use -mfpu=neon to use the intrinsics code, + not the assembler code. This has only been tested on iOS 7. It may be + necessary to exclude some earlier clang versions but this seems unlikely. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index ce26dcf0a..e8915e53d 100644 --- a/CHANGES +++ b/CHANGES @@ -4694,7 +4694,11 @@ Version 1.6.7beta03 [October 19, 2013] Cleaned up ARM NEON compilation handling. The tests are now in pngpriv.h and detect the broken GCC compilers. -Version 1.6.7beta04 [October 19, 2013] +Version 1.6.7beta04 [October 24, 2013] + Allow clang derived from older GCC versions to use ARM intrinsics. This + causes all clang builds that use -mfpu=neon to use the intrinsics code, + not the assembler code. This has only been tested on iOS 7. It may be + necessary to exclude some earlier clang versions but this seems unlikely. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngpriv.h b/pngpriv.h index 44fcf26aa..c509980b4 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -142,14 +142,19 @@ /* Put compiler specific checks below: */ #ifndef PNG_USE_ARM_NEON_ASM -# ifdef __GNUC__ +# if defined(__clang__) + /* At present it is unknown by the libpng developers which versions of + * clang support the intrinsics, however some or perhaps all versions + * do not work with the assembler so this may be irrelevant. + */ +# elif defined(__GNUC__) /* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to work, * so if this *is* GCC, or G++, look for a version >4.5 */ # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) # define PNG_USE_ARM_NEON_ASM # endif -# endif +# endif /* __GNUC__ */ #endif /* Is this a build of a DLL where compilation of the object modules requires