~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavutil/arm/intreadwrite.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <stdint.h>
23
23
#include "config.h"
 
24
#include "libavutil/attributes.h"
24
25
 
25
 
#if HAVE_FAST_UNALIGNED && HAVE_INLINE_ASM
 
26
#if HAVE_FAST_UNALIGNED && HAVE_INLINE_ASM && !AV_GCC_VERSION_AT_LEAST(4,7)
26
27
 
27
28
#define AV_RN16 AV_RN16
28
29
static av_always_inline unsigned AV_RN16(const void *p)
29
30
{
 
31
    const uint8_t *q = p;
30
32
    unsigned v;
31
 
    __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)p));
 
33
#if !AV_GCC_VERSION_AT_LEAST(4,6)
 
34
    __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)q));
 
35
#elif defined __thumb__
 
36
    __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(q[0]), "m"(q[1]));
 
37
#else
 
38
    __asm__ ("ldrh %0, %1" : "=r"(v) : "Uq"(q[0]), "m"(q[1]));
 
39
#endif
32
40
    return v;
33
41
}
34
42
 
41
49
#define AV_RN32 AV_RN32
42
50
static av_always_inline uint32_t AV_RN32(const void *p)
43
51
{
 
52
    const struct __attribute__((packed)) { uint32_t v; } *q = p;
44
53
    uint32_t v;
45
 
    __asm__ ("ldr  %0, %1" : "=r"(v) : "m"(*(const uint32_t *)p));
 
54
    __asm__ ("ldr  %0, %1" : "=r"(v) : "m"(*q));
46
55
    return v;
47
56
}
48
57
 
52
61
    __asm__ ("str  %1, %0" : "=m"(*(uint32_t *)p) : "r"(v));
53
62
}
54
63
 
 
64
#if HAVE_ASM_MOD_Q
 
65
 
55
66
#define AV_RN64 AV_RN64
56
67
static av_always_inline uint64_t AV_RN64(const void *p)
57
68
{
 
69
    const struct __attribute__((packed)) { uint32_t v; } *q = p;
58
70
    uint64_t v;
59
71
    __asm__ ("ldr   %Q0, %1  \n\t"
60
72
             "ldr   %R0, %2  \n\t"
61
73
             : "=&r"(v)
62
 
             : "m"(*(const uint32_t*)p), "m"(*((const uint32_t*)p+1)));
 
74
             : "m"(q[0]), "m"(q[1]));
63
75
    return v;
64
76
}
65
77
 
72
84
             : "r"(v));
73
85
}
74
86
 
 
87
#endif /* HAVE_ASM_MOD_Q */
 
88
 
75
89
#endif /* HAVE_INLINE_ASM */
76
90
 
77
91
#endif /* AVUTIL_ARM_INTREADWRITE_H */