aboutsummaryrefslogtreecommitdiff
path: root/src/arch/neon.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/neon.h')
-rw-r--r--src/arch/neon.h57
1 files changed, 38 insertions, 19 deletions
diff --git a/src/arch/neon.h b/src/arch/neon.h
index acb75c3..9061422 100644
--- a/src/arch/neon.h
+++ b/src/arch/neon.h
@@ -7,25 +7,6 @@
7STATIC_INLINE uint8x16_t compose_edges_slim(uint8x16_t, uint8x16_t); 7STATIC_INLINE uint8x16_t compose_edges_slim(uint8x16_t, uint8x16_t);
8STATIC_INLINE uint8x16_t compose_corners_slim(uint8x16_t, uint8x16_t); 8STATIC_INLINE uint8x16_t compose_corners_slim(uint8x16_t, uint8x16_t);
9 9
10// static cube
11#define STATIC_CUBE(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \
12 e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \
13 ((cube_t){ \
14 .corner = {c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, 0, 0, 0, 0, 0, 0, 0, 0}, \
15 .edge = {e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br, 0, 0, 0, 0}})
16
17// zero cube
18#define ZERO_CUBE \
19 (cube_t) \
20 { \
21 .corner = vdupq_n_u8(0), \
22 .edge = vdupq_n_u8(0) \
23 }
24
25// solved cube
26#define SOLVED_CUBE STATIC_CUBE( \
27 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
28
29STATIC void 10STATIC void
30pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12]) 11pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
31{ 12{
@@ -39,6 +20,44 @@ pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
39 vst1_lane_u32((uint32_t *)(e + 8), vreinterpret_u32_u8(vget_high_u8(cube->edge)), 0); 20 vst1_lane_u32((uint32_t *)(e + 8), vreinterpret_u32_u8(vget_high_u8(cube->edge)), 0);
40} 21}
41 22
23STATIC_INLINE cube_t
24cubefrompieces(
25 uint8_t c_ufr,
26 uint8_t c_ubl,
27 uint8_t c_dfl,
28 uint8_t c_dbr,
29 uint8_t c_ufl,
30 uint8_t c_ubr,
31 uint8_t c_dfr,
32 uint8_t c_dbl,
33
34 uint8_t e_uf,
35 uint8_t e_ub,
36 uint8_t e_db,
37 uint8_t e_df,
38 uint8_t e_ur,
39 uint8_t e_ul,
40 uint8_t e_dl,
41 uint8_t e_dr,
42 uint8_t e_fr,
43 uint8_t e_fl,
44 uint8_t e_bl,
45 uint8_t e_br
46) {
47 cube_t ret = {
48 .corner = {
49 c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl,
50 0, 0, 0, 0, 0, 0, 0, 0
51 },
52 .edge = {
53 e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr,
54 e_fl, e_bl, e_br, 0, 0, 0, 0
55 }
56 };
57
58 return ret;
59}
60
42STATIC_INLINE bool 61STATIC_INLINE bool
43equal(cube_t c1, cube_t c2) 62equal(cube_t c1, cube_t c2)
44{ 63{

Generated with cgit - Back to sebastiano.tronto.net