Mercurial > libavutil.hg
annotate arm/intmath.h @ 980:f08c66310125 libavutil
ARM: intmath.h cosmetics
author | mru |
---|---|
date | Wed, 07 Jul 2010 17:27:48 +0000 |
parents | 4d9ad0ed07d0 |
children | d004c9e2aa40 |
rev | line source |
---|---|
816 | 1 /* |
2 * Copyright (c) 2010 Mans Rullgard <mans@mansr.com> | |
3 * | |
4 * This file is part of FFmpeg. | |
5 * | |
6 * FFmpeg is free software; you can redistribute it and/or | |
7 * modify it under the terms of the GNU Lesser General Public | |
8 * License as published by the Free Software Foundation; either | |
9 * version 2.1 of the License, or (at your option) any later version. | |
10 * | |
11 * FFmpeg is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 * Lesser General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU Lesser General Public | |
17 * License along with FFmpeg; if not, write to the Free Software | |
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
19 */ | |
20 | |
21 #ifndef AVUTIL_ARM_INTMATH_H | |
22 #define AVUTIL_ARM_INTMATH_H | |
23 | |
24 #include "config.h" | |
873
4d9ad0ed07d0
Replace many includes of libavutil/common.h with what is actually needed
mru
parents:
816
diff
changeset
|
25 #include "libavutil/attributes.h" |
816 | 26 |
27 #if HAVE_INLINE_ASM | |
28 | |
29 #if HAVE_ARMV6 | |
980 | 30 |
31 #define FASTDIV FASTDIV | |
816 | 32 static inline av_const int FASTDIV(int a, int b) |
33 { | |
34 int r, t; | |
35 __asm__ volatile("cmp %3, #2 \n\t" | |
36 "ldr %1, [%4, %3, lsl #2] \n\t" | |
37 "lsrle %0, %2, #1 \n\t" | |
38 "smmulgt %0, %1, %2 \n\t" | |
39 : "=&r"(r), "=&r"(t) : "r"(a), "r"(b), "r"(ff_inverse)); | |
40 return r; | |
41 } | |
980 | 42 |
43 #else /* HAVE_ARMV6 */ | |
44 | |
45 #define FASTDIV FASTDIV | |
816 | 46 static inline av_const int FASTDIV(int a, int b) |
47 { | |
48 int r, t; | |
49 __asm__ volatile("umull %1, %0, %2, %3" | |
50 : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b])); | |
51 return r; | |
52 } | |
53 | |
980 | 54 #endif /* HAVE_ARMV6 */ |
816 | 55 |
56 #endif /* HAVE_INLINE_ASM */ | |
57 | |
58 #endif /* AVUTIL_ARM_INTMATH_H */ |