]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S
Update remaining ARM .S files with INTERWORK_FUNC macro. This is the 2nd half of...
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / ctzsi2.S
CommitLineData
06dc4de1
A
1#------------------------------------------------------------------------------
2#
d6ebcab7 3# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
06dc4de1 4#
d6ebcab7 5# This program and the accompanying materials
06dc4de1
A
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
4e471bfd 17 .globl ASM_PFX(__ctzsi2)
63ca7402 18 INTERWORK_FUNC(__ctzsi2)\r
4e471bfd 19
20ASM_PFX(__ctzsi2):
06dc4de1
A
21 uxth r3, r0
22 cmp r3, #0
23 moveq ip, #16
24 movne ip, #0
25 @ lr needed for prologue
26 mov r0, r0, lsr ip
27 tst r0, #255
28 movne r3, #0
29 moveq r3, #8
30 mov r0, r0, lsr r3
31 tst r0, #15
32 movne r1, #0
33 moveq r1, #4
34 add r3, r3, ip
35 mov r0, r0, lsr r1
36 tst r0, #3
37 movne r2, #0
38 moveq r2, #2
39 add r3, r3, r1
40 mov r0, r0, lsr r2
41 and r0, r0, #3
42 add r2, r3, r2
43 eor r3, r0, #1
44 mov r0, r0, lsr #1
45 ands r3, r3, #1
46 mvnne r3, #0
47 rsb r0, r0, #2
48 and r0, r3, r0
49 add r0, r2, r0
50 bx lr