mirror of
https://github.com/opencv/opencv.git
synced 2024-12-27 03:14:05 +08:00
0de26fd78e
Zlib-ng is zlib replacement with optimizations for "next generation" systems. Its optimization may benifits image library decode and encode speed such as libpng. In our tests, if using zlib-ng and libpng combination on a x86_64 machine with AVX2, the time of `imdecode` amd `imencode` will drop 20% approximately. This patch enables zlib-ng's optimization if `CV_DISABLE_OPTIMIZATION` is OFF. Since Zlib-ng can dispatch intrinsics on the fly, port work is much easier. Related discussion: https://github.com/opencv/opencv/issues/22573
32 lines
876 B
C
32 lines
876 B
C
/* Helper functions to work around issues with clang builtins
|
|
* Copyright (C) 2021 IBM Corporation
|
|
*
|
|
* Authors:
|
|
* Daniel Black <daniel@linux.vnet.ibm.com>
|
|
* Rogerio Alves <rogealve@br.ibm.com>
|
|
* Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
|
|
*
|
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
*/
|
|
|
|
#ifndef POWER_BUILTINS_H
|
|
#define POWER_BUILTINS_H
|
|
|
|
/*
|
|
* These stubs fix clang incompatibilities with GCC builtins.
|
|
*/
|
|
|
|
#ifndef __builtin_crypto_vpmsumw
|
|
#define __builtin_crypto_vpmsumw __builtin_crypto_vpmsumb
|
|
#endif
|
|
#ifndef __builtin_crypto_vpmsumd
|
|
#define __builtin_crypto_vpmsumd __builtin_crypto_vpmsumb
|
|
#endif
|
|
|
|
static inline __vector unsigned long long __attribute__((overloadable))
|
|
vec_ld(int __a, const __vector unsigned long long* __b) {
|
|
return (__vector unsigned long long)__builtin_altivec_lvx(__a, __b);
|
|
}
|
|
|
|
#endif
|