aboutsummaryrefslogtreecommitdiff
path: root/cube.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-19 10:40:49 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-19 10:40:49 +0100
commit13275a4bb8696e730a4fffdd05b8e1d046e489c6 (patch)
tree4db3ed3ada41158c451188c98e74fdde5ea296b2 /cube.c
parentd6fdf14d5c320bdca455f910d58d652c5a7827da (diff)
downloadnissy-core-13275a4bb8696e730a4fffdd05b8e1d046e489c6.tar.gz
nissy-core-13275a4bb8696e730a4fffdd05b8e1d046e489c6.zip
Simplified cube definition for move and transformations even more
Diffstat (limited to 'cube.c')
-rw-r--r--cube.c1069
1 files changed, 342 insertions, 727 deletions
diff --git a/cube.c b/cube.c
index 9fd1949..558c094 100644
--- a/cube.c
+++ b/cube.c
@@ -134,6 +134,241 @@ Section: constants, strings and other stuff
134#define _eflip 0x10U 134#define _eflip 0x10U
135#define _error 0xFFU 135#define _error 0xFFU
136 136
137#define zero_fast fastcube( \
138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
139#define solved_fast fastcube( \
140 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
141
142#define _move_cube_U fastcube( \
143 5, 4, 2, 3, 0, 1, 6, 7, 4, 5, 2, 3, 1, 0, 6, 7, 8, 9, 10, 11)
144#define _move_cube_U2 fastcube( \
145 1, 0, 2, 3, 5, 4, 6, 7, 1, 0, 2, 3, 5, 4, 6, 7, 8, 9, 10, 11)
146#define _move_cube_U3 fastcube( \
147 4, 5, 2, 3, 1, 0, 6, 7, 5, 4, 2, 3, 0, 1, 6, 7, 8, 9, 10, 11)
148#define _move_cube_D fastcube( \
149 0, 1, 7, 6, 4, 5, 2, 3, 0, 1, 7, 6, 4, 5, 2, 3, 8, 9, 10, 11)
150#define _move_cube_D2 fastcube( \
151 0, 1, 3, 2, 4, 5, 7, 6, 0, 1, 3, 2, 4, 5, 7, 6, 8, 9, 10, 11)
152#define _move_cube_D3 fastcube( \
153 0, 1, 6, 7, 4, 5, 3, 2, 0, 1, 6, 7, 4, 5, 3, 2, 8, 9, 10, 11)
154#define _move_cube_R fastcube( \
155 70, 1, 2, 69, 4, 32, 35, 7, 0, 1, 2, 3, 8, 5, 6, 11, 7, 9, 10, 4)
156#define _move_cube_R2 fastcube( \
157 3, 1, 2, 0, 4, 6, 5, 7, 0, 1, 2, 3, 7, 5, 6, 4, 11, 9, 10, 8)
158#define _move_cube_R3 fastcube( \
159 69, 1, 2, 70, 4, 35, 32, 7, 0, 1, 2, 3, 11, 5, 6, 8, 4, 9, 10, 7)
160#define _move_cube_L fastcube( \
161 0, 71, 68, 3, 33, 5, 6, 34, 0, 1, 2, 3, 4, 10, 9, 7, 8, 5, 6, 11)
162#define _move_cube_L2 fastcube( \
163 0, 2, 1, 3, 7, 5, 6, 4, 0, 1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 11)
164#define _move_cube_L3 fastcube( \
165 0, 68, 71, 3, 34, 5, 6, 33, 0, 1, 2, 3, 4, 9, 10, 7, 8, 6, 5, 11)
166#define _move_cube_F fastcube( \
167 36, 1, 38, 3, 66, 5, 64, 7, 25, 1, 2, 24, 4, 5, 6, 7, 16, 19, 10, 11)
168#define _move_cube_F2 fastcube( \
169 2, 1, 0, 3, 6, 5, 4, 7, 3, 1, 2, 0, 4, 5, 6, 7, 9, 8, 10, 11)
170#define _move_cube_F3 fastcube( \
171 38, 1, 36, 3, 64, 5, 66, 7, 24, 1, 2, 25, 4, 5, 6, 7, 19, 16, 10, 11)
172#define _move_cube_B fastcube( \
173 0, 37, 2, 39, 4, 67, 6, 65, 0, 27, 26, 3, 4, 5, 6, 7, 8, 9, 17, 18)
174#define _move_cube_B2 fastcube( \
175 0, 3, 2, 1, 4, 7, 6, 5, 0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 11, 10)
176#define _move_cube_B3 fastcube( \
177 0, 39, 2, 37, 4, 65, 6, 67, 0, 26, 27, 3, 4, 5, 6, 7, 8, 9, 18, 17)
178
179#define _trans_cube_UFr fastcube( \
180 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
181#define _trans_cube_UFr_inverse fastcube( \
182 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
183#define _trans_cube_ULr fastcube( \
184 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24)
185#define _trans_cube_ULr_inverse fastcube( \
186 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26)
187#define _trans_cube_UBr fastcube( \
188 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9)
189#define _trans_cube_UBr_inverse fastcube( \
190 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9)
191#define _trans_cube_URr fastcube( \
192 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26)
193#define _trans_cube_URr_inverse fastcube( \
194 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24)
195#define _trans_cube_DFr fastcube( \
196 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10)
197#define _trans_cube_DFr_inverse fastcube( \
198 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10)
199#define _trans_cube_DLr fastcube( \
200 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27)
201#define _trans_cube_DLr_inverse fastcube( \
202 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27)
203#define _trans_cube_DBr fastcube( \
204 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8)
205#define _trans_cube_DBr_inverse fastcube( \
206 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8)
207#define _trans_cube_DRr fastcube( \
208 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25)
209#define _trans_cube_DRr_inverse fastcube( \
210 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25)
211#define _trans_cube_RUr fastcube( \
212 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3)
213#define _trans_cube_RUr_inverse fastcube( \
214 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21)
215#define _trans_cube_RFr fastcube( \
216 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18)
217#define _trans_cube_RFr_inverse fastcube( \
218 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17)
219#define _trans_cube_RDr fastcube( \
220 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1)
221#define _trans_cube_RDr_inverse fastcube( \
222 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20)
223#define _trans_cube_RBr fastcube( \
224 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16)
225#define _trans_cube_RBr_inverse fastcube( \
226 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16)
227#define _trans_cube_LUr fastcube( \
228 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2)
229#define _trans_cube_LUr_inverse fastcube( \
230 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23)
231#define _trans_cube_LFr fastcube( \
232 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17)
233#define _trans_cube_LFr_inverse fastcube( \
234 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18)
235#define _trans_cube_LDr fastcube( \
236 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0)
237#define _trans_cube_LDr_inverse fastcube( \
238 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22)
239#define _trans_cube_LBr fastcube( \
240 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19)
241#define _trans_cube_LBr_inverse fastcube( \
242 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19)
243#define _trans_cube_FUr fastcube( \
244 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6)
245#define _trans_cube_FUr_inverse fastcube( \
246 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6)
247#define _trans_cube_FRr fastcube( \
248 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21)
249#define _trans_cube_FRr_inverse fastcube( \
250 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3)
251#define _trans_cube_FDr fastcube( \
252 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4)
253#define _trans_cube_FDr_inverse fastcube( \
254 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7)
255#define _trans_cube_FLr fastcube( \
256 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23)
257#define _trans_cube_FLr_inverse fastcube( \
258 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2)
259#define _trans_cube_BUr fastcube( \
260 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7)
261#define _trans_cube_BUr_inverse fastcube( \
262 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4)
263#define _trans_cube_BRr fastcube( \
264 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22)
265#define _trans_cube_BRr_inverse fastcube( \
266 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0)
267#define _trans_cube_BDr fastcube( \
268 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5)
269#define _trans_cube_BDr_inverse fastcube( \
270 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5)
271#define _trans_cube_BLr fastcube( \
272 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20)
273#define _trans_cube_BLr_inverse fastcube( \
274 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1)
275#define _trans_cube_UFm fastcube( \
276 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10)
277#define _trans_cube_UFm_inverse fastcube( \
278 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10)
279#define _trans_cube_ULm fastcube( \
280 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25)
281#define _trans_cube_ULm_inverse fastcube( \
282 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25)
283#define _trans_cube_UBm fastcube( \
284 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8)
285#define _trans_cube_UBm_inverse fastcube( \
286 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8)
287#define _trans_cube_URm fastcube( \
288 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27)
289#define _trans_cube_URm_inverse fastcube( \
290 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27)
291#define _trans_cube_DFm fastcube( \
292 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11)
293#define _trans_cube_DFm_inverse fastcube( \
294 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11)
295#define _trans_cube_DLm fastcube( \
296 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26)
297#define _trans_cube_DLm_inverse fastcube( \
298 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24)
299#define _trans_cube_DBm fastcube( \
300 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9)
301#define _trans_cube_DBm_inverse fastcube( \
302 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9)
303#define _trans_cube_DRm fastcube( \
304 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24)
305#define _trans_cube_DRm_inverse fastcube( \
306 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26)
307#define _trans_cube_RUm fastcube( \
308 68, 71, 69, 70, 33, 34, 32, 35, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3)
309#define _trans_cube_RUm_inverse fastcube( \
310 70, 68, 69, 71, 32, 34, 35, 33, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22)
311#define _trans_cube_RFm fastcube( \
312 34, 33, 32, 35, 68, 71, 70, 69, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18)
313#define _trans_cube_RFm_inverse fastcube( \
314 66, 65, 64, 67, 36, 39, 38, 37, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18)
315#define _trans_cube_RDm fastcube( \
316 71, 68, 70, 69, 34, 33, 35, 32, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1)
317#define _trans_cube_RDm_inverse fastcube( \
318 71, 69, 68, 70, 33, 35, 34, 32, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23)
319#define _trans_cube_RBm fastcube( \
320 33, 34, 35, 32, 71, 68, 69, 70, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16)
321#define _trans_cube_RBm_inverse fastcube( \
322 67, 64, 65, 66, 37, 38, 39, 36, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19)
323#define _trans_cube_LUm fastcube( \
324 69, 70, 68, 71, 32, 35, 33, 34, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2)
325#define _trans_cube_LUm_inverse fastcube( \
326 68, 70, 71, 69, 34, 32, 33, 35, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20)
327#define _trans_cube_LFm fastcube( \
328 32, 35, 34, 33, 70, 69, 68, 71, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17)
329#define _trans_cube_LFm_inverse fastcube( \
330 64, 67, 66, 65, 38, 37, 36, 39, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17)
331#define _trans_cube_LDm fastcube( \
332 70, 69, 71, 68, 35, 32, 34, 33, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0)
333#define _trans_cube_LDm_inverse fastcube( \
334 69, 71, 70, 68, 35, 33, 32, 34, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21)
335#define _trans_cube_LBm fastcube( \
336 35, 32, 33, 34, 69, 70, 71, 68, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19)
337#define _trans_cube_LBm_inverse fastcube( \
338 65, 66, 67, 64, 39, 36, 37, 38, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16)
339#define _trans_cube_FUm fastcube( \
340 64, 66, 65, 67, 36, 38, 37, 39, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7)
341#define _trans_cube_FUm_inverse fastcube( \
342 32, 34, 33, 35, 68, 70, 69, 71, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7)
343#define _trans_cube_FRm fastcube( \
344 36, 38, 39, 37, 66, 64, 65, 67, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20)
345#define _trans_cube_FRm_inverse fastcube( \
346 37, 38, 36, 39, 64, 67, 65, 66, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2)
347#define _trans_cube_FDm fastcube( \
348 66, 64, 67, 65, 38, 36, 39, 37, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5)
349#define _trans_cube_FDm_inverse fastcube( \
350 33, 35, 32, 34, 69, 71, 68, 70, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6)
351#define _trans_cube_FLm fastcube( \
352 38, 36, 37, 39, 64, 66, 67, 65, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22)
353#define _trans_cube_FLm_inverse fastcube( \
354 36, 39, 37, 38, 65, 66, 64, 67, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3)
355#define _trans_cube_BUm fastcube( \
356 65, 67, 64, 66, 37, 39, 36, 38, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6)
357#define _trans_cube_BUm_inverse fastcube( \
358 34, 32, 35, 33, 70, 68, 71, 69, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5)
359#define _trans_cube_BRm fastcube( \
360 39, 37, 36, 38, 65, 67, 66, 64, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23)
361#define _trans_cube_BRm_inverse fastcube( \
362 39, 36, 38, 37, 66, 65, 67, 64, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1)
363#define _trans_cube_BDm fastcube( \
364 67, 65, 66, 64, 39, 37, 38, 36, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4)
365#define _trans_cube_BDm_inverse fastcube( \
366 35, 33, 34, 32, 71, 69, 70, 68, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4)
367#define _trans_cube_BLm fastcube( \
368 37, 39, 38, 36, 67, 65, 64, 66, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21)
369#define _trans_cube_BLm_inverse fastcube( \
370 38, 37, 39, 36, 67, 64, 66, 65, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0)
371
137static char *cornerstr[] = { 372static char *cornerstr[] = {
138 [_c_ufr] = "UFR", 373 [_c_ufr] = "UFR",
139 [_c_ubl] = "UBL", 374 [_c_ubl] = "UBL",
@@ -259,356 +494,13 @@ typedef __m256i cube_fast_t;
259#define _co2_avx2 _mm256_set_epi64x(0, 0, 0, 0x6060606060606060) 494#define _co2_avx2 _mm256_set_epi64x(0, 0, 0, 0x6060606060606060)
260#define _cocw_avx2 _mm256_set_epi64x(0, 0, 0, 0x2020202020202020) 495#define _cocw_avx2 _mm256_set_epi64x(0, 0, 0, 0x2020202020202020)
261#define _eo_avx2 _mm256_set_epi64x(0x10101010, 0x1010101010101010, 0, 0) 496#define _eo_avx2 _mm256_set_epi64x(0x10101010, 0x1010101010101010, 0, 0)
262#define zero_fast _mm256_set_epi64x(0, 0, 0, 0);
263#define solved_fast _mm256_set_epi8( \
264 0, 0, 0, 0, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, \
265 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0 \
266)
267
268#define _move_cube_U _mm256_set_epi8( \
269 0, 0, 0, 0, 11, 10, 9, 8, 7, 6, 0, 1, 3, 2, 5, 4, \
270 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 1, 0, 3, 2, 4, 5)
271#define _move_cube_U2 _mm256_set_epi8( \
272 0, 0, 0, 0, 11, 10, 9, 8, 7, 6, 4, 5, 3, 2, 0, 1, \
273 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 4, 5, 3, 2, 0, 1)
274#define _move_cube_U3 _mm256_set_epi8( \
275 0, 0, 0, 0, 11, 10, 9, 8, 7, 6, 1, 0, 3, 2, 4, 5, \
276 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 0, 1, 3, 2, 5, 4)
277#define _move_cube_D _mm256_set_epi8( \
278 0, 0, 0, 0, 11, 10, 9, 8, 3, 2, 5, 4, 6, 7, 1, 0, \
279 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 5, 4, 6, 7, 1, 0)
280#define _move_cube_D2 _mm256_set_epi8( \
281 0, 0, 0, 0, 11, 10, 9, 8, 6, 7, 5, 4, 2, 3, 1, 0, \
282 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 5, 4, 2, 3, 1, 0)
283#define _move_cube_D3 _mm256_set_epi8( \
284 0, 0, 0, 0, 11, 10, 9, 8, 2, 3, 5, 4, 7, 6, 1, 0, \
285 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 4, 7, 6, 1, 0)
286#define _move_cube_R _mm256_set_epi8( \
287 0, 0, 0, 0, 4, 10, 9, 7, 11, 6, 5, 8, 3, 2, 1, 0, \
288 0, 0, 0, 0, 0, 0, 0, 0, 7, 35, 32, 4, 69, 2, 1, 70)
289#define _move_cube_R2 _mm256_set_epi8( \
290 0, 0, 0, 0, 8, 10, 9, 11, 4, 6, 5, 7, 3, 2, 1, 0, \
291 0, 0, 0, 0, 0, 0, 0, 0, 7, 5, 6, 4, 0, 2, 1, 3)
292#define _move_cube_R3 _mm256_set_epi8( \
293 0, 0, 0, 0, 7, 10, 9, 4, 8, 6, 5, 11, 3, 2, 1, 0, \
294 0, 0, 0, 0, 0, 0, 0, 0, 7, 32, 35, 4, 70, 2, 1, 69)
295#define _move_cube_L _mm256_set_epi8( \
296 0, 0, 0, 0, 11, 6, 5, 8, 7, 9, 10, 4, 3, 2, 1, 0, \
297 0, 0, 0, 0, 0, 0, 0, 0, 34, 6, 5, 33, 3, 68, 71, 0)
298#define _move_cube_L2 _mm256_set_epi8( \
299 0, 0, 0, 0, 11, 9, 10, 8, 7, 5, 6, 4, 3, 2, 1, 0, \
300 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 5, 7, 3, 1, 2, 0)
301#define _move_cube_L3 _mm256_set_epi8( \
302 0, 0, 0, 0, 11, 5, 6, 8, 7, 10, 9, 4, 3, 2, 1, 0, \
303 0, 0, 0, 0, 0, 0, 0, 0, 33, 6, 5, 34, 3, 71, 68, 0)
304#define _move_cube_F _mm256_set_epi8( \
305 0, 0, 0, 0, 11, 10, 19, 16, 7, 6, 5, 4, 24, 2, 1, 25, \
306 0, 0, 0, 0, 0, 0, 0, 0, 7, 64, 5, 66, 3, 38, 1, 36)
307#define _move_cube_F2 _mm256_set_epi8( \
308 0, 0, 0, 0, 11, 10, 8, 9, 7, 6, 5, 4, 0, 2, 1, 3, \
309 0, 0, 0, 0, 0, 0, 0, 0, 7, 4, 5, 6, 3, 0, 1, 2)
310#define _move_cube_F3 _mm256_set_epi8( \
311 0, 0, 0, 0, 11, 10, 16, 19, 7, 6, 5, 4, 25, 2, 1, 24, \
312 0, 0, 0, 0, 0, 0, 0, 0, 7, 66, 5, 64, 3, 36, 1, 38)
313#define _move_cube_B _mm256_set_epi8( \
314 0, 0, 0, 0, 18, 17, 9, 8, 7, 6, 5, 4, 3, 26, 27, 0, \
315 0, 0, 0, 0, 0, 0, 0, 0, 65, 6, 67, 4, 39, 2, 37, 0)
316#define _move_cube_B2 _mm256_set_epi8( \
317 0, 0, 0, 0, 10, 11, 9, 8, 7, 6, 5, 4, 3, 1, 2, 0, \
318 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, 4, 1, 2, 3, 0)
319#define _move_cube_B3 _mm256_set_epi8( \
320 0, 0, 0, 0, 17, 18, 9, 8, 7, 6, 5, 4, 3, 27, 26, 0, \
321 0, 0, 0, 0, 0, 0, 0, 0, 67, 6, 65, 4, 37, 2, 39, 0)
322
323#define _trans_cube_UFr _mm256_set_epi8( \
324 0, 0, 0, 0, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, \
325 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0)
326#define _trans_cube_UFr_inverse _mm256_set_epi8( \
327 0, 0, 0, 0, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, \
328 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0)
329#define _trans_cube_ULr _mm256_set_epi8( \
330 0, 0, 0, 0, 24, 27, 26, 25, 3, 2, 1, 0, 6, 7, 4, 5, \
331 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 1, 6, 7, 5, 4)
332#define _trans_cube_ULr_inverse _mm256_set_epi8( \
333 0, 0, 0, 0, 26, 25, 24, 27, 2, 3, 0, 1, 7, 6, 5, 4, \
334 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 1, 0, 7, 6, 4, 5)
335#define _trans_cube_UBr _mm256_set_epi8( \
336 0, 0, 0, 0, 9, 8, 11, 10, 6, 7, 4, 5, 2, 3, 0, 1, \
337 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 4, 5, 2, 3, 0, 1)
338#define _trans_cube_UBr_inverse _mm256_set_epi8( \
339 0, 0, 0, 0, 9, 8, 11, 10, 6, 7, 4, 5, 2, 3, 0, 1, \
340 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 4, 5, 2, 3, 0, 1)
341#define _trans_cube_URr _mm256_set_epi8( \
342 0, 0, 0, 0, 26, 25, 24, 27, 2, 3, 0, 1, 7, 6, 5, 4, \
343 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 1, 0, 7, 6, 4, 5)
344#define _trans_cube_URr_inverse _mm256_set_epi8( \
345 0, 0, 0, 0, 24, 27, 26, 25, 3, 2, 1, 0, 6, 7, 4, 5, \
346 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 1, 6, 7, 5, 4)
347#define _trans_cube_DFr _mm256_set_epi8( \
348 0, 0, 0, 0, 10, 11, 8, 9, 5, 4, 7, 6, 0, 1, 2, 3, \
349 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 7, 6, 1, 0, 3, 2)
350#define _trans_cube_DFr_inverse _mm256_set_epi8( \
351 0, 0, 0, 0, 10, 11, 8, 9, 5, 4, 7, 6, 0, 1, 2, 3, \
352 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 7, 6, 1, 0, 3, 2)
353#define _trans_cube_DLr _mm256_set_epi8( \
354 0, 0, 0, 0, 27, 24, 25, 26, 1, 0, 3, 2, 5, 4, 7, 6, \
355 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 5, 4, 6, 7)
356#define _trans_cube_DLr_inverse _mm256_set_epi8( \
357 0, 0, 0, 0, 27, 24, 25, 26, 1, 0, 3, 2, 5, 4, 7, 6, \
358 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 5, 4, 6, 7)
359#define _trans_cube_DBr _mm256_set_epi8( \
360 0, 0, 0, 0, 8, 9, 10, 11, 4, 5, 6, 7, 1, 0, 3, 2, \
361 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 0, 1, 2, 3)
362#define _trans_cube_DBr_inverse _mm256_set_epi8( \
363 0, 0, 0, 0, 8, 9, 10, 11, 4, 5, 6, 7, 1, 0, 3, 2, \
364 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 0, 1, 2, 3)
365#define _trans_cube_DRr _mm256_set_epi8( \
366 0, 0, 0, 0, 25, 26, 27, 24, 0, 1, 2, 3, 4, 5, 6, 7, \
367 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 3, 4, 5, 7, 6)
368#define _trans_cube_DRr_inverse _mm256_set_epi8( \
369 0, 0, 0, 0, 25, 26, 27, 24, 0, 1, 2, 3, 4, 5, 6, 7, \
370 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 3, 4, 5, 7, 6)
371#define _trans_cube_RUr _mm256_set_epi8( \
372 0, 0, 0, 0, 3, 2, 1, 0, 25, 26, 27, 24, 21, 22, 23, 20, \
373 0, 0, 0, 0, 0, 0, 0, 0, 39, 36, 38, 37, 66, 65, 67, 64)
374#define _trans_cube_RUr_inverse _mm256_set_epi8( \
375 0, 0, 0, 0, 21, 22, 23, 20, 17, 18, 19, 16, 11, 10, 9, 8, \
376 0, 0, 0, 0, 0, 0, 0, 0, 71, 69, 68, 70, 33, 35, 34, 32)
377#define _trans_cube_RFr _mm256_set_epi8( \
378 0, 0, 0, 0, 18, 17, 16, 19, 22, 21, 20, 23, 25, 26, 27, 24, \
379 0, 0, 0, 0, 0, 0, 0, 0, 65, 66, 67, 64, 39, 36, 37, 38)
380#define _trans_cube_RFr_inverse _mm256_set_epi8( \
381 0, 0, 0, 0, 17, 18, 19, 16, 20, 23, 22, 21, 24, 27, 26, 25, \
382 0, 0, 0, 0, 0, 0, 0, 0, 67, 64, 65, 66, 37, 38, 39, 36)
383#define _trans_cube_RDr _mm256_set_epi8( \
384 0, 0, 0, 0, 1, 0, 3, 2, 26, 25, 24, 27, 22, 21, 20, 23, \
385 0, 0, 0, 0, 0, 0, 0, 0, 36, 39, 37, 38, 65, 66, 64, 67)
386#define _trans_cube_RDr_inverse _mm256_set_epi8( \
387 0, 0, 0, 0, 20, 23, 22, 21, 16, 19, 18, 17, 9, 8, 11, 10, \
388 0, 0, 0, 0, 0, 0, 0, 0, 70, 68, 69, 71, 32, 34, 35, 33)
389#define _trans_cube_RBr _mm256_set_epi8( \
390 0, 0, 0, 0, 16, 19, 18, 17, 21, 22, 23, 20, 26, 25, 24, 27, \
391 0, 0, 0, 0, 0, 0, 0, 0, 66, 65, 64, 67, 36, 39, 38, 37)
392#define _trans_cube_RBr_inverse _mm256_set_epi8( \
393 0, 0, 0, 0, 16, 19, 18, 17, 21, 22, 23, 20, 26, 25, 24, 27, \
394 0, 0, 0, 0, 0, 0, 0, 0, 66, 65, 64, 67, 36, 39, 38, 37)
395#define _trans_cube_LUr _mm256_set_epi8( \
396 0, 0, 0, 0, 2, 3, 0, 1, 27, 24, 25, 26, 20, 23, 22, 21, \
397 0, 0, 0, 0, 0, 0, 0, 0, 38, 37, 39, 36, 67, 64, 66, 65)
398#define _trans_cube_LUr_inverse _mm256_set_epi8( \
399 0, 0, 0, 0, 23, 20, 21, 22, 18, 17, 16, 19, 10, 11, 8, 9, \
400 0, 0, 0, 0, 0, 0, 0, 0, 69, 71, 70, 68, 35, 33, 32, 34)
401#define _trans_cube_LFr _mm256_set_epi8( \
402 0, 0, 0, 0, 17, 18, 19, 16, 20, 23, 22, 21, 24, 27, 26, 25, \
403 0, 0, 0, 0, 0, 0, 0, 0, 67, 64, 65, 66, 37, 38, 39, 36)
404#define _trans_cube_LFr_inverse _mm256_set_epi8( \
405 0, 0, 0, 0, 18, 17, 16, 19, 22, 21, 20, 23, 25, 26, 27, 24, \
406 0, 0, 0, 0, 0, 0, 0, 0, 65, 66, 67, 64, 39, 36, 37, 38)
407#define _trans_cube_LDr _mm256_set_epi8( \
408 0, 0, 0, 0, 0, 1, 2, 3, 24, 27, 26, 25, 23, 20, 21, 22, \
409 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 36, 39, 64, 67, 65, 66)
410#define _trans_cube_LDr_inverse _mm256_set_epi8( \
411 0, 0, 0, 0, 22, 21, 20, 23, 19, 16, 17, 18, 8, 9, 10, 11, \
412 0, 0, 0, 0, 0, 0, 0, 0, 68, 70, 71, 69, 34, 32, 33, 35)
413#define _trans_cube_LBr _mm256_set_epi8( \
414 0, 0, 0, 0, 19, 16, 17, 18, 23, 20, 21, 22, 27, 24, 25, 26, \
415 0, 0, 0, 0, 0, 0, 0, 0, 64, 67, 66, 65, 38, 37, 36, 39)
416#define _trans_cube_LBr_inverse _mm256_set_epi8( \
417 0, 0, 0, 0, 19, 16, 17, 18, 23, 20, 21, 22, 27, 24, 25, 26, \
418 0, 0, 0, 0, 0, 0, 0, 0, 64, 67, 66, 65, 38, 37, 36, 39)
419#define _trans_cube_FUr _mm256_set_epi8( \
420 0, 0, 0, 0, 6, 7, 4, 5, 10, 11, 8, 9, 17, 18, 19, 16, \
421 0, 0, 0, 0, 0, 0, 0, 0, 35, 33, 34, 32, 71, 69, 70, 68)
422#define _trans_cube_FUr_inverse _mm256_set_epi8( \
423 0, 0, 0, 0, 6, 7, 4, 5, 10, 11, 8, 9, 17, 18, 19, 16, \
424 0, 0, 0, 0, 0, 0, 0, 0, 35, 33, 34, 32, 71, 69, 70, 68)
425#define _trans_cube_FRr _mm256_set_epi8( \
426 0, 0, 0, 0, 21, 22, 23, 20, 17, 18, 19, 16, 11, 10, 9, 8, \
427 0, 0, 0, 0, 0, 0, 0, 0, 71, 69, 68, 70, 33, 35, 34, 32)
428#define _trans_cube_FRr_inverse _mm256_set_epi8( \
429 0, 0, 0, 0, 3, 2, 1, 0, 25, 26, 27, 24, 21, 22, 23, 20, \
430 0, 0, 0, 0, 0, 0, 0, 0, 39, 36, 38, 37, 66, 65, 67, 64)
431#define _trans_cube_FDr _mm256_set_epi8( \
432 0, 0, 0, 0, 4, 5, 6, 7, 11, 10, 9, 8, 18, 17, 16, 19, \
433 0, 0, 0, 0, 0, 0, 0, 0, 33, 35, 32, 34, 69, 71, 68, 70)
434#define _trans_cube_FDr_inverse _mm256_set_epi8( \
435 0, 0, 0, 0, 7, 6, 5, 4, 8, 9, 10, 11, 16, 19, 18, 17, \
436 0, 0, 0, 0, 0, 0, 0, 0, 34, 32, 35, 33, 70, 68, 71, 69)
437#define _trans_cube_FLr _mm256_set_epi8( \
438 0, 0, 0, 0, 23, 20, 21, 22, 18, 17, 16, 19, 10, 11, 8, 9, \
439 0, 0, 0, 0, 0, 0, 0, 0, 69, 71, 70, 68, 35, 33, 32, 34)
440#define _trans_cube_FLr_inverse _mm256_set_epi8( \
441 0, 0, 0, 0, 2, 3, 0, 1, 27, 24, 25, 26, 20, 23, 22, 21, \
442 0, 0, 0, 0, 0, 0, 0, 0, 38, 37, 39, 36, 67, 64, 66, 65)
443#define _trans_cube_BUr _mm256_set_epi8( \
444 0, 0, 0, 0, 7, 6, 5, 4, 8, 9, 10, 11, 16, 19, 18, 17, \
445 0, 0, 0, 0, 0, 0, 0, 0, 34, 32, 35, 33, 70, 68, 71, 69)
446#define _trans_cube_BUr_inverse _mm256_set_epi8( \
447 0, 0, 0, 0, 4, 5, 6, 7, 11, 10, 9, 8, 18, 17, 16, 19, \
448 0, 0, 0, 0, 0, 0, 0, 0, 33, 35, 32, 34, 69, 71, 68, 70)
449#define _trans_cube_BRr _mm256_set_epi8( \
450 0, 0, 0, 0, 22, 21, 20, 23, 19, 16, 17, 18, 8, 9, 10, 11, \
451 0, 0, 0, 0, 0, 0, 0, 0, 68, 70, 71, 69, 34, 32, 33, 35)
452#define _trans_cube_BRr_inverse _mm256_set_epi8( \
453 0, 0, 0, 0, 0, 1, 2, 3, 24, 27, 26, 25, 23, 20, 21, 22, \
454 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 36, 39, 64, 67, 65, 66)
455#define _trans_cube_BDr _mm256_set_epi8( \
456 0, 0, 0, 0, 5, 4, 7, 6, 9, 8, 11, 10, 19, 16, 17, 18, \
457 0, 0, 0, 0, 0, 0, 0, 0, 32, 34, 33, 35, 68, 70, 69, 71)
458#define _trans_cube_BDr_inverse _mm256_set_epi8( \
459 0, 0, 0, 0, 5, 4, 7, 6, 9, 8, 11, 10, 19, 16, 17, 18, \
460 0, 0, 0, 0, 0, 0, 0, 0, 32, 34, 33, 35, 68, 70, 69, 71)
461#define _trans_cube_BLr _mm256_set_epi8( \
462 0, 0, 0, 0, 20, 23, 22, 21, 16, 19, 18, 17, 9, 8, 11, 10, \
463 0, 0, 0, 0, 0, 0, 0, 0, 70, 68, 69, 71, 32, 34, 35, 33)
464#define _trans_cube_BLr_inverse _mm256_set_epi8( \
465 0, 0, 0, 0, 1, 0, 3, 2, 26, 25, 24, 27, 22, 21, 20, 23, \
466 0, 0, 0, 0, 0, 0, 0, 0, 36, 39, 37, 38, 65, 66, 64, 67)
467#define _trans_cube_UFm _mm256_set_epi8( \
468 0, 0, 0, 0, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0, \
469 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1, 0, 7, 6, 5, 4)
470#define _trans_cube_UFm_inverse _mm256_set_epi8( \
471 0, 0, 0, 0, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0, \
472 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1, 0, 7, 6, 5, 4)
473#define _trans_cube_ULm _mm256_set_epi8( \
474 0, 0, 0, 0, 25, 26, 27, 24, 3, 2, 1, 0, 7, 6, 5, 4, \
475 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 4, 5, 2, 3, 1, 0)
476#define _trans_cube_ULm_inverse _mm256_set_epi8( \
477 0, 0, 0, 0, 25, 26, 27, 24, 3, 2, 1, 0, 7, 6, 5, 4, \
478 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 4, 5, 2, 3, 1, 0)
479#define _trans_cube_UBm _mm256_set_epi8( \
480 0, 0, 0, 0, 8, 9, 10, 11, 7, 6, 5, 4, 2, 3, 0, 1, \
481 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 1, 6, 7, 4, 5)
482#define _trans_cube_UBm_inverse _mm256_set_epi8( \
483 0, 0, 0, 0, 8, 9, 10, 11, 7, 6, 5, 4, 2, 3, 0, 1, \
484 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 1, 6, 7, 4, 5)
485#define _trans_cube_URm _mm256_set_epi8( \
486 0, 0, 0, 0, 27, 24, 25, 26, 2, 3, 0, 1, 6, 7, 4, 5, \
487 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 5, 4, 3, 2, 0, 1)
488#define _trans_cube_URm_inverse _mm256_set_epi8( \
489 0, 0, 0, 0, 27, 24, 25, 26, 2, 3, 0, 1, 6, 7, 4, 5, \
490 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 5, 4, 3, 2, 0, 1)
491#define _trans_cube_DFm _mm256_set_epi8( \
492 0, 0, 0, 0, 11, 10, 9, 8, 4, 5, 6, 7, 0, 1, 2, 3, \
493 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 2, 5, 4, 7, 6)
494#define _trans_cube_DFm_inverse _mm256_set_epi8( \
495 0, 0, 0, 0, 11, 10, 9, 8, 4, 5, 6, 7, 0, 1, 2, 3, \
496 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 2, 5, 4, 7, 6)
497#define _trans_cube_DLm _mm256_set_epi8( \
498 0, 0, 0, 0, 26, 25, 24, 27, 1, 0, 3, 2, 4, 5, 6, 7, \
499 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 7, 6, 1, 0, 2, 3)
500#define _trans_cube_DLm_inverse _mm256_set_epi8( \
501 0, 0, 0, 0, 24, 27, 26, 25, 0, 1, 2, 3, 5, 4, 7, 6, \
502 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 6, 7, 0, 1, 3, 2)
503#define _trans_cube_DBm _mm256_set_epi8( \
504 0, 0, 0, 0, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2, \
505 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7)
506#define _trans_cube_DBm_inverse _mm256_set_epi8( \
507 0, 0, 0, 0, 9, 8, 11, 10, 5, 4, 7, 6, 1, 0, 3, 2, \
508 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7)
509#define _trans_cube_DRm _mm256_set_epi8( \
510 0, 0, 0, 0, 24, 27, 26, 25, 0, 1, 2, 3, 5, 4, 7, 6, \
511 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 6, 7, 0, 1, 3, 2)
512#define _trans_cube_DRm_inverse _mm256_set_epi8( \
513 0, 0, 0, 0, 26, 25, 24, 27, 1, 0, 3, 2, 4, 5, 6, 7, \
514 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 7, 6, 1, 0, 2, 3)
515#define _trans_cube_RUm _mm256_set_epi8( \
516 0, 0, 0, 0, 3, 2, 1, 0, 24, 27, 26, 25, 20, 23, 22, 21, \
517 0, 0, 0, 0, 0, 0, 0, 0, 35, 32, 34, 33, 70, 69, 71, 68)
518#define _trans_cube_RUm_inverse _mm256_set_epi8( \
519 0, 0, 0, 0, 22, 21, 20, 23, 18, 17, 16, 19, 11, 10, 9, 8, \
520 0, 0, 0, 0, 0, 0, 0, 0, 33, 35, 34, 32, 71, 69, 68, 70)
521#define _trans_cube_RFm _mm256_set_epi8( \
522 0, 0, 0, 0, 18, 17, 16, 19, 23, 20, 21, 22, 24, 27, 26, 25, \
523 0, 0, 0, 0, 0, 0, 0, 0, 69, 70, 71, 68, 35, 32, 33, 34)
524#define _trans_cube_RFm_inverse _mm256_set_epi8( \
525 0, 0, 0, 0, 18, 17, 16, 19, 23, 20, 21, 22, 24, 27, 26, 25, \
526 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 39, 36, 67, 64, 65, 66)
527#define _trans_cube_RDm _mm256_set_epi8( \
528 0, 0, 0, 0, 1, 0, 3, 2, 27, 24, 25, 26, 23, 20, 21, 22, \
529 0, 0, 0, 0, 0, 0, 0, 0, 32, 35, 33, 34, 69, 70, 68, 71)
530#define _trans_cube_RDm_inverse _mm256_set_epi8( \
531 0, 0, 0, 0, 23, 20, 21, 22, 19, 16, 17, 18, 9, 8, 11, 10, \
532 0, 0, 0, 0, 0, 0, 0, 0, 32, 34, 35, 33, 70, 68, 69, 71)
533#define _trans_cube_RBm _mm256_set_epi8( \
534 0, 0, 0, 0, 16, 19, 18, 17, 20, 23, 22, 21, 27, 24, 25, 26, \
535 0, 0, 0, 0, 0, 0, 0, 0, 70, 69, 68, 71, 32, 35, 34, 33)
536#define _trans_cube_RBm_inverse _mm256_set_epi8( \
537 0, 0, 0, 0, 19, 16, 17, 18, 22, 21, 20, 23, 26, 25, 24, 27, \
538 0, 0, 0, 0, 0, 0, 0, 0, 36, 39, 38, 37, 66, 65, 64, 67)
539#define _trans_cube_LUm _mm256_set_epi8( \
540 0, 0, 0, 0, 2, 3, 0, 1, 26, 25, 24, 27, 21, 22, 23, 20, \
541 0, 0, 0, 0, 0, 0, 0, 0, 34, 33, 35, 32, 71, 68, 70, 69)
542#define _trans_cube_LUm_inverse _mm256_set_epi8( \
543 0, 0, 0, 0, 20, 23, 22, 21, 17, 18, 19, 16, 10, 11, 8, 9, \
544 0, 0, 0, 0, 0, 0, 0, 0, 35, 33, 32, 34, 69, 71, 70, 68)
545#define _trans_cube_LFm _mm256_set_epi8( \
546 0, 0, 0, 0, 17, 18, 19, 16, 21, 22, 23, 20, 25, 26, 27, 24, \
547 0, 0, 0, 0, 0, 0, 0, 0, 71, 68, 69, 70, 33, 34, 35, 32)
548#define _trans_cube_LFm_inverse _mm256_set_epi8( \
549 0, 0, 0, 0, 17, 18, 19, 16, 21, 22, 23, 20, 25, 26, 27, 24, \
550 0, 0, 0, 0, 0, 0, 0, 0, 39, 36, 37, 38, 65, 66, 67, 64)
551#define _trans_cube_LDm _mm256_set_epi8( \
552 0, 0, 0, 0, 0, 1, 2, 3, 25, 26, 27, 24, 22, 21, 20, 23, \
553 0, 0, 0, 0, 0, 0, 0, 0, 33, 34, 32, 35, 68, 71, 69, 70)
554#define _trans_cube_LDm_inverse _mm256_set_epi8( \
555 0, 0, 0, 0, 21, 22, 23, 20, 16, 19, 18, 17, 8, 9, 10, 11, \
556 0, 0, 0, 0, 0, 0, 0, 0, 34, 32, 33, 35, 68, 70, 71, 69)
557#define _trans_cube_LBm _mm256_set_epi8( \
558 0, 0, 0, 0, 19, 16, 17, 18, 22, 21, 20, 23, 26, 25, 24, 27, \
559 0, 0, 0, 0, 0, 0, 0, 0, 68, 71, 70, 69, 34, 33, 32, 35)
560#define _trans_cube_LBm_inverse _mm256_set_epi8( \
561 0, 0, 0, 0, 16, 19, 18, 17, 20, 23, 22, 21, 27, 24, 25, 26, \
562 0, 0, 0, 0, 0, 0, 0, 0, 38, 37, 36, 39, 64, 67, 66, 65)
563#define _trans_cube_FUm _mm256_set_epi8( \
564 0, 0, 0, 0, 7, 6, 5, 4, 11, 10, 9, 8, 17, 18, 19, 16, \
565 0, 0, 0, 0, 0, 0, 0, 0, 39, 37, 38, 36, 67, 65, 66, 64)
566#define _trans_cube_FUm_inverse _mm256_set_epi8( \
567 0, 0, 0, 0, 7, 6, 5, 4, 11, 10, 9, 8, 17, 18, 19, 16, \
568 0, 0, 0, 0, 0, 0, 0, 0, 71, 69, 70, 68, 35, 33, 34, 32)
569#define _trans_cube_FRm _mm256_set_epi8( \
570 0, 0, 0, 0, 20, 23, 22, 21, 17, 18, 19, 16, 10, 11, 8, 9, \
571 0, 0, 0, 0, 0, 0, 0, 0, 67, 65, 64, 66, 37, 39, 38, 36)
572#define _trans_cube_FRm_inverse _mm256_set_epi8( \
573 0, 0, 0, 0, 2, 3, 0, 1, 26, 25, 24, 27, 21, 22, 23, 20, \
574 0, 0, 0, 0, 0, 0, 0, 0, 66, 65, 67, 64, 39, 36, 38, 37)
575#define _trans_cube_FDm _mm256_set_epi8( \
576 0, 0, 0, 0, 5, 4, 7, 6, 10, 11, 8, 9, 18, 17, 16, 19, \
577 0, 0, 0, 0, 0, 0, 0, 0, 37, 39, 36, 38, 65, 67, 64, 66)
578#define _trans_cube_FDm_inverse _mm256_set_epi8( \
579 0, 0, 0, 0, 6, 7, 4, 5, 9, 8, 11, 10, 16, 19, 18, 17, \
580 0, 0, 0, 0, 0, 0, 0, 0, 70, 68, 71, 69, 34, 32, 35, 33)
581#define _trans_cube_FLm _mm256_set_epi8( \
582 0, 0, 0, 0, 22, 21, 20, 23, 18, 17, 16, 19, 11, 10, 9, 8, \
583 0, 0, 0, 0, 0, 0, 0, 0, 65, 67, 66, 64, 39, 37, 36, 38)
584#define _trans_cube_FLm_inverse _mm256_set_epi8( \
585 0, 0, 0, 0, 3, 2, 1, 0, 24, 27, 26, 25, 20, 23, 22, 21, \
586 0, 0, 0, 0, 0, 0, 0, 0, 67, 64, 66, 65, 38, 37, 39, 36)
587#define _trans_cube_BUm _mm256_set_epi8( \
588 0, 0, 0, 0, 6, 7, 4, 5, 9, 8, 11, 10, 16, 19, 18, 17, \
589 0, 0, 0, 0, 0, 0, 0, 0, 38, 36, 39, 37, 66, 64, 67, 65)
590#define _trans_cube_BUm_inverse _mm256_set_epi8( \
591 0, 0, 0, 0, 5, 4, 7, 6, 10, 11, 8, 9, 18, 17, 16, 19, \
592 0, 0, 0, 0, 0, 0, 0, 0, 69, 71, 68, 70, 33, 35, 32, 34)
593#define _trans_cube_BRm _mm256_set_epi8( \
594 0, 0, 0, 0, 23, 20, 21, 22, 19, 16, 17, 18, 9, 8, 11, 10, \
595 0, 0, 0, 0, 0, 0, 0, 0, 64, 66, 67, 65, 38, 36, 37, 39)
596#define _trans_cube_BRm_inverse _mm256_set_epi8( \
597 0, 0, 0, 0, 1, 0, 3, 2, 27, 24, 25, 26, 23, 20, 21, 22, \
598 0, 0, 0, 0, 0, 0, 0, 0, 64, 67, 65, 66, 37, 38, 36, 39)
599#define _trans_cube_BDm _mm256_set_epi8( \
600 0, 0, 0, 0, 4, 5, 6, 7, 8, 9, 10, 11, 19, 16, 17, 18, \
601 0, 0, 0, 0, 0, 0, 0, 0, 36, 38, 37, 39, 64, 66, 65, 67)
602#define _trans_cube_BDm_inverse _mm256_set_epi8( \
603 0, 0, 0, 0, 4, 5, 6, 7, 8, 9, 10, 11, 19, 16, 17, 18, \
604 0, 0, 0, 0, 0, 0, 0, 0, 68, 70, 69, 71, 32, 34, 33, 35)
605#define _trans_cube_BLm _mm256_set_epi8( \
606 0, 0, 0, 0, 21, 22, 23, 20, 16, 19, 18, 17, 8, 9, 10, 11, \
607 0, 0, 0, 0, 0, 0, 0, 0, 66, 64, 65, 67, 36, 38, 39, 37)
608#define _trans_cube_BLm_inverse _mm256_set_epi8( \
609 0, 0, 0, 0, 0, 1, 2, 3, 25, 26, 27, 24, 22, 21, 20, 23, \
610 0, 0, 0, 0, 0, 0, 0, 0, 65, 66, 64, 67, 36, 39, 37, 38)
611 497
498_static inline cube_fast_t fastcube(
499 uint8_t, uint8_t, uint8_t, uint8_t, uint8_t,
500 uint8_t, uint8_t, uint8_t, uint8_t, uint8_t,
501 uint8_t, uint8_t, uint8_t, uint8_t, uint8_t,
502 uint8_t, uint8_t, uint8_t, uint8_t, uint8_t
503);
612_static cube_fast_t cubetofast(cube_t); 504_static cube_fast_t cubetofast(cube_t);
613_static cube_t fasttocube(cube_fast_t); 505_static cube_t fasttocube(cube_fast_t);
614_static_inline bool equal_fast(cube_fast_t, cube_fast_t); 506_static_inline bool equal_fast(cube_fast_t, cube_fast_t);
@@ -619,6 +511,39 @@ _static_inline cube_fast_t inverse_fast(cube_fast_t);
619_static_inline cube_fast_t compose_fast(cube_fast_t, cube_fast_t); 511_static_inline cube_fast_t compose_fast(cube_fast_t, cube_fast_t);
620_static_inline int64_t coord_fast_eo(cube_fast_t); 512_static_inline int64_t coord_fast_eo(cube_fast_t);
621 513
514_static inline cube_fast_t
515fastcube(
516 uint8_t c_ufr,
517 uint8_t c_ubl,
518 uint8_t c_dfl,
519 uint8_t c_dbr,
520 uint8_t c_ufl,
521 uint8_t c_ubr,
522 uint8_t c_dfr,
523 uint8_t c_dbl,
524
525 uint8_t e_uf,
526 uint8_t e_ub,
527 uint8_t e_db,
528 uint8_t e_df,
529 uint8_t e_ur,
530 uint8_t e_ul,
531 uint8_t e_dl,
532 uint8_t e_dr,
533 uint8_t e_fr,
534 uint8_t e_fl,
535 uint8_t e_bl,
536 uint8_t e_br
537)
538{
539 return _mm256_set_epi8(
540 0, 0, 0, 0, e_br, e_bl, e_fl, e_fr,
541 e_dr, e_dl, e_ul, e_ur, e_df, e_db, e_ub, e_uf,
542 0, 0, 0, 0, 0, 0, 0, 0,
543 c_dbl, c_dfr, c_ubr, c_ufl, c_dbr, c_dfl, c_ubl, c_ufr
544 );
545}
546
622_static cube_fast_t 547_static cube_fast_t
623cubetofast(cube_t a) 548cubetofast(cube_t a)
624{ 549{
@@ -780,356 +705,12 @@ in the previous section(s) for unsupported architectures.
780 705
781typedef cube_t cube_fast_t; 706typedef cube_t cube_fast_t;
782 707
783_static cube_fast_t zero_fast = { .corner = {0}, .edge = {0} }; 708_static cube_fast_t fastcube(
784_static cube_t solved_fast = { 709 uint8_t, uint8_t, uint8_t, uint8_t, uint8_t,
785 .corner = {0, 1, 2, 3, 4, 5, 6, 7}, 710 uint8_t, uint8_t, uint8_t, uint8_t, uint8_t,
786 .edge = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} 711 uint8_t, uint8_t, uint8_t, uint8_t, uint8_t,
787}; 712 uint8_t, uint8_t, uint8_t, uint8_t, uint8_t
788 713);
789_static cube_fast_t _move_cube_U = {
790 .corner = {5, 4, 2, 3, 0, 1, 6, 7},
791 .edge = {4, 5, 2, 3, 1, 0, 6, 7, 8, 9, 10, 11} };
792_static cube_fast_t _move_cube_U2 = {
793 .corner = {1, 0, 2, 3, 5, 4, 6, 7},
794 .edge = {1, 0, 2, 3, 5, 4, 6, 7, 8, 9, 10, 11} };
795_static cube_fast_t _move_cube_U3 = {
796 .corner = {4, 5, 2, 3, 1, 0, 6, 7},
797 .edge = {5, 4, 2, 3, 0, 1, 6, 7, 8, 9, 10, 11} };
798_static cube_fast_t _move_cube_D = {
799 .corner = {0, 1, 7, 6, 4, 5, 2, 3},
800 .edge = {0, 1, 7, 6, 4, 5, 2, 3, 8, 9, 10, 11} };
801_static cube_fast_t _move_cube_D2 = {
802 .corner = {0, 1, 3, 2, 4, 5, 7, 6},
803 .edge = {0, 1, 3, 2, 4, 5, 7, 6, 8, 9, 10, 11} };
804_static cube_fast_t _move_cube_D3 = {
805 .corner = {0, 1, 6, 7, 4, 5, 3, 2},
806 .edge = {0, 1, 6, 7, 4, 5, 3, 2, 8, 9, 10, 11} };
807_static cube_fast_t _move_cube_R = {
808 .corner = {70, 1, 2, 69, 4, 32, 35, 7},
809 .edge = {0, 1, 2, 3, 8, 5, 6, 11, 7, 9, 10, 4} };
810_static cube_fast_t _move_cube_R2 = {
811 .corner = {3, 1, 2, 0, 4, 6, 5, 7},
812 .edge = {0, 1, 2, 3, 7, 5, 6, 4, 11, 9, 10, 8} };
813_static cube_fast_t _move_cube_R3 = {
814 .corner = {69, 1, 2, 70, 4, 35, 32, 7},
815 .edge = {0, 1, 2, 3, 11, 5, 6, 8, 4, 9, 10, 7} };
816_static cube_fast_t _move_cube_L = {
817 .corner = {0, 71, 68, 3, 33, 5, 6, 34},
818 .edge = {0, 1, 2, 3, 4, 10, 9, 7, 8, 5, 6, 11} };
819_static cube_fast_t _move_cube_L2 = {
820 .corner = {0, 2, 1, 3, 7, 5, 6, 4},
821 .edge = {0, 1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 11} };
822_static cube_fast_t _move_cube_L3 = {
823 .corner = {0, 68, 71, 3, 34, 5, 6, 33},
824 .edge = {0, 1, 2, 3, 4, 9, 10, 7, 8, 6, 5, 11} };
825_static cube_fast_t _move_cube_F = {
826 .corner = {36, 1, 38, 3, 66, 5, 64, 7},
827 .edge = {25, 1, 2, 24, 4, 5, 6, 7, 16, 19, 10, 11} };
828_static cube_fast_t _move_cube_F2 = {
829 .corner = {2, 1, 0, 3, 6, 5, 4, 7},
830 .edge = {3, 1, 2, 0, 4, 5, 6, 7, 9, 8, 10, 11} };
831_static cube_fast_t _move_cube_F3 = {
832 .corner = {38, 1, 36, 3, 64, 5, 66, 7},
833 .edge = {24, 1, 2, 25, 4, 5, 6, 7, 19, 16, 10, 11} };
834_static cube_fast_t _move_cube_B = {
835 .corner = {0, 37, 2, 39, 4, 67, 6, 65},
836 .edge = {0, 27, 26, 3, 4, 5, 6, 7, 8, 9, 17, 18} };
837_static cube_fast_t _move_cube_B2 = {
838 .corner = {0, 3, 2, 1, 4, 7, 6, 5},
839 .edge = {0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 11, 10} };
840_static cube_fast_t _move_cube_B3 = {
841 .corner = {0, 39, 2, 37, 4, 65, 6, 67},
842 .edge = {0, 26, 27, 3, 4, 5, 6, 7, 8, 9, 18, 17} };
843
844_static cube_fast_t _trans_cube_UFr = {
845 .corner = {0, 1, 2, 3, 4, 5, 6, 7},
846 .edge = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} };
847_static cube_fast_t _trans_cube_UFr_inverse = {
848 .corner = {0, 1, 2, 3, 4, 5, 6, 7},
849 .edge = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} };
850_static cube_fast_t _trans_cube_ULr = {
851 .corner = {4, 5, 7, 6, 1, 0, 2, 3},
852 .edge = {5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24} };
853_static cube_fast_t _trans_cube_ULr_inverse = {
854 .corner = {5, 4, 6, 7, 0, 1, 3, 2},
855 .edge = {4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26} };
856_static cube_fast_t _trans_cube_UBr = {
857 .corner = {1, 0, 3, 2, 5, 4, 7, 6},
858 .edge = {1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9} };
859_static cube_fast_t _trans_cube_UBr_inverse = {
860 .corner = {1, 0, 3, 2, 5, 4, 7, 6},
861 .edge = {1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9} };
862_static cube_fast_t _trans_cube_URr = {
863 .corner = {5, 4, 6, 7, 0, 1, 3, 2},
864 .edge = {4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26} };
865_static cube_fast_t _trans_cube_URr_inverse = {
866 .corner = {4, 5, 7, 6, 1, 0, 2, 3},
867 .edge = {5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24} };
868_static cube_fast_t _trans_cube_DFr = {
869 .corner = {2, 3, 0, 1, 6, 7, 4, 5},
870 .edge = {3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10} };
871_static cube_fast_t _trans_cube_DFr_inverse = {
872 .corner = {2, 3, 0, 1, 6, 7, 4, 5},
873 .edge = {3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10} };
874_static cube_fast_t _trans_cube_DLr = {
875 .corner = {7, 6, 4, 5, 2, 3, 1, 0},
876 .edge = {6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27} };
877_static cube_fast_t _trans_cube_DLr_inverse = {
878 .corner = {7, 6, 4, 5, 2, 3, 1, 0},
879 .edge = {6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27} };
880_static cube_fast_t _trans_cube_DBr = {
881 .corner = {3, 2, 1, 0, 7, 6, 5, 4},
882 .edge = {2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8} };
883_static cube_fast_t _trans_cube_DBr_inverse = {
884 .corner = {3, 2, 1, 0, 7, 6, 5, 4},
885 .edge = {2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8} };
886_static cube_fast_t _trans_cube_DRr = {
887 .corner = {6, 7, 5, 4, 3, 2, 0, 1},
888 .edge = {7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25} };
889_static cube_fast_t _trans_cube_DRr_inverse = {
890 .corner = {6, 7, 5, 4, 3, 2, 0, 1},
891 .edge = {7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25} };
892_static cube_fast_t _trans_cube_RUr = {
893 .corner = {64, 67, 65, 66, 37, 38, 36, 39},
894 .edge = {20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3} };
895_static cube_fast_t _trans_cube_RUr_inverse = {
896 .corner = {32, 34, 35, 33, 70, 68, 69, 71},
897 .edge = {8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21} };
898_static cube_fast_t _trans_cube_RFr = {
899 .corner = {38, 37, 36, 39, 64, 67, 66, 65},
900 .edge = {24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18} };
901_static cube_fast_t _trans_cube_RFr_inverse = {
902 .corner = {36, 39, 38, 37, 66, 65, 64, 67},
903 .edge = {25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17} };
904_static cube_fast_t _trans_cube_RDr = {
905 .corner = {67, 64, 66, 65, 38, 37, 39, 36},
906 .edge = {23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1} };
907_static cube_fast_t _trans_cube_RDr_inverse = {
908 .corner = {33, 35, 34, 32, 71, 69, 68, 70},
909 .edge = {10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20} };
910_static cube_fast_t _trans_cube_RBr = {
911 .corner = {37, 38, 39, 36, 67, 64, 65, 66},
912 .edge = {27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16} };
913_static cube_fast_t _trans_cube_RBr_inverse = {
914 .corner = {37, 38, 39, 36, 67, 64, 65, 66},
915 .edge = {27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16} };
916_static cube_fast_t _trans_cube_LUr = {
917 .corner = {65, 66, 64, 67, 36, 39, 37, 38},
918 .edge = {21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2} };
919_static cube_fast_t _trans_cube_LUr_inverse = {
920 .corner = {34, 32, 33, 35, 68, 70, 71, 69},
921 .edge = {9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23} };
922_static cube_fast_t _trans_cube_LFr = {
923 .corner = {36, 39, 38, 37, 66, 65, 64, 67},
924 .edge = {25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17} };
925_static cube_fast_t _trans_cube_LFr_inverse = {
926 .corner = {38, 37, 36, 39, 64, 67, 66, 65},
927 .edge = {24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18} };
928_static cube_fast_t _trans_cube_LDr = {
929 .corner = {66, 65, 67, 64, 39, 36, 38, 37},
930 .edge = {22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0} };
931_static cube_fast_t _trans_cube_LDr_inverse = {
932 .corner = {35, 33, 32, 34, 69, 71, 70, 68},
933 .edge = {11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22} };
934_static cube_fast_t _trans_cube_LBr = {
935 .corner = {39, 36, 37, 38, 65, 66, 67, 64},
936 .edge = {26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19} };
937_static cube_fast_t _trans_cube_LBr_inverse = {
938 .corner = {39, 36, 37, 38, 65, 66, 67, 64},
939 .edge = {26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19} };
940_static cube_fast_t _trans_cube_FUr = {
941 .corner = {68, 70, 69, 71, 32, 34, 33, 35},
942 .edge = {16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6} };
943_static cube_fast_t _trans_cube_FUr_inverse = {
944 .corner = {68, 70, 69, 71, 32, 34, 33, 35},
945 .edge = {16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6} };
946_static cube_fast_t _trans_cube_FRr = {
947 .corner = {32, 34, 35, 33, 70, 68, 69, 71},
948 .edge = {8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21} };
949_static cube_fast_t _trans_cube_FRr_inverse = {
950 .corner = {64, 67, 65, 66, 37, 38, 36, 39},
951 .edge = {20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3} };
952_static cube_fast_t _trans_cube_FDr = {
953 .corner = {70, 68, 71, 69, 34, 32, 35, 33},
954 .edge = {19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4} };
955_static cube_fast_t _trans_cube_FDr_inverse = {
956 .corner = {69, 71, 68, 70, 33, 35, 32, 34},
957 .edge = {17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7} };
958_static cube_fast_t _trans_cube_FLr = {
959 .corner = {34, 32, 33, 35, 68, 70, 71, 69},
960 .edge = {9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23} };
961_static cube_fast_t _trans_cube_FLr_inverse = {
962 .corner = {65, 66, 64, 67, 36, 39, 37, 38},
963 .edge = {21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2} };
964_static cube_fast_t _trans_cube_BUr = {
965 .corner = {69, 71, 68, 70, 33, 35, 32, 34},
966 .edge = {17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7} };
967_static cube_fast_t _trans_cube_BUr_inverse = {
968 .corner = {70, 68, 71, 69, 34, 32, 35, 33},
969 .edge = {19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4} };
970_static cube_fast_t _trans_cube_BRr = {
971 .corner = {35, 33, 32, 34, 69, 71, 70, 68},
972 .edge = {11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22} };
973_static cube_fast_t _trans_cube_BRr_inverse = {
974 .corner = {66, 65, 67, 64, 39, 36, 38, 37},
975 .edge = {22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0} };
976_static cube_fast_t _trans_cube_BDr = {
977 .corner = {71, 69, 70, 68, 35, 33, 34, 32},
978 .edge = {18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5} };
979_static cube_fast_t _trans_cube_BDr_inverse = {
980 .corner = {71, 69, 70, 68, 35, 33, 34, 32},
981 .edge = {18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5} };
982_static cube_fast_t _trans_cube_BLr = {
983 .corner = {33, 35, 34, 32, 71, 69, 68, 70},
984 .edge = {10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20} };
985_static cube_fast_t _trans_cube_BLr_inverse = {
986 .corner = {67, 64, 66, 65, 38, 37, 39, 36},
987 .edge = {23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1} };
988_static cube_fast_t _trans_cube_UFm = {
989 .corner = {4, 5, 6, 7, 0, 1, 2, 3},
990 .edge = {0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10} };
991_static cube_fast_t _trans_cube_UFm_inverse = {
992 .corner = {4, 5, 6, 7, 0, 1, 2, 3},
993 .edge = {0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10} };
994_static cube_fast_t _trans_cube_ULm = {
995 .corner = {0, 1, 3, 2, 5, 4, 6, 7},
996 .edge = {4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25} };
997_static cube_fast_t _trans_cube_ULm_inverse = {
998 .corner = {0, 1, 3, 2, 5, 4, 6, 7},
999 .edge = {4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25} };
1000_static cube_fast_t _trans_cube_UBm = {
1001 .corner = {5, 4, 7, 6, 1, 0, 3, 2},
1002 .edge = {1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8} };
1003_static cube_fast_t _trans_cube_UBm_inverse = {
1004 .corner = {5, 4, 7, 6, 1, 0, 3, 2},
1005 .edge = {1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8} };
1006_static cube_fast_t _trans_cube_URm = {
1007 .corner = {1, 0, 2, 3, 4, 5, 7, 6},
1008 .edge = {5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27} };
1009_static cube_fast_t _trans_cube_URm_inverse = {
1010 .corner = {1, 0, 2, 3, 4, 5, 7, 6},
1011 .edge = {5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27} };
1012_static cube_fast_t _trans_cube_DFm = {
1013 .corner = {6, 7, 4, 5, 2, 3, 0, 1},
1014 .edge = {3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11} };
1015_static cube_fast_t _trans_cube_DFm_inverse = {
1016 .corner = {6, 7, 4, 5, 2, 3, 0, 1},
1017 .edge = {3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11} };
1018_static cube_fast_t _trans_cube_DLm = {
1019 .corner = {3, 2, 0, 1, 6, 7, 5, 4},
1020 .edge = {7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26} };
1021_static cube_fast_t _trans_cube_DLm_inverse = {
1022 .corner = {2, 3, 1, 0, 7, 6, 4, 5},
1023 .edge = {6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24} };
1024_static cube_fast_t _trans_cube_DBm = {
1025 .corner = {7, 6, 5, 4, 3, 2, 1, 0},
1026 .edge = {2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9} };
1027_static cube_fast_t _trans_cube_DBm_inverse = {
1028 .corner = {7, 6, 5, 4, 3, 2, 1, 0},
1029 .edge = {2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9} };
1030_static cube_fast_t _trans_cube_DRm = {
1031 .corner = {2, 3, 1, 0, 7, 6, 4, 5},
1032 .edge = {6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24} };
1033_static cube_fast_t _trans_cube_DRm_inverse = {
1034 .corner = {3, 2, 0, 1, 6, 7, 5, 4},
1035 .edge = {7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26} };
1036_static cube_fast_t _trans_cube_RUm = {
1037 .corner = {68, 71, 69, 70, 33, 34, 32, 35},
1038 .edge = {21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3} };
1039_static cube_fast_t _trans_cube_RUm_inverse = {
1040 .corner = {70, 68, 69, 71, 32, 34, 35, 33},
1041 .edge = {8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22} };
1042_static cube_fast_t _trans_cube_RFm = {
1043 .corner = {34, 33, 32, 35, 68, 71, 70, 69},
1044 .edge = {25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18} };
1045_static cube_fast_t _trans_cube_RFm_inverse = {
1046 .corner = {66, 65, 64, 67, 36, 39, 38, 37},
1047 .edge = {25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18} };
1048_static cube_fast_t _trans_cube_RDm = {
1049 .corner = {71, 68, 70, 69, 34, 33, 35, 32},
1050 .edge = {22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1} };
1051_static cube_fast_t _trans_cube_RDm_inverse = {
1052 .corner = {71, 69, 68, 70, 33, 35, 34, 32},
1053 .edge = {10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23} };
1054_static cube_fast_t _trans_cube_RBm = {
1055 .corner = {33, 34, 35, 32, 71, 68, 69, 70},
1056 .edge = {26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16} };
1057_static cube_fast_t _trans_cube_RBm_inverse = {
1058 .corner = {67, 64, 65, 66, 37, 38, 39, 36},
1059 .edge = {27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19} };
1060_static cube_fast_t _trans_cube_LUm = {
1061 .corner = {69, 70, 68, 71, 32, 35, 33, 34},
1062 .edge = {20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2} };
1063_static cube_fast_t _trans_cube_LUm_inverse = {
1064 .corner = {68, 70, 71, 69, 34, 32, 33, 35},
1065 .edge = {9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20} };
1066_static cube_fast_t _trans_cube_LFm = {
1067 .corner = {32, 35, 34, 33, 70, 69, 68, 71},
1068 .edge = {24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17} };
1069_static cube_fast_t _trans_cube_LFm_inverse = {
1070 .corner = {64, 67, 66, 65, 38, 37, 36, 39},
1071 .edge = {24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17} };
1072_static cube_fast_t _trans_cube_LDm = {
1073 .corner = {70, 69, 71, 68, 35, 32, 34, 33},
1074 .edge = {23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0} };
1075_static cube_fast_t _trans_cube_LDm_inverse = {
1076 .corner = {69, 71, 70, 68, 35, 33, 32, 34},
1077 .edge = {11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21} };
1078_static cube_fast_t _trans_cube_LBm = {
1079 .corner = {35, 32, 33, 34, 69, 70, 71, 68},
1080 .edge = {27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19} };
1081_static cube_fast_t _trans_cube_LBm_inverse = {
1082 .corner = {65, 66, 67, 64, 39, 36, 37, 38},
1083 .edge = {26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16} };
1084_static cube_fast_t _trans_cube_FUm = {
1085 .corner = {64, 66, 65, 67, 36, 38, 37, 39},
1086 .edge = {16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7} };
1087_static cube_fast_t _trans_cube_FUm_inverse = {
1088 .corner = {32, 34, 33, 35, 68, 70, 69, 71},
1089 .edge = {16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7} };
1090_static cube_fast_t _trans_cube_FRm = {
1091 .corner = {36, 38, 39, 37, 66, 64, 65, 67},
1092 .edge = {9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20} };
1093_static cube_fast_t _trans_cube_FRm_inverse = {
1094 .corner = {37, 38, 36, 39, 64, 67, 65, 66},
1095 .edge = {20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2} };
1096_static cube_fast_t _trans_cube_FDm = {
1097 .corner = {66, 64, 67, 65, 38, 36, 39, 37},
1098 .edge = {19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5} };
1099_static cube_fast_t _trans_cube_FDm_inverse = {
1100 .corner = {33, 35, 32, 34, 69, 71, 68, 70},
1101 .edge = {17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6} };
1102_static cube_fast_t _trans_cube_FLm = {
1103 .corner = {38, 36, 37, 39, 64, 66, 67, 65},
1104 .edge = {8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22} };
1105_static cube_fast_t _trans_cube_FLm_inverse = {
1106 .corner = {36, 39, 37, 38, 65, 66, 64, 67},
1107 .edge = {21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3} };
1108_static cube_fast_t _trans_cube_BUm = {
1109 .corner = {65, 67, 64, 66, 37, 39, 36, 38},
1110 .edge = {17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6} };
1111_static cube_fast_t _trans_cube_BUm_inverse = {
1112 .corner = {34, 32, 35, 33, 70, 68, 71, 69},
1113 .edge = {19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5} };
1114_static cube_fast_t _trans_cube_BRm = {
1115 .corner = {39, 37, 36, 38, 65, 67, 66, 64},
1116 .edge = {10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23} };
1117_static cube_fast_t _trans_cube_BRm_inverse = {
1118 .corner = {39, 36, 38, 37, 66, 65, 67, 64},
1119 .edge = {22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1} };
1120_static cube_fast_t _trans_cube_BDm = {
1121 .corner = {67, 65, 66, 64, 39, 37, 38, 36},
1122 .edge = {18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4} };
1123_static cube_fast_t _trans_cube_BDm_inverse = {
1124 .corner = {35, 33, 34, 32, 71, 69, 70, 68},
1125 .edge = {18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4} };
1126_static cube_fast_t _trans_cube_BLm = {
1127 .corner = {37, 39, 38, 36, 67, 65, 64, 66},
1128 .edge = {11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21} };
1129_static cube_fast_t _trans_cube_BLm_inverse = {
1130 .corner = {38, 37, 39, 36, 67, 64, 66, 65},
1131 .edge = {23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0} };
1132
1133_static cube_fast_t cubetofast(cube_t); 714_static cube_fast_t cubetofast(cube_t);
1134_static cube_t fasttocube(cube_fast_t); 715_static cube_t fasttocube(cube_fast_t);
1135_static_inline bool equal_fast(cube_fast_t, cube_fast_t); 716_static_inline bool equal_fast(cube_fast_t, cube_fast_t);
@@ -1139,6 +720,44 @@ _static_inline cube_fast_t inverse_fast(cube_fast_t);
1139_static_inline cube_fast_t compose_fast(cube_fast_t, cube_fast_t); 720_static_inline cube_fast_t compose_fast(cube_fast_t, cube_fast_t);
1140_static_inline int64_t coord_fast_eo(cube_fast_t); 721_static_inline int64_t coord_fast_eo(cube_fast_t);
1141 722
723_static inline cube_fast_t
724fastcube(
725 uint8_t c_ufr,
726 uint8_t c_ubl,
727 uint8_t c_dfl,
728 uint8_t c_dbr,
729 uint8_t c_ufl,
730 uint8_t c_ubr,
731 uint8_t c_dfr,
732 uint8_t c_dbl,
733
734 uint8_t e_uf,
735 uint8_t e_ub,
736 uint8_t e_db,
737 uint8_t e_df,
738 uint8_t e_ur,
739 uint8_t e_ul,
740 uint8_t e_dl,
741 uint8_t e_dr,
742 uint8_t e_fr,
743 uint8_t e_fl,
744 uint8_t e_bl,
745 uint8_t e_br
746)
747{
748 cube_fast_t cube = {
749 .corner = {
750 c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl
751 },
752 .edge = {
753 e_uf, e_ub, e_db, e_df, e_ur, e_ul,
754 e_dl, e_dr, e_fr, e_fl, e_bl, e_br
755 }
756 };
757
758 return cube;
759}
760
1142_static cube_fast_t 761_static cube_fast_t
1143cubetofast(cube_t cube) 762cubetofast(cube_t cube)
1144{ 763{
@@ -1302,9 +921,9 @@ _static uint8_t readeo(char *);
1302_static uint8_t readep(char *); 921_static uint8_t readep(char *);
1303_static cube_t readcube_H48(char *); 922_static cube_t readcube_H48(char *);
1304_static int writepiece_SRC(uint8_t, char *); 923_static int writepiece_SRC(uint8_t, char *);
1305_static void writecube_AVX(cube_t, char *);
1306_static void writecube_H48(cube_t, char *); 924_static void writecube_H48(cube_t, char *);
1307_static void writecube_SRC(cube_t, char *); 925_static void writecube_SRC(cube_t, char *);
926_static void writecube_LST(cube_t, char *);
1308_static uint8_t readmove(char); 927_static uint8_t readmove(char);
1309_static uint8_t readmodifier(char); 928_static uint8_t readmodifier(char);
1310_static uint8_t readtrans(char *); 929_static uint8_t readtrans(char *);
@@ -1541,8 +1160,8 @@ writecube(char *format, cube_t cube, char *buf)
1541 writecube_H48(cube, buf); 1160 writecube_H48(cube, buf);
1542 } else if (!strcmp(format, "SRC")) { 1161 } else if (!strcmp(format, "SRC")) {
1543 writecube_SRC(cube, buf); 1162 writecube_SRC(cube, buf);
1544 } else if (!strcmp(format, "AVX")) { 1163 } else if (!strcmp(format, "LST")) {
1545 writecube_AVX(cube, buf); 1164 writecube_LST(cube, buf);
1546 } else { 1165 } else {
1547 errormsg = "ERROR: cannot write cube in the given format"; 1166 errormsg = "ERROR: cannot write cube in the given format";
1548 goto writecube_error; 1167 goto writecube_error;
@@ -1684,31 +1303,6 @@ writepiece_SRC(uint8_t piece, char *buf)
1684} 1303}
1685 1304
1686_static void 1305_static void
1687writecube_AVX(cube_t cube, char *buf)
1688{
1689 int i, ptr;
1690 uint8_t piece;
1691
1692 memcpy(buf, "_mm256_set_epi8(\n\t0, 0, 0, 0, ", 30);
1693 ptr = 30;
1694
1695 for (i = 11; i >= 0; i--) {
1696 piece = cube.edge[i];
1697 ptr += writepiece_SRC(piece, buf + ptr);
1698 }
1699
1700 memcpy(buf+ptr-2, ",\n\t0, 0, 0, 0, 0, 0, 0, 0, ", 27);
1701 ptr += 25;
1702
1703 for (i = 7; i >= 0; i--) {
1704 piece = cube.corner[i];
1705 ptr += writepiece_SRC(piece, buf + ptr);
1706 }
1707
1708 memcpy(buf+ptr-2, "\n)\0", 3);
1709}
1710
1711_static void
1712writecube_H48(cube_t cube, char *buf) 1306writecube_H48(cube_t cube, char *buf)
1713{ 1307{
1714 uint8_t piece, perm, orient; 1308 uint8_t piece, perm, orient;
@@ -1762,6 +1356,27 @@ writecube_SRC(cube_t cube, char *buf)
1762 memcpy(buf+ptr-2, "}\n}\0", 4); 1356 memcpy(buf+ptr-2, "}\n}\0", 4);
1763} 1357}
1764 1358
1359_static void
1360writecube_LST(cube_t cube, char *buf)
1361{
1362 int i, ptr;
1363 uint8_t piece;
1364
1365 ptr = 0;
1366
1367 for (i = 0; i < 8; i++) {
1368 piece = cube.corner[i];
1369 ptr += writepiece_SRC(piece, buf + ptr);
1370 }
1371
1372 for (i = 0; i < 12; i++) {
1373 piece = cube.edge[i];
1374 ptr += writepiece_SRC(piece, buf + ptr);
1375 }
1376
1377 *(buf+ptr-2) = 0;
1378}
1379
1765_static uint8_t 1380_static uint8_t
1766readmove(char c) 1381readmove(char c)
1767{ 1382{

Generated with cgit - Back to sebastiano.tronto.net