Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d0684ac1
Commit
d0684ac1
authored
Dec 15, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10309 from seiko2plus:issue10308
parents
84535a60
a8ae9cab
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
137 additions
and
1 deletion
+137
-1
CMakeLists.txt
3rdparty/libpng/CMakeLists.txt
+9
-0
filter_vsx_intrinsics.c
3rdparty/libpng/powerpc/filter_vsx_intrinsics.c
+0
-0
powerpc_init.c
3rdparty/libpng/powerpc/powerpc_init.c
+125
-0
OpenCVDetectCXXCompiler.cmake
cmake/OpenCVDetectCXXCompiler.cmake
+3
-1
No files found.
3rdparty/libpng/CMakeLists.txt
View file @
d0684ac1
...
...
@@ -43,6 +43,15 @@ if(";${CPU_BASELINE_FINAL};" MATCHES "SSE2"
add_definitions
(
-DPNG_INTEL_SSE
)
endif
()
if
(
PPC64LE OR PPC64
)
if
(
ENABLE_VSX AND NOT PPC64
)
list
(
APPEND lib_srcs powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c
)
add_definitions
(
-DPNG_POWERPC_VSX_OPT=2
)
else
()
add_definitions
(
-DPNG_POWERPC_VSX_OPT=0
)
endif
()
endif
()
# ----------------------------------------------------------------------------------
# Define the library target:
# ----------------------------------------------------------------------------------
...
...
3rdparty/libpng/powerpc/filter_vsx_intrinsics.c
0 → 100644
View file @
d0684ac1
This diff is collapsed.
Click to expand it.
3rdparty/libpng/powerpc/powerpc_init.c
0 → 100644
View file @
d0684ac1
/* powerpc_init.c - POWERPC optimised filter functions
*
* Copyright (c) 2017 Glenn Randers-Pehrson
* Written by Vadim Barkov, 2017.
* Last changed in libpng 1.6.29 [March 16, 2017]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
* called.
*/
#define _POSIX_SOURCE 1
#include <stdio.h>
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
#if PNG_POWERPC_VSX_OPT > 0
#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
/* Do run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
* run-time checks for CPU features if at all possible. In the case of the PowerPC
* VSX instructions there is no processor-specific way of detecting the
* presence of the required support, therefore run-time detection is extremely
* OS specific.
*
* You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
* a fragment of C source code which defines the png_have_vsx function. There
* are a number of implementations in contrib/powerpc-vsx, but the only one that
* has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
* implementation which reads /proc/cpufino.
*/
#ifndef PNG_POWERPC_VSX_FILE
# ifdef __linux__
# define PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
# endif
#endif
#ifdef PNG_POWERPC_VSX_FILE
#include <signal.h>
/* for sig_atomic_t */
static
int
png_have_vsx
(
png_structp
png_ptr
);
#include PNG_POWERPC_VSX_FILE
#else
/* PNG_POWERPC_VSX_FILE */
# error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
#endif
/* PNG_POWERPC_VSX_FILE */
#endif
/* PNG_POWERPC_VSX_CHECK_SUPPORTED */
void
png_init_filter_functions_vsx
(
png_structp
pp
,
unsigned
int
bpp
)
{
/* The switch statement is compiled in for POWERPC_VSX_API, the call to
* png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
* the check is only performed if the API has not set the PowerPC option on
* or off explicitly. In this case the check controls what happens.
*/
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
switch
((
pp
->
options
>>
PNG_POWERPC_VSX
)
&
3
)
{
case
PNG_OPTION_UNSET
:
/* Allow the run-time check to execute if it has been enabled -
* thus both API and CHECK can be turned on. If it isn't supported
* this case will fall through to the 'default' below, which just
* returns.
*/
#endif
/* PNG_POWERPC_VSX_API_SUPPORTED */
#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
{
static
volatile
sig_atomic_t
no_vsx
=
-
1
;
/* not checked */
if
(
no_vsx
<
0
)
no_vsx
=
!
png_have_vsx
(
pp
);
if
(
no_vsx
)
return
;
}
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
break
;
#endif
#endif
/* PNG_POWERPC_VSX_CHECK_SUPPORTED */
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
default:
/* OFF or INVALID */
return
;
case
PNG_OPTION_ON
:
/* Option turned on */
break
;
}
#endif
/* IMPORTANT: any new internal functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
*
* ./configure --with-libpng-prefix=foobar_
*
* Verify you have got this right by running the above command, doing a build
* and examining pngprefix.h; it must contain a #define for every external
* function you add. (Notice that this happens automatically for the
* initialization function.)
*/
pp
->
read_filter
[
PNG_FILTER_VALUE_UP
-
1
]
=
png_read_filter_row_up_vsx
;
if
(
bpp
==
3
)
{
pp
->
read_filter
[
PNG_FILTER_VALUE_SUB
-
1
]
=
png_read_filter_row_sub3_vsx
;
pp
->
read_filter
[
PNG_FILTER_VALUE_AVG
-
1
]
=
png_read_filter_row_avg3_vsx
;
pp
->
read_filter
[
PNG_FILTER_VALUE_PAETH
-
1
]
=
png_read_filter_row_paeth3_vsx
;
}
else
if
(
bpp
==
4
)
{
pp
->
read_filter
[
PNG_FILTER_VALUE_SUB
-
1
]
=
png_read_filter_row_sub4_vsx
;
pp
->
read_filter
[
PNG_FILTER_VALUE_AVG
-
1
]
=
png_read_filter_row_avg4_vsx
;
pp
->
read_filter
[
PNG_FILTER_VALUE_PAETH
-
1
]
=
png_read_filter_row_paeth4_vsx
;
}
}
#endif
/* PNG_POWERPC_VSX_OPT > 0 */
#endif
/* READ */
cmake/OpenCVDetectCXXCompiler.cmake
View file @
d0684ac1
...
...
@@ -72,8 +72,10 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*)")
set
(
ARM 1
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^(aarch64.*|AARCH64.*)"
)
set
(
AARCH64 1
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^
ppc64le.*|PPC64LE.*
"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^
(powerpc|ppc)64le
"
)
set
(
PPC64LE 1
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^(powerpc|ppc)64"
)
set
(
PPC64 1
)
endif
()
# Workaround for 32-bit operating systems on 64-bit x86_64 processor
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment