]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm
MdePkg/BaseMemoryLibOptDxe ARM|AARCH64: implement accelerated GUID functions
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibOptDxe / Arm / CompareGuid.asm
1 ;
2 ; Copyright (c) 2016, Linaro Limited
3 ; All rights reserved.
4 ;
5 ; Redistribution and use in source and binary forms, with or without
6 ; modification, are permitted provided that the following conditions are met:
7 ; * Redistributions of source code must retain the above copyright
8 ; notice, this list of conditions and the following disclaimer.
9 ; * Redistributions in binary form must reproduce the above copyright
10 ; notice, this list of conditions and the following disclaimer in the
11 ; documentation and/or other materials provided with the distribution.
12 ; * Neither the name of the Linaro nor the
13 ; names of its contributors may be used to endorse or promote products
14 ; derived from this software without specific prior written permission.
15 ;
16 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 ; HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 ; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 ;
28
29 EXPORT InternalMemCompareGuid
30 THUMB
31 AREA CompareGuid, CODE, READONLY, CODEALIGN, ALIGN=5
32
33 InternalMemCompareGuid
34 push {r4, lr}
35 ldr r2, [r0]
36 ldr r3, [r0, #4]
37 ldr r4, [r0, #8]
38 ldr r0, [r0, #12]
39 cbz r1, L1
40 ldr ip, [r1]
41 ldr lr, [r1, #4]
42 cmp r2, ip
43 it eq
44 cmpeq r3, lr
45 beq L0
46 movs r0, #0
47 pop {r4, pc}
48
49 L0
50 ldr r2, [r1, #8]
51 ldr r3, [r1, #12]
52 cmp r4, r2
53 it eq
54 cmpeq r0, r3
55 bne L2
56 movs r0, #1
57 pop {r4, pc}
58
59 L1
60 orrs r2, r2, r3
61 orrs r4, r4, r0
62 movs r0, #1
63 orrs r2, r2, r4
64
65 L2
66 it ne
67 movne r0, #0
68 pop {r4, pc}
69
70 END