2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
4 * SPDX-License-Identifier: BSD-3-Clause
11#include "asm_helper.S"
14__pre_init __aeabi_bits_init, 00010
16.macro bits_section name
18.section RAM_SECTION_NAME(\name), "ax"
20.section SECTION_NAME(\name), "ax"
24.section .data.aeabi_bits_funcs
25.global aeabi_bits_funcs, aeabi_bits_funcs_end
27.equ BITS_FUNC_COUNT, 4
30 .word ROM_FUNC_POPCOUNT32
33 .word ROM_FUNC_REVERSE32
39 ldr r0, =aeabi_bits_funcs
40 movs r1, #BITS_FUNC_COUNT
41 ldr r3, =rom_funcs_lookup
53 ldr r3, =aeabi_bits_funcs
59 ldr r3, =aeabi_bits_funcs
63bits_section popcountsi
64wrapper_func __popcountsi2
65 ldr r3, =aeabi_bits_funcs
66 ldr r3, [r3, #POPCOUNT32]
72 ldr r3, =aeabi_bits_funcs
86 ldr r3, =aeabi_bits_funcs
98bits_section popcountdi
99wrapper_func __popcountdi2
100 ldr r3, =aeabi_bits_funcs
101 ldr r3, [r3, #POPCOUNT32]
111bits_section reverse32
112regular_func reverse32
113 ldr r3, =aeabi_bits_funcs
114 ldr r3, [r3, #REVERSE32]
120 ldr r3, =aeabi_bits_funcs
121 ldr r3, [r3, #REVERSE32]
127 ldr r3, =aeabi_bits_funcs
128 ldr r3, [r3, #REVERSE32]
131 mov ip, r0 // reverse32 preserves ip