]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S
Update remaining ARM .S files with INTERWORK_FUNC macro. This is the 2nd half of...
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / clzsi2.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
4 #
5 # This program and the accompanying materials
6 # are licensed and made available under the terms and conditions of the BSD License
7 # which accompanies this distribution. The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php
9 #
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 #
13 #------------------------------------------------------------------------------
14
15 .text
16 .align 2
17 .globl ASM_PFX(__clzsi2)
18 INTERWORK_FUNC(__clzsi2)
19
20 ASM_PFX(__clzsi2):
21 @ frame_needed = 1, uses_anonymous_args = 0
22 stmfd sp!, {r7, lr}
23 add r7, sp, #0
24 movs r3, r0, lsr #16
25 movne r3, #16
26 moveq r3, #0
27 movne r9, #0
28 moveq r9, #16
29 mov r3, r0, lsr r3
30 tst r3, #65280
31 movne r0, #8
32 moveq r0, #0
33 movne lr, #0
34 moveq lr, #8
35 mov r3, r3, lsr r0
36 tst r3, #240
37 movne r0, #4
38 moveq r0, #0
39 movne ip, #0
40 moveq ip, #4
41 mov r3, r3, lsr r0
42 tst r3, #12
43 movne r0, #2
44 moveq r0, #0
45 movne r1, #0
46 moveq r1, #2
47 mov r2, r3, lsr r0
48 add r3, lr, r9
49 add r0, r3, ip
50 add r1, r0, r1
51 mov r0, r2, lsr #1
52 eor r0, r0, #1
53 ands r0, r0, #1
54 mvnne r0, #0
55 rsb r3, r2, #2
56 and r0, r0, r3
57 add r0, r1, r0
58 ldmfd sp!, {r7, pc}