]> git.proxmox.com Git - ceph.git/blob - ceph/src/isa-l/crc/aarch64/crc32c_mix_default.S
87b8ce39c60162a6e87ff0cf7ad6daf9948ac483
[ceph.git] / ceph / src / isa-l / crc / aarch64 / crc32c_mix_default.S
1 /**********************************************************************
2 Copyright(c) 2020 Arm Corporation All rights reserved.
3
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
6 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
11 the documentation and/or other materials provided with the
12 distribution.
13 * Neither the name of Arm Corporation nor the names of its
14 contributors may be used to endorse or promote products derived
15 from this software without specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 **********************************************************************/
29
30 .text
31 .arch armv8-a+crypto+crc
32 .align 6
33
34 .macro crc32_u64 dst,src,data
35 crc32cx \dst,\src,\data
36 .endm
37
38 .macro crc32_u32 dst,src,data
39 crc32cw \dst,\src,\data
40 .endm
41
42 .macro crc32_u16 dst,src,data
43 crc32ch \dst,\src,\data
44 .endm
45
46 .macro crc32_u8 dst,src,data
47 crc32cb \dst,\src,\data
48 .endm
49
50 #include "crc32_mix_default_common.S"
51
52 .global crc32c_mix_default
53 .type crc32c_mix_default, %function
54 crc32c_mix_default:
55 mov w3, w2
56 sxtw x2, w1
57 mov x1, x0
58 mov w0, w3
59 crc32_mix_main_default
60 .size crc32c_mix_default, .-crc32c_mix_default
61
62 .section .rodata
63 .align 4
64 .set lanchor_crc32,. + 0
65
66 .type k1k2, %object
67 .size k1k2, 16
68 k1k2:
69 .xword 0x00740eef02
70 .xword 0x009e4addf8
71
72 .type k3k4, %object
73 .size k3k4, 16
74 k3k4:
75 .xword 0x00f20c0dfe
76 .xword 0x014cd00bd6
77
78 .type k5k0, %object
79 .size k5k0, 16
80 k5k0:
81 .xword 0x00dd45aab8
82 .xword 0
83
84 .type poly, %object
85 .size poly, 16
86 poly:
87 .xword 0x0105ec76f0
88 .xword 0x00dea713f1
89
90 .type crc32_const, %object
91 .size crc32_const, 48
92 crc32_const:
93 .xword 0x9ef68d35
94 .xword 0
95 .xword 0x170076fa
96 .xword 0
97 .xword 0xdd7e3b0c
98 .xword 0
99
100 .align 4
101 .set .lanchor_mask,. + 0
102
103 .type mask, %object
104 .size mask, 16
105 mask:
106 .word -1
107 .word 0
108 .word -1
109 .word 0