Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
7d07ee5a
Commit
7d07ee5a
authored
May 10, 2015
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc: cpu: Add support for VSX and POWER8 extensions
parent
da60b99a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
cpu.h
libavutil/cpu.h
+2
-0
cpu.c
libavutil/ppc/cpu.c
+17
-3
cpu.h
libavutil/ppc/cpu.h
+2
-0
No files found.
libavutil/cpu.h
View file @
7d07ee5a
...
@@ -54,6 +54,8 @@
...
@@ -54,6 +54,8 @@
#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2
#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2
#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06
#define AV_CPU_FLAG_POWER8 0x0004 ///< ISA 2.07
#define AV_CPU_FLAG_ARMV5TE (1 << 0)
#define AV_CPU_FLAG_ARMV5TE (1 << 0)
#define AV_CPU_FLAG_ARMV6 (1 << 1)
#define AV_CPU_FLAG_ARMV6 (1 << 1)
...
...
libavutil/ppc/cpu.c
View file @
7d07ee5a
...
@@ -85,6 +85,14 @@ int ff_get_cpu_flags_ppc(void)
...
@@ -85,6 +85,14 @@ int ff_get_cpu_flags_ppc(void)
if
(
buf
[
i
]
==
AT_HWCAP
)
{
if
(
buf
[
i
]
==
AT_HWCAP
)
{
if
(
buf
[
i
+
1
]
&
PPC_FEATURE_HAS_ALTIVEC
)
if
(
buf
[
i
+
1
]
&
PPC_FEATURE_HAS_ALTIVEC
)
ret
=
AV_CPU_FLAG_ALTIVEC
;
ret
=
AV_CPU_FLAG_ALTIVEC
;
#ifdef PPC_FEATURE_HAS_VSX
if
(
buf
[
i
+
1
]
&
PPC_FEATURE_HAS_VSX
)
ret
|=
AV_CPU_FLAG_VSX
;
#endif
#ifdef PPC_FEATURE_ARCH_2_07
if
(
buf
[
i
+
1
]
&
PPC_FEATURE_HAS_POWER8
)
ret
|=
AV_CPU_FLAG_POWER8
;
#endif
goto
out
;
goto
out
;
}
}
}
}
...
@@ -103,7 +111,7 @@ out:
...
@@ -103,7 +111,7 @@ out:
#define PVR_POWER7 0x003F
#define PVR_POWER7 0x003F
#define PVR_POWER8 0x004B
#define PVR_POWER8 0x004B
#define PVR_CELL_PPU 0x0070
#define PVR_CELL_PPU 0x0070
int
ret
=
0
;
int
proc_ver
;
int
proc_ver
;
// Support of mfspr PVR emulation added in Linux 2.6.17.
// Support of mfspr PVR emulation added in Linux 2.6.17.
__asm__
volatile
(
"mfspr %0, 287"
:
"=r"
(
proc_ver
));
__asm__
volatile
(
"mfspr %0, 287"
:
"=r"
(
proc_ver
));
...
@@ -118,8 +126,14 @@ out:
...
@@ -118,8 +126,14 @@ out:
proc_ver
==
PVR_POWER7
||
proc_ver
==
PVR_POWER7
||
proc_ver
==
PVR_POWER8
||
proc_ver
==
PVR_POWER8
||
proc_ver
==
PVR_CELL_PPU
)
proc_ver
==
PVR_CELL_PPU
)
return
AV_CPU_FLAG_ALTIVEC
;
ret
=
AV_CPU_FLAG_ALTIVEC
;
return
0
;
if
(
proc_ver
==
PVR_POWER7
||
proc_ver
==
PVR_POWER8
)
ret
|=
AV_CPU_FLAG_VSX
;
if
(
proc_ver
==
PVR_POWER8
)
ret
|=
AV_CPU_FLAG_POWER8
;
return
ret
;
#else
#else
// Since we were compiled for AltiVec, just assume we have it
// Since we were compiled for AltiVec, just assume we have it
// until someone comes up with a proper way (not involving signal hacks).
// until someone comes up with a proper way (not involving signal hacks).
...
...
libavutil/ppc/cpu.h
View file @
7d07ee5a
...
@@ -24,5 +24,7 @@
...
@@ -24,5 +24,7 @@
#include "libavutil/cpu_internal.h"
#include "libavutil/cpu_internal.h"
#define PPC_ALTIVEC(flags) CPUEXT(flags, ALTIVEC)
#define PPC_ALTIVEC(flags) CPUEXT(flags, ALTIVEC)
#define PPC_VSX(flags) CPUEXT(flags, VSX)
#define PPC_POWER8(flags) CPUEXT(flags, POWER8)
#endif
/* AVUTIL_PPC_CPU_H */
#endif
/* AVUTIL_PPC_CPU_H */
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