Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
3662d880
Commit
3662d880
authored
17 years ago
by
Måns Rullgård
Browse files
Options
Downloads
Patches
Plain Diff
32/64-bit agnostic x86 bswap
Originally committed as revision 12496 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
c5fec7d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavutil/bswap.h
+6
-14
6 additions, 14 deletions
libavutil/bswap.h
with
6 additions
and
14 deletions
libavutil/bswap.h
+
6
−
14
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,%h
0"
:
LEGACY_REGS
(
x
)
:
asm
(
"
rorw $8, %w0
\n\t
"
"rorl $16,
%0
\n
\t
"
"
rorw $8, %w
0"
:
"+r"
(
x
));
#endif
"0"
(
x
));
#elif defined(ARCH_SH4)
asm
(
"swap.b %0,%0
\n
"
"swap.w %0,%0
\n
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment