1 /****************************************************************************
2 * Assembly testing and benchmarking tool
3 * Copyright (c) 2015 Martin Storsjo
4 * Copyright (c) 2015 Janne Grunau
6 * This file is part of FFmpeg.
8 * FFmpeg is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * FFmpeg 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
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
21 *****************************************************************************/
23 #include "libavutil/aarch64/asm.S"
26 .quad 0x21f86d66c8ca00ce
27 .quad 0x75b6ba21077c48ad
28 .quad 0xed56bb2dcb3c7736
29 .quad 0x8bda43d3fd1a7e06
30 .quad 0xb64a9c9e5d318408
31 .quad 0xdf9a54b303f1d3a3
32 .quad 0x4a75479abd64e097
33 .quad 0x249214109d5d1c88
34 .quad 0x1a1b2550a612b48c
35 .quad 0x79445c159ce79064
36 .quad 0x2eed899d5a28ddcd
37 .quad 0x86b2536fcd8cf636
38 .quad 0xb0856806085e7943
39 .quad 0x3f2bf84fc0fcca4e
40 .quad 0xacbd382dcf5b8de2
41 .quad 0xd229e1f5b281303f
42 .quad 0x71aeaff20b095fd9
43 .quad 0xab63e2e11fa38ed9
48 .asciz "failed to preserve register"
52 // max number of args used by any asm function.
55 #define ARG_STACK ((8*(MAX_ARGS - 7) + 15) & ~15)
57 function checkasm_checked_call, export=1
58 stp x29, x30, [sp, #-16]!
60 stp x19, x20, [sp, #-16]!
61 stp x21, x22, [sp, #-16]!
62 stp x23, x24, [sp, #-16]!
63 stp x25, x26, [sp, #-16]!
64 stp x27, x28, [sp, #-16]!
65 stp d8, d9, [sp, #-16]!
66 stp d10, d11, [sp, #-16]!
67 stp d12, d13, [sp, #-16]!
68 stp d14, d15, [sp, #-16]!
70 movrel x9, register_init
72 ldp d10, d11, [x9], #16
73 ldp d12, d13, [x9], #16
74 ldp d14, d15, [x9], #16
75 ldp x19, x20, [x9], #16
76 ldp x21, x22, [x9], #16
77 ldp x23, x24, [x9], #16
78 ldp x25, x26, [x9], #16
79 ldp x27, x28, [x9], #16
81 sub sp, sp, #ARG_STACK
83 // the first stacked arg is copied to x7
85 ldr x9, [x29, #16 + 8 + pos]
100 add sp, sp, #ARG_STACK
101 stp x0, x1, [sp, #-16]!
102 movrel x9, register_init
105 .macro check_reg_neon reg1, reg2
107 uzp1 v1.2d, v\reg1\().2d, v\reg2\().2d
108 eor v0.16b, v0.16b, v1.16b
109 orr v3.16b, v3.16b, v0.16b
112 check_reg_neon 10, 11
113 check_reg_neon 12, 13
114 check_reg_neon 14, 15
118 .macro check_reg reg1, reg2
119 ldp x0, x1, [x9], #16
133 movrel x0, error_message
134 bl X(checkasm_fail_func)
136 ldp x0, x1, [sp], #16
137 ldp d14, d15, [sp], #16
138 ldp d12, d13, [sp], #16
139 ldp d10, d11, [sp], #16
140 ldp d8, d9, [sp], #16
141 ldp x27, x28, [sp], #16
142 ldp x25, x26, [sp], #16
143 ldp x23, x24, [sp], #16
144 ldp x21, x22, [sp], #16
145 ldp x19, x20, [sp], #16
146 ldp x29, x30, [sp], #16