]>
Commit | Line | Data |
---|---|---|
62a65a65 RD |
1 | /* |
2 | * CDDL HEADER START | |
3 | * | |
4 | * The contents of this file are subject to the terms of the | |
5 | * Common Development and Distribution License (the "License"). | |
6 | * You may not use this file except in compliance with the License. | |
7 | * | |
8 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
9 | * or http://www.opensolaris.org/os/licensing. | |
10 | * See the License for the specific language governing permissions | |
11 | * and limitations under the License. | |
12 | * | |
13 | * When distributing Covered Code, include this CDDL HEADER in each | |
14 | * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
15 | * If applicable, add the following below this CDDL HEADER, with the | |
16 | * fields enclosed by brackets "[]" replaced with your own identifying | |
17 | * information: Portions Copyright [yyyy] [name of copyright owner] | |
18 | * | |
19 | * CDDL HEADER END | |
20 | */ | |
21 | /* | |
22 | * Copyright (C) 2016 Romain Dolbeau. All rights reserved. | |
23 | */ | |
24 | ||
25 | #include <sys/isa_defs.h> | |
26 | ||
27 | #if defined(__aarch64__) | |
28 | ||
29 | #include "vdev_raidz_math_aarch64_neon_common.h" | |
30 | ||
31 | #define GEN_P_DEFINE() \ | |
32 | GEN_X_DEFINE_0_3() \ | |
33 | GEN_X_DEFINE_4_5() \ | |
34 | GEN_X_DEFINE_6_7() | |
35 | #define GEN_P_STRIDE 8 | |
36 | #define GEN_P_P 0, 1, 2, 3, 4, 5, 6, 7 | |
37 | ||
38 | #define GEN_PQ_DEFINE() \ | |
39 | GEN_X_DEFINE_0_3() \ | |
40 | GEN_X_DEFINE_4_5() \ | |
41 | GEN_X_DEFINE_6_7() \ | |
42 | GEN_X_DEFINE_8_9() \ | |
43 | GEN_X_DEFINE_10_11() \ | |
44 | GEN_X_DEFINE_16() \ | |
45 | GEN_X_DEFINE_17() \ | |
46 | GEN_X_DEFINE_33_36() | |
47 | #define GEN_PQ_STRIDE 4 | |
48 | #define GEN_PQ_D 0, 1, 2, 3 | |
49 | #define GEN_PQ_P 4, 5, 6, 7 | |
50 | #define GEN_PQ_Q 8, 9, 10, 11 | |
51 | ||
52 | #define GEN_PQR_DEFINE() \ | |
53 | GEN_X_DEFINE_0_3() \ | |
54 | GEN_X_DEFINE_4_5() \ | |
55 | GEN_X_DEFINE_6_7() \ | |
56 | GEN_X_DEFINE_8_9() \ | |
57 | GEN_X_DEFINE_22_23() \ | |
58 | GEN_X_DEFINE_24_27() \ | |
59 | GEN_X_DEFINE_16() \ | |
60 | GEN_X_DEFINE_17() \ | |
61 | GEN_X_DEFINE_33_36() | |
62 | #define GEN_PQR_STRIDE 4 | |
63 | #define GEN_PQR_D 0, 1, 2, 3 | |
64 | #define GEN_PQR_P 4, 5, 6, 7 | |
65 | #define GEN_PQR_Q 8, 9, 22, 23 | |
66 | #define GEN_PQR_R 24, 25, 26, 27 | |
67 | ||
68 | #define REC_P_DEFINE() \ | |
69 | GEN_X_DEFINE_0_3() \ | |
70 | GEN_X_DEFINE_33_36() | |
71 | #define REC_P_STRIDE 4 | |
72 | #define REC_P_X 0, 1, 2, 3 | |
73 | ||
74 | #define REC_Q_DEFINE() \ | |
75 | GEN_X_DEFINE_0_3() \ | |
76 | GEN_X_DEFINE_16() \ | |
77 | GEN_X_DEFINE_17() \ | |
78 | GEN_X_DEFINE_33_36() | |
79 | #define REC_Q_STRIDE 4 | |
80 | #define REC_Q_X 0, 1, 2, 3 | |
81 | ||
82 | #define REC_R_DEFINE() \ | |
83 | GEN_X_DEFINE_0_3() \ | |
84 | GEN_X_DEFINE_16() \ | |
85 | GEN_X_DEFINE_17() \ | |
86 | GEN_X_DEFINE_33_36() | |
87 | #define REC_R_STRIDE 4 | |
88 | #define REC_R_X 0, 1, 2, 3 | |
89 | ||
90 | #define REC_PQ_DEFINE() \ | |
91 | GEN_X_DEFINE_0_3() \ | |
92 | GEN_X_DEFINE_4_5() \ | |
93 | GEN_X_DEFINE_6_7() \ | |
94 | GEN_X_DEFINE_8_9() \ | |
95 | GEN_X_DEFINE_16() \ | |
96 | GEN_X_DEFINE_17() \ | |
97 | GEN_X_DEFINE_22_23() \ | |
98 | GEN_X_DEFINE_33_36() | |
99 | #define REC_PQ_STRIDE 4 | |
100 | #define REC_PQ_X 0, 1, 2, 3 | |
101 | #define REC_PQ_Y 4, 5, 6, 7 | |
102 | #define REC_PQ_D 8, 9, 22, 23 | |
103 | ||
104 | #define REC_PR_DEFINE() REC_PQ_DEFINE() | |
105 | #define REC_PR_STRIDE 4 | |
106 | #define REC_PR_X 0, 1, 2, 3 | |
107 | #define REC_PR_Y 4, 5, 6, 7 | |
108 | #define REC_PR_D 8, 9, 22, 23 | |
109 | ||
110 | #define REC_QR_DEFINE() REC_PQ_DEFINE() | |
111 | #define REC_QR_STRIDE 4 | |
112 | #define REC_QR_X 0, 1, 2, 3 | |
113 | #define REC_QR_Y 4, 5, 6, 7 | |
114 | #define REC_QR_D 8, 9, 22, 23 | |
115 | ||
116 | #define REC_PQR_DEFINE() \ | |
117 | GEN_X_DEFINE_0_3() \ | |
118 | GEN_X_DEFINE_4_5() \ | |
119 | GEN_X_DEFINE_6_7() \ | |
120 | GEN_X_DEFINE_8_9() \ | |
121 | GEN_X_DEFINE_16() \ | |
122 | GEN_X_DEFINE_17() \ | |
123 | GEN_X_DEFINE_22_23() \ | |
124 | GEN_X_DEFINE_24_27() \ | |
125 | GEN_X_DEFINE_28_30() \ | |
126 | GEN_X_DEFINE_31() \ | |
127 | GEN_X_DEFINE_33_36() | |
128 | #define REC_PQR_STRIDE 4 | |
129 | #define REC_PQR_X 0, 1, 2, 3 | |
130 | #define REC_PQR_Y 4, 5, 6, 7 | |
131 | #define REC_PQR_Z 8, 9, 22, 23 | |
132 | #define REC_PQR_D 24, 25, 26, 27 | |
133 | #define REC_PQR_XS 24, 25, 26, 27 | |
134 | #define REC_PQR_YS 28, 29, 30, 31 | |
135 | ||
136 | ||
137 | #include <sys/vdev_raidz_impl.h> | |
138 | #include "vdev_raidz_math_impl.h" | |
139 | ||
140 | DEFINE_GEN_METHODS(aarch64_neonx2); | |
141 | /* | |
142 | * If compiled with -O0, gcc doesn't do any stack frame coalescing | |
143 | * and -Wframe-larger-than=1024 is triggered in debug mode. | |
144 | */ | |
145 | #pragma GCC diagnostic ignored "-Wframe-larger-than=" | |
146 | DEFINE_REC_METHODS(aarch64_neonx2); | |
147 | #pragma GCC diagnostic pop | |
148 | ||
149 | static boolean_t | |
150 | raidz_will_aarch64_neonx2_work(void) | |
151 | { | |
152 | return (B_TRUE); // __arch64__ requires NEON | |
153 | } | |
154 | ||
155 | const raidz_impl_ops_t vdev_raidz_aarch64_neonx2_impl = { | |
156 | .init = NULL, | |
157 | .fini = NULL, | |
158 | .gen = RAIDZ_GEN_METHODS(aarch64_neonx2), | |
159 | .rec = RAIDZ_REC_METHODS(aarch64_neonx2), | |
160 | .is_supported = &raidz_will_aarch64_neonx2_work, | |
161 | .name = "aarch64_neonx2" | |
162 | }; | |
163 | ||
164 | #endif /* defined(__aarch64__) */ |