~ubuntu-branches/ubuntu/utopic/libav/utopic

« back to all changes in this revision

Viewing changes to libavutil/arm/neontest.h

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-05-11 12:28:45 UTC
  • mfrom: (1.3.42 sid)
  • Revision ID: package-import@ubuntu.com-20140511122845-zxdom35pimot5eat
Tags: 6:10.1-1
* New upstream release 10:
   - pcm-dvd: Fix 20bit decoding (bug/592)
   - avi: Improve non-interleaved detection (bug/666)
   - arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
   - arm: hpeldsp: prevent overreads in armv6 asm (bug/646)
   - avfilter: Add missing emms_c when needed
   - rtmpproto: Check the buffer sizes when copying app/playpath strings
   - swscale: Fix an undefined behaviour
   - vp9: Read the frame size as unsigned
   - dcadec: Use correct channel count in stereo downmix check
   - dcadec: Do not decode the XCh extension when downmixing to stereo
   - matroska: add the Opus mapping
   - matroskadec: read the CodecDelay element
   - rtmpproto: Make sure to pass on the error code if read_connect failed
   - lavr: allocate the resampling buffer with a positive size
   - mp3enc: Properly write bitrate value in XING header (Closes: #736088)
   - golomb: Fix the implementation of get_se_golomb_long
* Drop debian/libav-tools.maintscript. ffserver is no longer found in
  stable, and this seems to cause other problems today (Closes: #742676)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * check NEON registers for clobbering
 
3
 * Copyright (c) 2008 Ramiro Polla <ramiro.polla@gmail.com>
 
4
 * Copyright (c) 2013 Martin Storsjo
 
5
 *
 
6
 * This file is part of Libav.
 
7
 *
 
8
 * Libav is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Lesser General Public
 
10
 * License as published by the Free Software Foundation; either
 
11
 * version 2.1 of the License, or (at your option) any later version.
 
12
 *
 
13
 * Libav is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
 * Lesser General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU Lesser General Public
 
19
 * License along with Libav; if not, write to the Free Software
 
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
21
 */
 
22
 
 
23
#include <inttypes.h>
 
24
#include <stdint.h>
 
25
#include <stdlib.h>
 
26
#include <stdarg.h>
 
27
#include <string.h>
 
28
 
 
29
#include "libavutil/bswap.h"
 
30
 
 
31
#define storeneonregs(mem)                \
 
32
    __asm__ volatile(                     \
 
33
        "vstm %0, {d8-d15}\n\t"           \
 
34
        :: "r"(mem) : "memory")
 
35
 
 
36
#define testneonclobbers(func, ctx, ...)                        \
 
37
    uint64_t neon[2][8];                                        \
 
38
    int ret;                                                    \
 
39
    storeneonregs(neon[0]);                                     \
 
40
    ret = __real_ ## func(ctx, __VA_ARGS__);                    \
 
41
    storeneonregs(neon[1]);                                     \
 
42
    if (memcmp(neon[0], neon[1], sizeof(neon[0]))) {            \
 
43
        int i;                                                  \
 
44
        av_log(ctx, AV_LOG_ERROR,                               \
 
45
               "NEON REGS CLOBBERED IN %s!\n", #func);          \
 
46
        for (i = 0; i < 8; i ++)                                \
 
47
            if (neon[0][i] != neon[1][i]) {                     \
 
48
                av_log(ctx, AV_LOG_ERROR,                       \
 
49
                       "d%-2d = %016"PRIx64"\n",                \
 
50
                       8 + i, av_bswap64(neon[0][i]));          \
 
51
                av_log(ctx, AV_LOG_ERROR,                       \
 
52
                       "   -> %016"PRIx64"\n",                  \
 
53
                       av_bswap64(neon[1][i]));                 \
 
54
            }                                                   \
 
55
        abort();                                                \
 
56
    }                                                           \
 
57
    return ret
 
58
 
 
59
#define wrap(func)      \
 
60
int __real_ ## func;    \
 
61
int __wrap_ ## func;    \
 
62
int __wrap_ ## func