Spaces:
Runtime error
Runtime error
/* | |
* Copyright © 2022 Rémi Denis-Courmont. | |
* Loosely based on earlier work copyrighted by Måns Rullgård, 2008. | |
* | |
* This file is part of FFmpeg. | |
* | |
* FFmpeg is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. | |
* | |
* FFmpeg is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
* Lesser General Public License for more details. | |
* | |
* You should have received a copy of the GNU Lesser General Public | |
* License along with FFmpeg; if not, write to the Free Software | |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
*/ | |
#if defined (__riscv_float_abi_soft) | |
#define NOHWF | |
#define NOHWD | |
#define HWF # | |
#define HWD # | |
#elif defined (__riscv_float_abi_single) | |
#define NOHWF # | |
#define NOHWD | |
#define HWF | |
#define HWD # | |
#else | |
#define NOHWF # | |
#define NOHWD # | |
#define HWF | |
#define HWD | |
#endif | |
ext= | func sym,|
2 | |
.option push | |
.ifnb \ext | |
.option arch, +\ext | |
\sym | |
.hidden \sym | |
.type \sym, %function | |
\sym: | |
endfunc | |
.size \sym, . - \sym | |
.option pop | |
.previous | |
.purgem endfunc | |
3, relocate=0 | const sym, align=|
\relocate | |
.pushsection | .rel.ro|
.pushsection .rodata | |
\align | |
\sym: | |
endconst | |
.size \sym, . - \sym | |
.popsection | |
.purgem endconst | |
#if !defined (__riscv_zba) | |
/* SH{1,2,3}ADD definitions for pre-Zba assemblers */ | |
shnadd n, rd, rs1, rs2 | |
.insn r OP, 2 * \n, 16, \rd, \rs1, \rs2 | |
sh1add rd, rs1, rs2 | |
shnadd 1, \rd, \rs1, \rs2 | |
sh2add rd, rs1, rs2 | |
shnadd 2, \rd, \rs1, \rs2 | |
sh3add rd, rs1, rs2 | |
shnadd 3, \rd, \rs1, \rs2 | |
#endif | |
/* Convenience macro to load a Vector type (vtype) as immediate */ | |
lvtypei rd, e, m=m1, tp=tu, mp=mu | |
.ifc \e,e8 | |
ei, 0 | |
.ifc \e,e16 | |
ei, 8 | |
.ifc \e,e32 | |
ei, 16 | |
.ifc \e,e64 | |
ei, 24 | |
.error "Unknown element type" | |
.ifc \m,m1 | |
0 | mi,|
.ifc \m,m2 | |
1 | mi,|
.ifc \m,m4 | |
2 | mi,|
.ifc \m,m8 | |
3 | mi,|
.ifc \m,mf8 | |
5 | mi,|
.ifc \m,mf4 | |
6 | mi,|
.ifc \m,mf2 | |
7 | mi,|
.error "Unknown multiplier" | |
3 | mi,|
.ifc \tp,tu | |
0 | tpi,|
.ifc \tp,ta | |
64 | tpi,|
.error "Unknown tail policy" | |
.ifc \mp,mu | |
0 | mpi,|
.ifc \mp,ma | |
128 | mpi,|
.error "Unknown mask policy" | |
li \rd, (ei | mi | tpi | mpi) | |
.endm | |