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
3662d880
Commit
3662d880
authored
Mar 18, 2008
by
Måns Rullgård
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
32/64-bit agnostic x86 bswap
Originally committed as revision 12496 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
c5fec7d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
bswap.h
libavutil/bswap.h
+6
-14
No files found.
libavutil/bswap.h
View file @
3662d880
...
...
@@ -34,16 +34,10 @@
#include <byteswap.h>
#else
#ifdef ARCH_X86_64
# define LEGACY_REGS "=Q"
#else
# define LEGACY_REGS "=q"
#endif
static
av_always_inline
uint16_t
bswap_16
(
uint16_t
x
)
{
#if defined(ARCH_X86)
asm
(
"rorw $8, %0"
:
LEGACY_REGS
(
x
)
:
"0"
(
x
));
asm
(
"rorw $8, %0"
:
"+r"
(
x
));
#elif defined(ARCH_SH4)
asm
(
"swap.b %0,%0"
:
"=r"
(
x
)
:
"0"
(
x
));
#else
...
...
@@ -56,15 +50,13 @@ static av_always_inline uint32_t bswap_32(uint32_t x)
{
#if defined(ARCH_X86)
#ifdef HAVE_BSWAP
asm
(
"bswap %0"
:
"=r"
(
x
)
:
asm
(
"bswap %0"
:
"+r"
(
x
));
#else
asm
(
"
xchgb %b0,%h0
\n
"
"rorl $16,
%0
\n
"
"
xchgb %b0,%h0"
:
LEGACY_REGS
(
x
)
:
asm
(
"
rorw $8, %w0
\n\t
"
"rorl $16,
%0
\n\t
"
"
rorw $8, %w0"
:
"+r"
(
x
));
#endif
"0"
(
x
));
#elif defined(ARCH_SH4)
asm
(
"swap.b %0,%0
\n
"
"swap.w %0,%0
\n
"
...
...
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