• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/bfin/mathops.h

Go to the documentation of this file.
00001 /*
00002  * simple math operations
00003  *
00004  * Copyright (C) 2007 Marc Hoffman <mmhoffm@gmail.com>
00005  *
00006  * This file is part of FFmpeg.
00007  *
00008  * FFmpeg is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * FFmpeg is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with FFmpeg; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00021  */
00022 #ifndef AVCODEC_BFIN_MATHOPS_H
00023 #define AVCODEC_BFIN_MATHOPS_H
00024 
00025 #include "config.h"
00026 
00027 #if CONFIG_MPEGAUDIO_HP
00028 #define MULH(X,Y) ({ int xxo;                           \
00029     __asm__ (                                               \
00030         "a1 = %2.L * %1.L (FU);\n\t"                    \
00031         "a1 = a1 >> 16;\n\t"                            \
00032         "a1 += %2.H * %1.L (IS,M);\n\t"                 \
00033         "a0 = %1.H * %2.H, a1+= %1.H * %2.L (IS,M);\n\t"\
00034         "a1 = a1 >>> 16;\n\t"                           \
00035         "%0 = (a0 += a1);\n\t"                          \
00036         : "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; })
00037 #else
00038 #define MULH(X,Y) ({ int xxo;                           \
00039     __asm__ (                                               \
00040         "a1 = %2.H * %1.L (IS,M);\n\t"                  \
00041         "a0 = %1.H * %2.H, a1+= %1.H * %2.L (IS,M);\n\t"\
00042         "a1 = a1 >>> 16;\n\t"                           \
00043         "%0 = (a0 += a1);\n\t"                          \
00044         : "=d" (xxo) : "d" (X), "d" (Y) : "A0","A1"); xxo; })
00045 #endif
00046 
00047 /* signed 16x16 -> 32 multiply */
00048 #define MUL16(a, b) ({ int xxo;                         \
00049     __asm__ (                                               \
00050        "%0 = %1.l*%2.l (is);\n\t"                       \
00051        : "=W" (xxo) : "d" (a), "d" (b) : "A1");         \
00052     xxo; })
00053 
00054 #endif /* AVCODEC_BFIN_MATHOPS_H */

Generated on Fri Sep 16 2011 17:17:34 for FFmpeg by  doxygen 1.7.1