/******************************************************************************
* Copyright © 2018 , VideoLAN and dav1d authors
* Copyright © 2015 Martin Storsjo
* Copyright © 2015 Janne Grunau
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions of source code must retain the above copyright notice , this
* list of conditions and the following disclaimer .
*
* 2 . Redistributions in binary form must reproduce the above copyright notice ,
* this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution .
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND
* ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
* ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
* LOSS OF USE , DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
* ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
*****************************************************************************/
#ifndef DAV1D_SRC_ARM_64_UTIL_S
#define DAV1D_SRC_ARM_64_UTIL_S
#include "config.h"
#include "src/arm/asm.S"
#ifndef __has_feature
#define __has_feature(x) 0
#endif
.macro movrel rd, val, offset=0
#if defined(__APPLE__)
.if \offset < 0
adrp \rd, \val@PAGE
add \rd, \rd, \val@PAGEOFF
sub \rd, \rd, -(\offset)
.else
adrp \rd, \val+(\offset)@PAGE
add \rd, \rd, \val+(\offset)@PAGEOFF
.endif
#elif defined(PIC) && defined(_WIN32)
.if \offset < 0
adrp \rd, \val
add \rd, \rd, :lo12:\val
sub \rd, \rd, -(\offset)
.else
adrp \rd, \val+(\offset)
add \rd, \rd, :lo12:\val+(\offset)
.endif
#elif __has_feature(hwaddress_sanitizer)
adrp \rd, :pg_hi21_nc:\val+(\offset)
movk \rd, #:prel_g3:\val+0 x100000000
add \rd, \rd, :lo12:\val+(\offset)
#elif defined(PIC)
adrp \rd, \val+(\offset)
add \rd, \rd, :lo12:\val+(\offset)
#else
ldr \rd, =\val+\offset
#endif
.endm
.macro sub_sp space
#ifdef _WIN32
.if \space > 8192
// Here, we'd need to touch two (or more) pages while decrementing
// the stack pointer.
.error "sub_sp doesn't support values over 8K at the moment"
.elseif \space > 4096
sub x16, sp, #4096
ldr xzr, [x16]
sub sp, x16, #(\space - 4096 )
.else
sub sp, sp, #\space
.endif
#else
.if \space >= 4096
sub sp, sp, #(\space)/4096 *4096
.endif
.if (\space % 4096 ) != 0
sub sp, sp, #(\space)%4096
.endif
#endif
.endm
.macro transpose_8x8b_xtl r0, r1, r2, r3, r4, r5, r6, r7, xtl
// a0 b0 a1 b1 a2 b2 a3 b3 a4 b4 a5 b5 a6 b6 a7 b7
zip1 \r0\().16 b, \r0\().16 b, \r1\().16 b
// c0 d0 c1 d1 c2 d2 d3 d3 c4 d4 c5 d5 c6 d6 d7 d7
zip1 \r2\().16 b, \r2\().16 b, \r3\().16 b
// e0 f0 e1 f1 e2 f2 e3 f3 e4 f4 e5 f5 e6 f6 e7 f7
zip1 \r4\().16 b, \r4\().16 b, \r5\().16 b
// g0 h0 g1 h1 g2 h2 h3 h3 g4 h4 g5 h5 g6 h6 h7 h7
zip1 \r6\().16 b, \r6\().16 b, \r7\().16 b
// a0 b0 c0 d0 a2 b2 c2 d2 a4 b4 c4 d4 a6 b6 c6 d6
trn1 \r1\().8 h, \r0\().8 h, \r2\().8 h
// a1 b1 c1 d1 a3 b3 c3 d3 a5 b5 c5 d5 a7 b7 c7 d7
trn2 \r3\().8 h, \r0\().8 h, \r2\().8 h
// e0 f0 g0 h0 e2 f2 g2 h2 e4 f4 g4 h4 e6 f6 g6 h6
trn1 \r5\().8 h, \r4\().8 h, \r6\().8 h
// e1 f1 g1 h1 e3 f3 g3 h3 e5 f5 g5 h5 e7 f7 g7 h7
trn2 \r7\().8 h, \r4\().8 h, \r6\().8 h
// a0 b0 c0 d0 e0 f0 g0 h0 a4 b4 c4 d4 e4 f4 g4 h4
trn1 \r0\().4 s, \r1\().4 s, \r5\().4 s
// a2 b2 c2 d2 e2 f2 g2 h2 a6 b6 c6 d6 e6 f6 g6 h6
trn2 \r2\().4 s, \r1\().4 s, \r5\().4 s
// a1 b1 c1 d1 e1 f1 g1 h1 a5 b5 c5 d5 e5 f5 g5 h5
trn1 \r1\().4 s, \r3\().4 s, \r7\().4 s
// a3 b3 c3 d3 e3 f3 g3 h3 a7 b7 c7 d7 e7 f7 g7 h7
trn2 \r3\().4 s, \r3\().4 s, \r7\().4 s
\xtl\()2 \r4\().8 h, \r0\().16 b
\xtl \r0\().8 h, \r0\().8 b
\xtl\()2 \r6\().8 h, \r2\().16 b
\xtl \r2\().8 h, \r2\().8 b
\xtl\()2 \r5\().8 h, \r1\().16 b
\xtl \r1\().8 h, \r1\().8 b
\xtl\()2 \r7\().8 h, \r3\().16 b
\xtl \r3\().8 h, \r3\().8 b
.endm
.macro transpose_8x8h r0, r1, r2, r3, r4, r5, r6, r7, t8, t9
trn1 \t8\().8 h, \r0\().8 h, \r1\().8 h
trn2 \t9\().8 h, \r0\().8 h, \r1\().8 h
trn1 \r1\().8 h, \r2\().8 h, \r3\().8 h
trn2 \r3\().8 h, \r2\().8 h, \r3\().8 h
trn1 \r0\().8 h, \r4\().8 h, \r5\().8 h
trn2 \r5\().8 h, \r4\().8 h, \r5\().8 h
trn1 \r2\().8 h, \r6\().8 h, \r7\().8 h
trn2 \r7\().8 h, \r6\().8 h, \r7\().8 h
trn1 \r4\().4 s, \r0\().4 s, \r2\().4 s
trn2 \r2\().4 s, \r0\().4 s, \r2\().4 s
trn1 \r6\().4 s, \r5\().4 s, \r7\().4 s
trn2 \r7\().4 s, \r5\().4 s, \r7\().4 s
trn1 \r5\().4 s, \t9\().4 s, \r3\().4 s
trn2 \t9\().4 s, \t9\().4 s, \r3\().4 s
trn1 \r3\().4 s, \t8\().4 s, \r1\().4 s
trn2 \t8\().4 s, \t8\().4 s, \r1\().4 s
trn1 \r0\().2 d, \r3\().2 d, \r4\().2 d
trn2 \r4\().2 d, \r3\().2 d, \r4\().2 d
trn1 \r1\().2 d, \r5\().2 d, \r6\().2 d
trn2 \r5\().2 d, \r5\().2 d, \r6\().2 d
trn2 \r6\().2 d, \t8\().2 d, \r2\().2 d
trn1 \r2\().2 d, \t8\().2 d, \r2\().2 d
trn1 \r3\().2 d, \t9\().2 d, \r7\().2 d
trn2 \r7\().2 d, \t9\().2 d, \r7\().2 d
.endm
.macro transpose_8x8h_mov r0, r1, r2, r3, r4, r5, r6, r7, t8, t9, o0, o1, o2, o3, o4, o5, o6, o7
trn1 \t8\().8 h, \r0\().8 h, \r1\().8 h
trn2 \t9\().8 h, \r0\().8 h, \r1\().8 h
trn1 \r1\().8 h, \r2\().8 h, \r3\().8 h
trn2 \r3\().8 h, \r2\().8 h, \r3\().8 h
trn1 \r0\().8 h, \r4\().8 h, \r5\().8 h
trn2 \r5\().8 h, \r4\().8 h, \r5\().8 h
trn1 \r2\().8 h, \r6\().8 h, \r7\().8 h
trn2 \r7\().8 h, \r6\().8 h, \r7\().8 h
trn1 \r4\().4 s, \r0\().4 s, \r2\().4 s
trn2 \r2\().4 s, \r0\().4 s, \r2\().4 s
trn1 \r6\().4 s, \r5\().4 s, \r7\().4 s
trn2 \r7\().4 s, \r5\().4 s, \r7\().4 s
trn1 \r5\().4 s, \t9\().4 s, \r3\().4 s
trn2 \t9\().4 s, \t9\().4 s, \r3\().4 s
trn1 \r3\().4 s, \t8\().4 s, \r1\().4 s
trn2 \t8\().4 s, \t8\().4 s, \r1\().4 s
trn1 \o0\().2 d, \r3\().2 d, \r4\().2 d
trn2 \o4\().2 d, \r3\().2 d, \r4\().2 d
trn1 \o1\().2 d, \r5\().2 d, \r6\().2 d
trn2 \o5\().2 d, \r5\().2 d, \r6\().2 d
trn2 \o6\().2 d, \t8\().2 d, \r2\().2 d
trn1 \o2\().2 d, \t8\().2 d, \r2\().2 d
trn1 \o3\().2 d, \t9\().2 d, \r7\().2 d
trn2 \o7\().2 d, \t9\().2 d, \r7\().2 d
.endm
.macro transpose_8x16b r0, r1, r2, r3, r4, r5, r6, r7, t8, t9
trn1 \t8\().16 b, \r0\().16 b, \r1\().16 b
trn2 \t9\().16 b, \r0\().16 b, \r1\().16 b
trn1 \r1\().16 b, \r2\().16 b, \r3\().16 b
trn2 \r3\().16 b, \r2\().16 b, \r3\().16 b
trn1 \r0\().16 b, \r4\().16 b, \r5\().16 b
trn2 \r5\().16 b, \r4\().16 b, \r5\().16 b
trn1 \r2\().16 b, \r6\().16 b, \r7\().16 b
trn2 \r7\().16 b, \r6\().16 b, \r7\().16 b
trn1 \r4\().8 h, \r0\().8 h, \r2\().8 h
trn2 \r2\().8 h, \r0\().8 h, \r2\().8 h
trn1 \r6\().8 h, \r5\().8 h, \r7\().8 h
trn2 \r7\().8 h, \r5\().8 h, \r7\().8 h
trn1 \r5\().8 h, \t9\().8 h, \r3\().8 h
trn2 \t9\().8 h, \t9\().8 h, \r3\().8 h
trn1 \r3\().8 h, \t8\().8 h, \r1\().8 h
trn2 \t8\().8 h, \t8\().8 h, \r1\().8 h
trn1 \r0\().4 s, \r3\().4 s, \r4\().4 s
trn2 \r4\().4 s, \r3\().4 s, \r4\().4 s
trn1 \r1\().4 s, \r5\().4 s, \r6\().4 s
trn2 \r5\().4 s, \r5\().4 s, \r6\().4 s
trn2 \r6\().4 s, \t8\().4 s, \r2\().4 s
trn1 \r2\().4 s, \t8\().4 s, \r2\().4 s
trn1 \r3\().4 s, \t9\().4 s, \r7\().4 s
trn2 \r7\().4 s, \t9\().4 s, \r7\().4 s
.endm
.macro transpose_4x16b r0, r1, r2, r3, t4, t5, t6, t7
trn1 \t4\().16 b, \r0\().16 b, \r1\().16 b
trn2 \t5\().16 b, \r0\().16 b, \r1\().16 b
trn1 \t6\().16 b, \r2\().16 b, \r3\().16 b
trn2 \t7\().16 b, \r2\().16 b, \r3\().16 b
trn1 \r0\().8 h, \t4\().8 h, \t6\().8 h
trn2 \r2\().8 h, \t4\().8 h, \t6\().8 h
trn1 \r1\().8 h, \t5\().8 h, \t7\().8 h
trn2 \r3\().8 h, \t5\().8 h, \t7\().8 h
.endm
.macro transpose_4x4h r0, r1, r2, r3, t4, t5, t6, t7
trn1 \t4\().4 h, \r0\().4 h, \r1\().4 h
trn2 \t5\().4 h, \r0\().4 h, \r1\().4 h
trn1 \t6\().4 h, \r2\().4 h, \r3\().4 h
trn2 \t7\().4 h, \r2\().4 h, \r3\().4 h
trn1 \r0\().2 s, \t4\().2 s, \t6\().2 s
trn2 \r2\().2 s, \t4\().2 s, \t6\().2 s
trn1 \r1\().2 s, \t5\().2 s, \t7\().2 s
trn2 \r3\().2 s, \t5\().2 s, \t7\().2 s
.endm
.macro transpose_4x4s r0, r1, r2, r3, t4, t5, t6, t7
trn1 \t4\().4 s, \r0\().4 s, \r1\().4 s
trn2 \t5\().4 s, \r0\().4 s, \r1\().4 s
trn1 \t6\().4 s, \r2\().4 s, \r3\().4 s
trn2 \t7\().4 s, \r2\().4 s, \r3\().4 s
trn1 \r0\().2 d, \t4\().2 d, \t6\().2 d
trn2 \r2\().2 d, \t4\().2 d, \t6\().2 d
trn1 \r1\().2 d, \t5\().2 d, \t7\().2 d
trn2 \r3\().2 d, \t5\().2 d, \t7\().2 d
.endm
.macro transpose_4x8h r0, r1, r2, r3, t4, t5, t6, t7
trn1 \t4\().8 h, \r0\().8 h, \r1\().8 h
trn2 \t5\().8 h, \r0\().8 h, \r1\().8 h
trn1 \t6\().8 h, \r2\().8 h, \r3\().8 h
trn2 \t7\().8 h, \r2\().8 h, \r3\().8 h
trn1 \r0\().4 s, \t4\().4 s, \t6\().4 s
trn2 \r2\().4 s, \t4\().4 s, \t6\().4 s
trn1 \r1\().4 s, \t5\().4 s, \t7\().4 s
trn2 \r3\().4 s, \t5\().4 s, \t7\().4 s
.endm
.macro transpose_4x8h_mov r0, r1, r2, r3, t4, t5, t6, t7, o0, o1, o2, o3
trn1 \t4\().8 h, \r0\().8 h, \r1\().8 h
trn2 \t5\().8 h, \r0\().8 h, \r1\().8 h
trn1 \t6\().8 h, \r2\().8 h, \r3\().8 h
trn2 \t7\().8 h, \r2\().8 h, \r3\().8 h
trn1 \o0\().4 s, \t4\().4 s, \t6\().4 s
trn2 \o2\().4 s, \t4\().4 s, \t6\().4 s
trn1 \o1\().4 s, \t5\().4 s, \t7\().4 s
trn2 \o3\().4 s, \t5\().4 s, \t7\().4 s
.endm
#endif /* DAV1D_SRC_ARM_64_UTIL_S */
Messung V0.5 in Prozent C=99 H=100 G=99
¤ Dauer der Verarbeitung: 0.7 Sekunden
¤
*© Formatika GbR, Deutschland