commit 80b065f757240af7920862b3e09f32a6dc06d392
parent fd111a1a51b8293f79db6284331af50824df92b9
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Fri, 4 Oct 2024 12:01:41 +0200
Table-based transformations (will revert immediately)
This commit changes transformations to being based on a lookup
table intead of a big switch. This is something I had planned for a long
time and the code is nicer with this change. But unfortunately the performance
is noticeably worse, so I'll revert all these changes in the next commit.
I wanted to push this anyway so we can keep track of this.
Diffstat:
10 files changed, 467 insertions(+), 383 deletions(-)
diff --git a/src/arch/avx2.h b/src/arch/avx2.h
@@ -6,16 +6,6 @@
#define EO_AVX2 \
_mm256_set_epi64x(INT64_C(0x10101010), INT64_C(0x1010101010101010), 0, 0)
-#define STATIC_CUBE(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \
- e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \
- _mm256_set_epi8(0, 0, 0, 0, e_br, e_bl, e_fl, e_fr, \
- e_dr, e_dl, e_ul, e_ur, e_df, e_db, e_ub, e_uf, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- c_dbl, c_dfr, c_ubr, c_ufl, c_dbr, c_dfl, c_ubl, c_ufr)
-#define ZERO_CUBE _mm256_set_epi64x(0, 0, 0, 0)
-#define SOLVED_CUBE STATIC_CUBE( \
- 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
STATIC void
pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
{
@@ -26,6 +16,38 @@ pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
memcpy(e, aux+16, 12);
}
+STATIC_INLINE cube_t
+cubefrompieces(
+ uint8_t c_ufr,
+ uint8_t c_ubl,
+ uint8_t c_dfl,
+ uint8_t c_dbr,
+ uint8_t c_ufl,
+ uint8_t c_ubr,
+ uint8_t c_dfr,
+ uint8_t c_dbl,
+
+ uint8_t e_uf,
+ uint8_t e_ub,
+ uint8_t e_db,
+ uint8_t e_df,
+ uint8_t e_ur,
+ uint8_t e_ul,
+ uint8_t e_dl,
+ uint8_t e_dr,
+ uint8_t e_fr,
+ uint8_t e_fl,
+ uint8_t e_bl,
+ uint8_t e_br
+) {
+ return _mm256_set_epi8(
+ 0, 0, 0, 0, e_br, e_bl, e_fl, e_fr,
+ e_dr, e_dl, e_ul, e_ur, e_df, e_db, e_ub, e_uf,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ c_dbl, c_dfr, c_ubr, c_ufl, c_dbr, c_dfl, c_ubl, c_ufr
+ );
+}
+
STATIC_INLINE bool
equal(cube_t c1, cube_t c2)
{
diff --git a/src/arch/common.h b/src/arch/common.h
@@ -1,4 +1,11 @@
+#define ZERO_CUBE cubefrompieces( \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+#define SOLVED_CUBE cubefrompieces( \
+ 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
STATIC void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]);
+STATIC_INLINE cube_t cubefrompieces(uint8_t, uint8_t, uint8_t, uint8_t,
+ uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t,
+ uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t);
STATIC_INLINE bool equal(cube_t, cube_t);
STATIC_INLINE cube_t invertco(cube_t);
STATIC_INLINE cube_t compose_epcpeo(cube_t, cube_t);
diff --git a/src/arch/neon.h b/src/arch/neon.h
@@ -7,25 +7,6 @@
STATIC_INLINE uint8x16_t compose_edges_slim(uint8x16_t, uint8x16_t);
STATIC_INLINE uint8x16_t compose_corners_slim(uint8x16_t, uint8x16_t);
-// static cube
-#define STATIC_CUBE(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \
- e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \
- ((cube_t){ \
- .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}, \
- .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}})
-
-// zero cube
-#define ZERO_CUBE \
- (cube_t) \
- { \
- .corner = vdupq_n_u8(0), \
- .edge = vdupq_n_u8(0) \
- }
-
-// solved cube
-#define SOLVED_CUBE STATIC_CUBE( \
- 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
STATIC void
pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
{
@@ -39,6 +20,44 @@ pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
vst1_lane_u32((uint32_t *)(e + 8), vreinterpret_u32_u8(vget_high_u8(cube->edge)), 0);
}
+STATIC_INLINE cube_t
+cubefrompieces(
+ uint8_t c_ufr,
+ uint8_t c_ubl,
+ uint8_t c_dfl,
+ uint8_t c_dbr,
+ uint8_t c_ufl,
+ uint8_t c_ubr,
+ uint8_t c_dfr,
+ uint8_t c_dbl,
+
+ uint8_t e_uf,
+ uint8_t e_ub,
+ uint8_t e_db,
+ uint8_t e_df,
+ uint8_t e_ur,
+ uint8_t e_ul,
+ uint8_t e_dl,
+ uint8_t e_dr,
+ uint8_t e_fr,
+ uint8_t e_fl,
+ uint8_t e_bl,
+ uint8_t e_br
+) {
+ cube_t ret = {
+ .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
+ },
+ .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
+ }
+ };
+
+ return ret;
+}
+
STATIC_INLINE bool
equal(cube_t c1, cube_t c2)
{
diff --git a/src/arch/portable.h b/src/arch/portable.h
@@ -1,14 +1,3 @@
-#define STATIC_CUBE(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \
- e_uf, e_ub, e_db, e_df, e_ur, e_ul, e_dl, e_dr, e_fr, e_fl, e_bl, e_br) \
- ((cube_t) { \
- .corner = { c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl }, \
- .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 } })
-#define ZERO_CUBE STATIC_CUBE( \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
-#define SOLVED_CUBE STATIC_CUBE( \
- 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
STATIC void
pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
{
@@ -16,6 +5,44 @@ pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
memcpy(e, cube->edge, 12);
}
+STATIC_INLINE cube_t
+cubefrompieces(
+ uint8_t c_ufr,
+ uint8_t c_ubl,
+ uint8_t c_dfl,
+ uint8_t c_dbr,
+ uint8_t c_ufl,
+ uint8_t c_ubr,
+ uint8_t c_dfr,
+ uint8_t c_dbl,
+
+ uint8_t e_uf,
+ uint8_t e_ub,
+ uint8_t e_db,
+ uint8_t e_df,
+ uint8_t e_ur,
+ uint8_t e_ul,
+ uint8_t e_dl,
+ uint8_t e_dr,
+ uint8_t e_fr,
+ uint8_t e_fl,
+ uint8_t e_bl,
+ uint8_t e_br
+) {
+ cube_t ret = {
+ .corner = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ c_dbl, c_dfr, c_ubr, c_ufl, c_dbr, c_dfl, c_ubl, c_ufr
+ },
+ .edge = {
+ 0, 0, 0, 0, e_br, e_bl, e_fl, e_fr,
+ e_dr, e_dl, e_ul, e_ur, e_df, e_db, e_ub, e_uf
+ }
+ };
+
+ return ret;
+}
+
STATIC_INLINE bool
equal(cube_t c1, cube_t c2)
{
diff --git a/src/core/constant_cubes.h b/src/core/constant_cubes.h
@@ -1,229 +1,229 @@
-#define MOVE_CUBE_U STATIC_CUBE( \
- 5, 4, 2, 3, 0, 1, 6, 7, 4, 5, 2, 3, 1, 0, 6, 7, 8, 9, 10, 11)
-#define MOVE_CUBE_U2 STATIC_CUBE( \
- 1, 0, 2, 3, 5, 4, 6, 7, 1, 0, 2, 3, 5, 4, 6, 7, 8, 9, 10, 11)
-#define MOVE_CUBE_U3 STATIC_CUBE( \
- 4, 5, 2, 3, 1, 0, 6, 7, 5, 4, 2, 3, 0, 1, 6, 7, 8, 9, 10, 11)
-#define MOVE_CUBE_D STATIC_CUBE( \
- 0, 1, 7, 6, 4, 5, 2, 3, 0, 1, 7, 6, 4, 5, 2, 3, 8, 9, 10, 11)
-#define MOVE_CUBE_D2 STATIC_CUBE( \
- 0, 1, 3, 2, 4, 5, 7, 6, 0, 1, 3, 2, 4, 5, 7, 6, 8, 9, 10, 11)
-#define MOVE_CUBE_D3 STATIC_CUBE( \
- 0, 1, 6, 7, 4, 5, 3, 2, 0, 1, 6, 7, 4, 5, 3, 2, 8, 9, 10, 11)
-#define MOVE_CUBE_R STATIC_CUBE( \
- 70, 1, 2, 69, 4, 32, 35, 7, 0, 1, 2, 3, 8, 5, 6, 11, 7, 9, 10, 4)
-#define MOVE_CUBE_R2 STATIC_CUBE( \
- 3, 1, 2, 0, 4, 6, 5, 7, 0, 1, 2, 3, 7, 5, 6, 4, 11, 9, 10, 8)
-#define MOVE_CUBE_R3 STATIC_CUBE( \
- 69, 1, 2, 70, 4, 35, 32, 7, 0, 1, 2, 3, 11, 5, 6, 8, 4, 9, 10, 7)
-#define MOVE_CUBE_L STATIC_CUBE( \
- 0, 71, 68, 3, 33, 5, 6, 34, 0, 1, 2, 3, 4, 10, 9, 7, 8, 5, 6, 11)
-#define MOVE_CUBE_L2 STATIC_CUBE( \
- 0, 2, 1, 3, 7, 5, 6, 4, 0, 1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 11)
-#define MOVE_CUBE_L3 STATIC_CUBE( \
- 0, 68, 71, 3, 34, 5, 6, 33, 0, 1, 2, 3, 4, 9, 10, 7, 8, 6, 5, 11)
-#define MOVE_CUBE_F STATIC_CUBE( \
- 36, 1, 38, 3, 66, 5, 64, 7, 25, 1, 2, 24, 4, 5, 6, 7, 16, 19, 10, 11)
-#define MOVE_CUBE_F2 STATIC_CUBE( \
- 2, 1, 0, 3, 6, 5, 4, 7, 3, 1, 2, 0, 4, 5, 6, 7, 9, 8, 10, 11)
-#define MOVE_CUBE_F3 STATIC_CUBE( \
- 38, 1, 36, 3, 64, 5, 66, 7, 24, 1, 2, 25, 4, 5, 6, 7, 19, 16, 10, 11)
-#define MOVE_CUBE_B STATIC_CUBE( \
- 0, 37, 2, 39, 4, 67, 6, 65, 0, 27, 26, 3, 4, 5, 6, 7, 8, 9, 17, 18)
-#define MOVE_CUBE_B2 STATIC_CUBE( \
- 0, 3, 2, 1, 4, 7, 6, 5, 0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 11, 10)
-#define MOVE_CUBE_B3 STATIC_CUBE( \
- 0, 39, 2, 37, 4, 65, 6, 67, 0, 26, 27, 3, 4, 5, 6, 7, 8, 9, 18, 17)
+#define MOVE_CUBE_U \
+ 5, 4, 2, 3, 0, 1, 6, 7, 4, 5, 2, 3, 1, 0, 6, 7, 8, 9, 10, 11
+#define MOVE_CUBE_U2 \
+ 1, 0, 2, 3, 5, 4, 6, 7, 1, 0, 2, 3, 5, 4, 6, 7, 8, 9, 10, 11
+#define MOVE_CUBE_U3 \
+ 4, 5, 2, 3, 1, 0, 6, 7, 5, 4, 2, 3, 0, 1, 6, 7, 8, 9, 10, 11
+#define MOVE_CUBE_D \
+ 0, 1, 7, 6, 4, 5, 2, 3, 0, 1, 7, 6, 4, 5, 2, 3, 8, 9, 10, 11
+#define MOVE_CUBE_D2 \
+ 0, 1, 3, 2, 4, 5, 7, 6, 0, 1, 3, 2, 4, 5, 7, 6, 8, 9, 10, 11
+#define MOVE_CUBE_D3 \
+ 0, 1, 6, 7, 4, 5, 3, 2, 0, 1, 6, 7, 4, 5, 3, 2, 8, 9, 10, 11
+#define MOVE_CUBE_R \
+ 70, 1, 2, 69, 4, 32, 35, 7, 0, 1, 2, 3, 8, 5, 6, 11, 7, 9, 10, 4
+#define MOVE_CUBE_R2 \
+ 3, 1, 2, 0, 4, 6, 5, 7, 0, 1, 2, 3, 7, 5, 6, 4, 11, 9, 10, 8
+#define MOVE_CUBE_R3 \
+ 69, 1, 2, 70, 4, 35, 32, 7, 0, 1, 2, 3, 11, 5, 6, 8, 4, 9, 10, 7
+#define MOVE_CUBE_L \
+ 0, 71, 68, 3, 33, 5, 6, 34, 0, 1, 2, 3, 4, 10, 9, 7, 8, 5, 6, 11
+#define MOVE_CUBE_L2 \
+ 0, 2, 1, 3, 7, 5, 6, 4, 0, 1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 11
+#define MOVE_CUBE_L3 \
+ 0, 68, 71, 3, 34, 5, 6, 33, 0, 1, 2, 3, 4, 9, 10, 7, 8, 6, 5, 11
+#define MOVE_CUBE_F \
+ 36, 1, 38, 3, 66, 5, 64, 7, 25, 1, 2, 24, 4, 5, 6, 7, 16, 19, 10, 11
+#define MOVE_CUBE_F2 \
+ 2, 1, 0, 3, 6, 5, 4, 7, 3, 1, 2, 0, 4, 5, 6, 7, 9, 8, 10, 11
+#define MOVE_CUBE_F3 \
+ 38, 1, 36, 3, 64, 5, 66, 7, 24, 1, 2, 25, 4, 5, 6, 7, 19, 16, 10, 11
+#define MOVE_CUBE_B \
+ 0, 37, 2, 39, 4, 67, 6, 65, 0, 27, 26, 3, 4, 5, 6, 7, 8, 9, 17, 18
+#define MOVE_CUBE_B2 \
+ 0, 3, 2, 1, 4, 7, 6, 5, 0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 11, 10
+#define MOVE_CUBE_B3 \
+ 0, 39, 2, 37, 4, 65, 6, 67, 0, 26, 27, 3, 4, 5, 6, 7, 8, 9, 18, 17
-#define TRANS_CUBE_UFr STATIC_CUBE( \
- 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-#define TRANS_CUBE_UFr_INVERSE STATIC_CUBE( \
- 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-#define TRANS_CUBE_ULr STATIC_CUBE( \
- 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24)
-#define TRANS_CUBE_ULr_INVERSE STATIC_CUBE( \
- 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26)
-#define TRANS_CUBE_UBr STATIC_CUBE( \
- 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9)
-#define TRANS_CUBE_UBr_INVERSE STATIC_CUBE( \
- 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9)
-#define TRANS_CUBE_URr STATIC_CUBE( \
- 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26)
-#define TRANS_CUBE_URr_INVERSE STATIC_CUBE( \
- 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24)
-#define TRANS_CUBE_DFr STATIC_CUBE( \
- 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10)
-#define TRANS_CUBE_DFr_INVERSE STATIC_CUBE( \
- 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10)
-#define TRANS_CUBE_DLr STATIC_CUBE( \
- 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27)
-#define TRANS_CUBE_DLr_INVERSE STATIC_CUBE( \
- 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27)
-#define TRANS_CUBE_DBr STATIC_CUBE( \
- 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8)
-#define TRANS_CUBE_DBr_INVERSE STATIC_CUBE( \
- 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8)
-#define TRANS_CUBE_DRr STATIC_CUBE( \
- 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25)
-#define TRANS_CUBE_DRr_INVERSE STATIC_CUBE( \
- 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25)
-#define TRANS_CUBE_RUr STATIC_CUBE( \
- 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3)
-#define TRANS_CUBE_RUr_INVERSE STATIC_CUBE( \
- 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21)
-#define TRANS_CUBE_RFr STATIC_CUBE( \
- 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18)
-#define TRANS_CUBE_RFr_INVERSE STATIC_CUBE( \
- 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17)
-#define TRANS_CUBE_RDr STATIC_CUBE( \
- 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1)
-#define TRANS_CUBE_RDr_INVERSE STATIC_CUBE( \
- 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20)
-#define TRANS_CUBE_RBr STATIC_CUBE( \
- 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16)
-#define TRANS_CUBE_RBr_INVERSE STATIC_CUBE( \
- 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16)
-#define TRANS_CUBE_LUr STATIC_CUBE( \
- 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2)
-#define TRANS_CUBE_LUr_INVERSE STATIC_CUBE( \
- 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23)
-#define TRANS_CUBE_LFr STATIC_CUBE( \
- 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17)
-#define TRANS_CUBE_LFr_INVERSE STATIC_CUBE( \
- 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18)
-#define TRANS_CUBE_LDr STATIC_CUBE( \
- 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0)
-#define TRANS_CUBE_LDr_INVERSE STATIC_CUBE( \
- 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22)
-#define TRANS_CUBE_LBr STATIC_CUBE( \
- 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19)
-#define TRANS_CUBE_LBr_INVERSE STATIC_CUBE( \
- 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19)
-#define TRANS_CUBE_FUr STATIC_CUBE( \
- 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6)
-#define TRANS_CUBE_FUr_INVERSE STATIC_CUBE( \
- 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6)
-#define TRANS_CUBE_FRr STATIC_CUBE( \
- 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21)
-#define TRANS_CUBE_FRr_INVERSE STATIC_CUBE( \
- 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3)
-#define TRANS_CUBE_FDr STATIC_CUBE( \
- 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4)
-#define TRANS_CUBE_FDr_INVERSE STATIC_CUBE( \
- 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7)
-#define TRANS_CUBE_FLr STATIC_CUBE( \
- 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23)
-#define TRANS_CUBE_FLr_INVERSE STATIC_CUBE( \
- 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2)
-#define TRANS_CUBE_BUr STATIC_CUBE( \
- 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7)
-#define TRANS_CUBE_BUr_INVERSE STATIC_CUBE( \
- 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4)
-#define TRANS_CUBE_BRr STATIC_CUBE( \
- 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22)
-#define TRANS_CUBE_BRr_INVERSE STATIC_CUBE( \
- 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0)
-#define TRANS_CUBE_BDr STATIC_CUBE( \
- 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5)
-#define TRANS_CUBE_BDr_INVERSE STATIC_CUBE( \
- 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5)
-#define TRANS_CUBE_BLr STATIC_CUBE( \
- 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20)
-#define TRANS_CUBE_BLr_INVERSE STATIC_CUBE( \
- 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1)
-#define TRANS_CUBE_UFm STATIC_CUBE( \
- 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10)
-#define TRANS_CUBE_UFm_INVERSE STATIC_CUBE( \
- 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10)
-#define TRANS_CUBE_ULm STATIC_CUBE( \
- 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25)
-#define TRANS_CUBE_ULm_INVERSE STATIC_CUBE( \
- 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25)
-#define TRANS_CUBE_UBm STATIC_CUBE( \
- 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8)
-#define TRANS_CUBE_UBm_INVERSE STATIC_CUBE( \
- 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8)
-#define TRANS_CUBE_URm STATIC_CUBE( \
- 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27)
-#define TRANS_CUBE_URm_INVERSE STATIC_CUBE( \
- 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27)
-#define TRANS_CUBE_DFm STATIC_CUBE( \
- 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11)
-#define TRANS_CUBE_DFm_INVERSE STATIC_CUBE( \
- 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11)
-#define TRANS_CUBE_DLm STATIC_CUBE( \
- 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26)
-#define TRANS_CUBE_DLm_INVERSE STATIC_CUBE( \
- 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24)
-#define TRANS_CUBE_DBm STATIC_CUBE( \
- 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9)
-#define TRANS_CUBE_DBm_INVERSE STATIC_CUBE( \
- 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9)
-#define TRANS_CUBE_DRm STATIC_CUBE( \
- 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24)
-#define TRANS_CUBE_DRm_INVERSE STATIC_CUBE( \
- 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26)
-#define TRANS_CUBE_RUm STATIC_CUBE( \
- 68, 71, 69, 70, 33, 34, 32, 35, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3)
-#define TRANS_CUBE_RUm_INVERSE STATIC_CUBE( \
- 70, 68, 69, 71, 32, 34, 35, 33, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22)
-#define TRANS_CUBE_RFm STATIC_CUBE( \
- 34, 33, 32, 35, 68, 71, 70, 69, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18)
-#define TRANS_CUBE_RFm_INVERSE STATIC_CUBE( \
- 66, 65, 64, 67, 36, 39, 38, 37, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18)
-#define TRANS_CUBE_RDm STATIC_CUBE( \
- 71, 68, 70, 69, 34, 33, 35, 32, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1)
-#define TRANS_CUBE_RDm_INVERSE STATIC_CUBE( \
- 71, 69, 68, 70, 33, 35, 34, 32, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23)
-#define TRANS_CUBE_RBm STATIC_CUBE( \
- 33, 34, 35, 32, 71, 68, 69, 70, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16)
-#define TRANS_CUBE_RBm_INVERSE STATIC_CUBE( \
- 67, 64, 65, 66, 37, 38, 39, 36, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19)
-#define TRANS_CUBE_LUm STATIC_CUBE( \
- 69, 70, 68, 71, 32, 35, 33, 34, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2)
-#define TRANS_CUBE_LUm_INVERSE STATIC_CUBE( \
- 68, 70, 71, 69, 34, 32, 33, 35, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20)
-#define TRANS_CUBE_LFm STATIC_CUBE( \
- 32, 35, 34, 33, 70, 69, 68, 71, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17)
-#define TRANS_CUBE_LFm_INVERSE STATIC_CUBE( \
- 64, 67, 66, 65, 38, 37, 36, 39, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17)
-#define TRANS_CUBE_LDm STATIC_CUBE( \
- 70, 69, 71, 68, 35, 32, 34, 33, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0)
-#define TRANS_CUBE_LDm_INVERSE STATIC_CUBE( \
- 69, 71, 70, 68, 35, 33, 32, 34, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21)
-#define TRANS_CUBE_LBm STATIC_CUBE( \
- 35, 32, 33, 34, 69, 70, 71, 68, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19)
-#define TRANS_CUBE_LBm_INVERSE STATIC_CUBE( \
- 65, 66, 67, 64, 39, 36, 37, 38, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16)
-#define TRANS_CUBE_FUm STATIC_CUBE( \
- 64, 66, 65, 67, 36, 38, 37, 39, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7)
-#define TRANS_CUBE_FUm_INVERSE STATIC_CUBE( \
- 32, 34, 33, 35, 68, 70, 69, 71, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7)
-#define TRANS_CUBE_FRm STATIC_CUBE( \
- 36, 38, 39, 37, 66, 64, 65, 67, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20)
-#define TRANS_CUBE_FRm_INVERSE STATIC_CUBE( \
- 37, 38, 36, 39, 64, 67, 65, 66, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2)
-#define TRANS_CUBE_FDm STATIC_CUBE( \
- 66, 64, 67, 65, 38, 36, 39, 37, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5)
-#define TRANS_CUBE_FDm_INVERSE STATIC_CUBE( \
- 33, 35, 32, 34, 69, 71, 68, 70, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6)
-#define TRANS_CUBE_FLm STATIC_CUBE( \
- 38, 36, 37, 39, 64, 66, 67, 65, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22)
-#define TRANS_CUBE_FLm_INVERSE STATIC_CUBE( \
- 36, 39, 37, 38, 65, 66, 64, 67, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3)
-#define TRANS_CUBE_BUm STATIC_CUBE( \
- 65, 67, 64, 66, 37, 39, 36, 38, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6)
-#define TRANS_CUBE_BUm_INVERSE STATIC_CUBE( \
- 34, 32, 35, 33, 70, 68, 71, 69, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5)
-#define TRANS_CUBE_BRm STATIC_CUBE( \
- 39, 37, 36, 38, 65, 67, 66, 64, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23)
-#define TRANS_CUBE_BRm_INVERSE STATIC_CUBE( \
- 39, 36, 38, 37, 66, 65, 67, 64, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1)
-#define TRANS_CUBE_BDm STATIC_CUBE( \
- 67, 65, 66, 64, 39, 37, 38, 36, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4)
-#define TRANS_CUBE_BDm_INVERSE STATIC_CUBE( \
- 35, 33, 34, 32, 71, 69, 70, 68, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4)
-#define TRANS_CUBE_BLm STATIC_CUBE( \
- 37, 39, 38, 36, 67, 65, 64, 66, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21)
-#define TRANS_CUBE_BLm_INVERSE STATIC_CUBE( \
- 38, 37, 39, 36, 67, 64, 66, 65, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0)
+#define TRANS_CUBE_UFr \
+ 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
+#define TRANS_CUBE_UFr_INVERSE \
+ 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
+#define TRANS_CUBE_ULr \
+ 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24
+#define TRANS_CUBE_ULr_INVERSE \
+ 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26
+#define TRANS_CUBE_UBr \
+ 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9
+#define TRANS_CUBE_UBr_INVERSE \
+ 1, 0, 3, 2, 5, 4, 7, 6, 1, 0, 3, 2, 5, 4, 7, 6, 10, 11, 8, 9
+#define TRANS_CUBE_URr \
+ 5, 4, 6, 7, 0, 1, 3, 2, 4, 5, 6, 7, 1, 0, 3, 2, 27, 24, 25, 26
+#define TRANS_CUBE_URr_INVERSE \
+ 4, 5, 7, 6, 1, 0, 2, 3, 5, 4, 7, 6, 0, 1, 2, 3, 25, 26, 27, 24
+#define TRANS_CUBE_DFr \
+ 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10
+#define TRANS_CUBE_DFr_INVERSE \
+ 2, 3, 0, 1, 6, 7, 4, 5, 3, 2, 1, 0, 6, 7, 4, 5, 9, 8, 11, 10
+#define TRANS_CUBE_DLr \
+ 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27
+#define TRANS_CUBE_DLr_INVERSE \
+ 7, 6, 4, 5, 2, 3, 1, 0, 6, 7, 4, 5, 2, 3, 0, 1, 26, 25, 24, 27
+#define TRANS_CUBE_DBr \
+ 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8
+#define TRANS_CUBE_DBr_INVERSE \
+ 3, 2, 1, 0, 7, 6, 5, 4, 2, 3, 0, 1, 7, 6, 5, 4, 11, 10, 9, 8
+#define TRANS_CUBE_DRr \
+ 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25
+#define TRANS_CUBE_DRr_INVERSE \
+ 6, 7, 5, 4, 3, 2, 0, 1, 7, 6, 5, 4, 3, 2, 1, 0, 24, 27, 26, 25
+#define TRANS_CUBE_RUr \
+ 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3
+#define TRANS_CUBE_RUr_INVERSE \
+ 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21
+#define TRANS_CUBE_RFr \
+ 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18
+#define TRANS_CUBE_RFr_INVERSE \
+ 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17
+#define TRANS_CUBE_RDr \
+ 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1
+#define TRANS_CUBE_RDr_INVERSE \
+ 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20
+#define TRANS_CUBE_RBr \
+ 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16
+#define TRANS_CUBE_RBr_INVERSE \
+ 37, 38, 39, 36, 67, 64, 65, 66, 27, 24, 25, 26, 20, 23, 22, 21, 17, 18, 19, 16
+#define TRANS_CUBE_LUr \
+ 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2
+#define TRANS_CUBE_LUr_INVERSE \
+ 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23
+#define TRANS_CUBE_LFr \
+ 36, 39, 38, 37, 66, 65, 64, 67, 25, 26, 27, 24, 21, 22, 23, 20, 16, 19, 18, 17
+#define TRANS_CUBE_LFr_INVERSE \
+ 38, 37, 36, 39, 64, 67, 66, 65, 24, 27, 26, 25, 23, 20, 21, 22, 19, 16, 17, 18
+#define TRANS_CUBE_LDr \
+ 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0
+#define TRANS_CUBE_LDr_INVERSE \
+ 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22
+#define TRANS_CUBE_LBr \
+ 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19
+#define TRANS_CUBE_LBr_INVERSE \
+ 39, 36, 37, 38, 65, 66, 67, 64, 26, 25, 24, 27, 22, 21, 20, 23, 18, 17, 16, 19
+#define TRANS_CUBE_FUr \
+ 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6
+#define TRANS_CUBE_FUr_INVERSE \
+ 68, 70, 69, 71, 32, 34, 33, 35, 16, 19, 18, 17, 9, 8, 11, 10, 5, 4, 7, 6
+#define TRANS_CUBE_FRr \
+ 32, 34, 35, 33, 70, 68, 69, 71, 8, 9, 10, 11, 16, 19, 18, 17, 20, 23, 22, 21
+#define TRANS_CUBE_FRr_INVERSE \
+ 64, 67, 65, 66, 37, 38, 36, 39, 20, 23, 22, 21, 24, 27, 26, 25, 0, 1, 2, 3
+#define TRANS_CUBE_FDr \
+ 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4
+#define TRANS_CUBE_FDr_INVERSE \
+ 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7
+#define TRANS_CUBE_FLr \
+ 34, 32, 33, 35, 68, 70, 71, 69, 9, 8, 11, 10, 19, 16, 17, 18, 22, 21, 20, 23
+#define TRANS_CUBE_FLr_INVERSE \
+ 65, 66, 64, 67, 36, 39, 37, 38, 21, 22, 23, 20, 26, 25, 24, 27, 1, 0, 3, 2
+#define TRANS_CUBE_BUr \
+ 69, 71, 68, 70, 33, 35, 32, 34, 17, 18, 19, 16, 11, 10, 9, 8, 4, 5, 6, 7
+#define TRANS_CUBE_BUr_INVERSE \
+ 70, 68, 71, 69, 34, 32, 35, 33, 19, 16, 17, 18, 8, 9, 10, 11, 7, 6, 5, 4
+#define TRANS_CUBE_BRr \
+ 35, 33, 32, 34, 69, 71, 70, 68, 11, 10, 9, 8, 18, 17, 16, 19, 23, 20, 21, 22
+#define TRANS_CUBE_BRr_INVERSE \
+ 66, 65, 67, 64, 39, 36, 38, 37, 22, 21, 20, 23, 25, 26, 27, 24, 3, 2, 1, 0
+#define TRANS_CUBE_BDr \
+ 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5
+#define TRANS_CUBE_BDr_INVERSE \
+ 71, 69, 70, 68, 35, 33, 34, 32, 18, 17, 16, 19, 10, 11, 8, 9, 6, 7, 4, 5
+#define TRANS_CUBE_BLr \
+ 33, 35, 34, 32, 71, 69, 68, 70, 10, 11, 8, 9, 17, 18, 19, 16, 21, 22, 23, 20
+#define TRANS_CUBE_BLr_INVERSE \
+ 67, 64, 66, 65, 38, 37, 39, 36, 23, 20, 21, 22, 27, 24, 25, 26, 2, 3, 0, 1
+#define TRANS_CUBE_UFm \
+ 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10
+#define TRANS_CUBE_UFm_INVERSE \
+ 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8, 11, 10
+#define TRANS_CUBE_ULm \
+ 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25
+#define TRANS_CUBE_ULm_INVERSE \
+ 0, 1, 3, 2, 5, 4, 6, 7, 4, 5, 6, 7, 0, 1, 2, 3, 24, 27, 26, 25
+#define TRANS_CUBE_UBm \
+ 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8
+#define TRANS_CUBE_UBm_INVERSE \
+ 5, 4, 7, 6, 1, 0, 3, 2, 1, 0, 3, 2, 4, 5, 6, 7, 11, 10, 9, 8
+#define TRANS_CUBE_URm \
+ 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27
+#define TRANS_CUBE_URm_INVERSE \
+ 1, 0, 2, 3, 4, 5, 7, 6, 5, 4, 7, 6, 1, 0, 3, 2, 26, 25, 24, 27
+#define TRANS_CUBE_DFm \
+ 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11
+#define TRANS_CUBE_DFm_INVERSE \
+ 6, 7, 4, 5, 2, 3, 0, 1, 3, 2, 1, 0, 7, 6, 5, 4, 8, 9, 10, 11
+#define TRANS_CUBE_DLm \
+ 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26
+#define TRANS_CUBE_DLm_INVERSE \
+ 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24
+#define TRANS_CUBE_DBm \
+ 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9
+#define TRANS_CUBE_DBm_INVERSE \
+ 7, 6, 5, 4, 3, 2, 1, 0, 2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9
+#define TRANS_CUBE_DRm \
+ 2, 3, 1, 0, 7, 6, 4, 5, 6, 7, 4, 5, 3, 2, 1, 0, 25, 26, 27, 24
+#define TRANS_CUBE_DRm_INVERSE \
+ 3, 2, 0, 1, 6, 7, 5, 4, 7, 6, 5, 4, 2, 3, 0, 1, 27, 24, 25, 26
+#define TRANS_CUBE_RUm \
+ 68, 71, 69, 70, 33, 34, 32, 35, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3
+#define TRANS_CUBE_RUm_INVERSE \
+ 70, 68, 69, 71, 32, 34, 35, 33, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22
+#define TRANS_CUBE_RFm \
+ 34, 33, 32, 35, 68, 71, 70, 69, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18
+#define TRANS_CUBE_RFm_INVERSE \
+ 66, 65, 64, 67, 36, 39, 38, 37, 25, 26, 27, 24, 22, 21, 20, 23, 19, 16, 17, 18
+#define TRANS_CUBE_RDm \
+ 71, 68, 70, 69, 34, 33, 35, 32, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1
+#define TRANS_CUBE_RDm_INVERSE \
+ 71, 69, 68, 70, 33, 35, 34, 32, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23
+#define TRANS_CUBE_RBm \
+ 33, 34, 35, 32, 71, 68, 69, 70, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16
+#define TRANS_CUBE_RBm_INVERSE \
+ 67, 64, 65, 66, 37, 38, 39, 36, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19
+#define TRANS_CUBE_LUm \
+ 69, 70, 68, 71, 32, 35, 33, 34, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2
+#define TRANS_CUBE_LUm_INVERSE \
+ 68, 70, 71, 69, 34, 32, 33, 35, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20
+#define TRANS_CUBE_LFm \
+ 32, 35, 34, 33, 70, 69, 68, 71, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17
+#define TRANS_CUBE_LFm_INVERSE \
+ 64, 67, 66, 65, 38, 37, 36, 39, 24, 27, 26, 25, 20, 23, 22, 21, 16, 19, 18, 17
+#define TRANS_CUBE_LDm \
+ 70, 69, 71, 68, 35, 32, 34, 33, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0
+#define TRANS_CUBE_LDm_INVERSE \
+ 69, 71, 70, 68, 35, 33, 32, 34, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21
+#define TRANS_CUBE_LBm \
+ 35, 32, 33, 34, 69, 70, 71, 68, 27, 24, 25, 26, 23, 20, 21, 22, 18, 17, 16, 19
+#define TRANS_CUBE_LBm_INVERSE \
+ 65, 66, 67, 64, 39, 36, 37, 38, 26, 25, 24, 27, 21, 22, 23, 20, 17, 18, 19, 16
+#define TRANS_CUBE_FUm \
+ 64, 66, 65, 67, 36, 38, 37, 39, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7
+#define TRANS_CUBE_FUm_INVERSE \
+ 32, 34, 33, 35, 68, 70, 69, 71, 16, 19, 18, 17, 8, 9, 10, 11, 4, 5, 6, 7
+#define TRANS_CUBE_FRm \
+ 36, 38, 39, 37, 66, 64, 65, 67, 9, 8, 11, 10, 16, 19, 18, 17, 21, 22, 23, 20
+#define TRANS_CUBE_FRm_INVERSE \
+ 37, 38, 36, 39, 64, 67, 65, 66, 20, 23, 22, 21, 27, 24, 25, 26, 1, 0, 3, 2
+#define TRANS_CUBE_FDm \
+ 66, 64, 67, 65, 38, 36, 39, 37, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5
+#define TRANS_CUBE_FDm_INVERSE \
+ 33, 35, 32, 34, 69, 71, 68, 70, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6
+#define TRANS_CUBE_FLm \
+ 38, 36, 37, 39, 64, 66, 67, 65, 8, 9, 10, 11, 19, 16, 17, 18, 23, 20, 21, 22
+#define TRANS_CUBE_FLm_INVERSE \
+ 36, 39, 37, 38, 65, 66, 64, 67, 21, 22, 23, 20, 25, 26, 27, 24, 0, 1, 2, 3
+#define TRANS_CUBE_BUm \
+ 65, 67, 64, 66, 37, 39, 36, 38, 17, 18, 19, 16, 10, 11, 8, 9, 5, 4, 7, 6
+#define TRANS_CUBE_BUm_INVERSE \
+ 34, 32, 35, 33, 70, 68, 71, 69, 19, 16, 17, 18, 9, 8, 11, 10, 6, 7, 4, 5
+#define TRANS_CUBE_BRm \
+ 39, 37, 36, 38, 65, 67, 66, 64, 10, 11, 8, 9, 18, 17, 16, 19, 22, 21, 20, 23
+#define TRANS_CUBE_BRm_INVERSE \
+ 39, 36, 38, 37, 66, 65, 67, 64, 22, 21, 20, 23, 26, 25, 24, 27, 2, 3, 0, 1
+#define TRANS_CUBE_BDm \
+ 67, 65, 66, 64, 39, 37, 38, 36, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4
+#define TRANS_CUBE_BDm_INVERSE \
+ 35, 33, 34, 32, 71, 69, 70, 68, 18, 17, 16, 19, 11, 10, 9, 8, 7, 6, 5, 4
+#define TRANS_CUBE_BLm \
+ 37, 39, 38, 36, 67, 65, 64, 66, 11, 10, 9, 8, 17, 18, 19, 16, 20, 23, 22, 21
+#define TRANS_CUBE_BLm_INVERSE \
+ 38, 37, 39, 36, 67, 64, 66, 65, 23, 20, 21, 22, 24, 27, 26, 25, 3, 2, 1, 0
diff --git a/src/core/core.h b/src/core/core.h
@@ -6,7 +6,7 @@
#include "moves.h"
/* TODO: work in progress */
-#if 0
+#if 1
#include "transform.h"
#else
#include "transform_with_switch.h"
diff --git a/src/core/cube.h b/src/core/cube.h
@@ -1,5 +1,6 @@
STATIC cube_t solvecube(void);
-STATIC cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]);
+STATIC_INLINE cube_t cubefromarray_ce(uint8_t [static 8], uint8_t [static 12]);
+STATIC_INLINE cube_t cubefromarray_single(uint8_t [static 20]);
STATIC bool isconsistent(cube_t);
STATIC bool issolvable(cube_t);
STATIC bool issolved(cube_t);
@@ -14,15 +15,23 @@ solvedcube(void)
return SOLVED_CUBE;
}
-STATIC cube_t
-cubefromarray(uint8_t c[static 8], uint8_t e[static 12])
+STATIC_INLINE cube_t
+cubefromarray_ce(uint8_t c[static 8], uint8_t e[static 12])
{
- return STATIC_CUBE(
+ return cubefrompieces(
c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7],
e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7],
e[8], e[9], e[10], e[11]);
}
+STATIC_INLINE cube_t
+cubefromarray_single(uint8_t p[static 20])
+{
+ return cubefrompieces(
+ p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10],
+ p[11], p[12], p[13], p[14], p[15], p[16], p[17], p[18], p[19]);
+}
+
STATIC bool
isconsistent(cube_t cube)
{
@@ -178,5 +187,5 @@ getcube(int64_t ep, int64_t eo, int64_t cp, int64_t co)
for (i = 0; i < 8; i++)
carr[i] |= coarr[i] << COSHIFT;
- return cubefromarray(carr, earr);
+ return cubefromarray_ce(carr, earr);
}
diff --git a/src/core/io_cube.h b/src/core/io_cube.h
@@ -143,7 +143,7 @@ readcube_B32(const char *buf)
"Error reading B32 edge %d (char %d)\n", i, i+9);
}
- return cubefromarray(c, e);
+ return cubefromarray_ce(c, e);
}
STATIC cube_t
@@ -178,7 +178,7 @@ readcube_H48(const char *buf)
c[i] = piece | orient;
}
- return cubefromarray(c, e);
+ return cubefromarray_ce(c, e);
}
STATIC uint8_t
@@ -210,7 +210,7 @@ readcube_LST(const char *buf)
for (i = 0; i < 12; i++)
e[i] = readpiece_LST(&buf);
- return cubefromarray(c, e);
+ return cubefromarray_ce(c, e);
}
STATIC int
diff --git a/src/core/moves.h b/src/core/moves.h
@@ -1,5 +1,5 @@
-#define MOVE(M, c) compose(c, MOVE_CUBE_ ## M)
-#define PREMOVE(M, c) compose(MOVE_CUBE_ ## M, c)
+#define MOVE(M, c) compose(c, cubefrompieces(MOVE_CUBE_ ## M))
+#define PREMOVE(M, c) compose(cubefrompieces(MOVE_CUBE_ ## M), c)
STATIC_INLINE bool allowednextmove(uint8_t *, uint8_t);
diff --git a/src/core/transform.h b/src/core/transform.h
@@ -3,106 +3,106 @@ STATIC cube_t transform_corners(cube_t, uint8_t);
STATIC cube_t transform(cube_t, uint8_t);
STATIC cube_t applytrans(cube_t, const char *);
-static cube_t cube_trans_table[48] = {
- [TRANS_UFr] = TRANS_CUBE_UFr,
- [TRANS_UFm] = TRANS_CUBE_UFm,
- [TRANS_ULr] = TRANS_CUBE_URr,
- [TRANS_ULm] = TRANS_CUBE_ULm,
- [TRANS_UBr] = TRANS_CUBE_UBr,
- [TRANS_UBm] = TRANS_CUBE_UBm,
- [TRANS_URr] = TRANS_CUBE_ULr,
- [TRANS_URm] = TRANS_CUBE_URm,
- [TRANS_DFr] = TRANS_CUBE_DFr,
- [TRANS_DFm] = TRANS_CUBE_DFm,
- [TRANS_DLr] = TRANS_CUBE_DLr,
- [TRANS_DLm] = TRANS_CUBE_DRm,
- [TRANS_DBr] = TRANS_CUBE_DBr,
- [TRANS_DBm] = TRANS_CUBE_DBm,
- [TRANS_DRr] = TRANS_CUBE_DRr,
- [TRANS_DRm] = TRANS_CUBE_DLm,
- [TRANS_RUr] = TRANS_CUBE_FRr,
- [TRANS_RUm] = TRANS_CUBE_FLm,
- [TRANS_RFr] = TRANS_CUBE_LFr,
- [TRANS_RFm] = TRANS_CUBE_RFm,
- [TRANS_RDr] = TRANS_CUBE_BLr,
- [TRANS_RDm] = TRANS_CUBE_BRm,
- [TRANS_RBr] = TRANS_CUBE_RBr,
- [TRANS_RBm] = TRANS_CUBE_LBm,
- [TRANS_LUr] = TRANS_CUBE_FLr,
- [TRANS_LUm] = TRANS_CUBE_FRm,
- [TRANS_LFr] = TRANS_CUBE_RFr,
- [TRANS_LFm] = TRANS_CUBE_LFm,
- [TRANS_LDr] = TRANS_CUBE_BRr,
- [TRANS_LDm] = TRANS_CUBE_BLm,
- [TRANS_LBr] = TRANS_CUBE_LBr,
- [TRANS_LBm] = TRANS_CUBE_RBm,
- [TRANS_FUr] = TRANS_CUBE_FUr,
- [TRANS_FUm] = TRANS_CUBE_FUm,
- [TRANS_FRr] = TRANS_CUBE_RUr,
- [TRANS_FRm] = TRANS_CUBE_LUm,
- [TRANS_FDr] = TRANS_CUBE_BUr,
- [TRANS_FDm] = TRANS_CUBE_BUm,
- [TRANS_FLr] = TRANS_CUBE_LUr,
- [TRANS_FLm] = TRANS_CUBE_RUm,
- [TRANS_BUr] = TRANS_CUBE_FDr,
- [TRANS_BUm] = TRANS_CUBE_FDm,
- [TRANS_BRr] = TRANS_CUBE_LDr,
- [TRANS_BRm] = TRANS_CUBE_RDm,
- [TRANS_BDr] = TRANS_CUBE_BDr,
- [TRANS_BDm] = TRANS_CUBE_BDm,
- [TRANS_BLr] = TRANS_CUBE_RDr,
- [TRANS_BLm] = TRANS_CUBE_LDm,
+static uint8_t cube_trans_table[48][20] = {
+ [TRANS_UFr] = { TRANS_CUBE_UFr },
+ [TRANS_UFm] = { TRANS_CUBE_UFm },
+ [TRANS_ULr] = { TRANS_CUBE_ULr },
+ [TRANS_ULm] = { TRANS_CUBE_ULm },
+ [TRANS_UBr] = { TRANS_CUBE_UBr },
+ [TRANS_UBm] = { TRANS_CUBE_UBm },
+ [TRANS_URr] = { TRANS_CUBE_URr },
+ [TRANS_URm] = { TRANS_CUBE_URm },
+ [TRANS_DFr] = { TRANS_CUBE_DFr },
+ [TRANS_DFm] = { TRANS_CUBE_DFm },
+ [TRANS_DLr] = { TRANS_CUBE_DLr },
+ [TRANS_DLm] = { TRANS_CUBE_DLm },
+ [TRANS_DBr] = { TRANS_CUBE_DBr },
+ [TRANS_DBm] = { TRANS_CUBE_DBm },
+ [TRANS_DRr] = { TRANS_CUBE_DRr },
+ [TRANS_DRm] = { TRANS_CUBE_DRm },
+ [TRANS_RUr] = { TRANS_CUBE_RUr },
+ [TRANS_RUm] = { TRANS_CUBE_RUm },
+ [TRANS_RFr] = { TRANS_CUBE_RFr },
+ [TRANS_RFm] = { TRANS_CUBE_RFm },
+ [TRANS_RDr] = { TRANS_CUBE_RDr },
+ [TRANS_RDm] = { TRANS_CUBE_RDm },
+ [TRANS_RBr] = { TRANS_CUBE_RBr },
+ [TRANS_RBm] = { TRANS_CUBE_RBm },
+ [TRANS_LUr] = { TRANS_CUBE_LUr },
+ [TRANS_LUm] = { TRANS_CUBE_LUm },
+ [TRANS_LFr] = { TRANS_CUBE_LFr },
+ [TRANS_LFm] = { TRANS_CUBE_LFm },
+ [TRANS_LDr] = { TRANS_CUBE_LDr },
+ [TRANS_LDm] = { TRANS_CUBE_LDm },
+ [TRANS_LBr] = { TRANS_CUBE_LBr },
+ [TRANS_LBm] = { TRANS_CUBE_LBm },
+ [TRANS_FUr] = { TRANS_CUBE_FUr },
+ [TRANS_FUm] = { TRANS_CUBE_FUm },
+ [TRANS_FRr] = { TRANS_CUBE_FRr },
+ [TRANS_FRm] = { TRANS_CUBE_FRm },
+ [TRANS_FDr] = { TRANS_CUBE_FDr },
+ [TRANS_FDm] = { TRANS_CUBE_FDm },
+ [TRANS_FLr] = { TRANS_CUBE_FLr },
+ [TRANS_FLm] = { TRANS_CUBE_FLm },
+ [TRANS_BUr] = { TRANS_CUBE_BUr },
+ [TRANS_BUm] = { TRANS_CUBE_BUm },
+ [TRANS_BRr] = { TRANS_CUBE_BRr },
+ [TRANS_BRm] = { TRANS_CUBE_BRm },
+ [TRANS_BDr] = { TRANS_CUBE_BDr },
+ [TRANS_BDm] = { TRANS_CUBE_BDm },
+ [TRANS_BLr] = { TRANS_CUBE_BLr },
+ [TRANS_BLm] = { TRANS_CUBE_BLm },
};
-static cube_t cube_trans_table_inverse[48] = {
- [TRANS_UFr] = TRANS_CUBE_UFr_inverse,
- [TRANS_UFm] = TRANS_CUBE_UFm_inverse,
- [TRANS_ULr] = TRANS_CUBE_URr_inverse,
- [TRANS_ULm] = TRANS_CUBE_ULm_inverse,
- [TRANS_UBr] = TRANS_CUBE_UBr_inverse,
- [TRANS_UBm] = TRANS_CUBE_UBm_inverse,
- [TRANS_URr] = TRANS_CUBE_ULr_inverse,
- [TRANS_URm] = TRANS_CUBE_URm_inverse,
- [TRANS_DFr] = TRANS_CUBE_DFr_inverse,
- [TRANS_DFm] = TRANS_CUBE_DFm_inverse,
- [TRANS_DLr] = TRANS_CUBE_DLr_inverse,
- [TRANS_DLm] = TRANS_CUBE_DRm_inverse,
- [TRANS_DBr] = TRANS_CUBE_DBr_inverse,
- [TRANS_DBm] = TRANS_CUBE_DBm_inverse,
- [TRANS_DRr] = TRANS_CUBE_DRr_inverse,
- [TRANS_DRm] = TRANS_CUBE_DLm_inverse,
- [TRANS_RUr] = TRANS_CUBE_FRr_inverse,
- [TRANS_RUm] = TRANS_CUBE_FLm_inverse,
- [TRANS_RFr] = TRANS_CUBE_LFr_inverse,
- [TRANS_RFm] = TRANS_CUBE_RFm_inverse,
- [TRANS_RDr] = TRANS_CUBE_BLr_inverse,
- [TRANS_RDm] = TRANS_CUBE_BRm_inverse,
- [TRANS_RBr] = TRANS_CUBE_RBr_inverse,
- [TRANS_RBm] = TRANS_CUBE_LBm_inverse,
- [TRANS_LUr] = TRANS_CUBE_FLr_inverse,
- [TRANS_LUm] = TRANS_CUBE_FRm_inverse,
- [TRANS_LFr] = TRANS_CUBE_RFr_inverse,
- [TRANS_LFm] = TRANS_CUBE_LFm_inverse,
- [TRANS_LDr] = TRANS_CUBE_BRr_inverse,
- [TRANS_LDm] = TRANS_CUBE_BLm_inverse,
- [TRANS_LBr] = TRANS_CUBE_LBr_inverse,
- [TRANS_LBm] = TRANS_CUBE_RBm_inverse,
- [TRANS_FUr] = TRANS_CUBE_FUr_inverse,
- [TRANS_FUm] = TRANS_CUBE_FUm_inverse,
- [TRANS_FRr] = TRANS_CUBE_RUr_inverse,
- [TRANS_FRm] = TRANS_CUBE_LUm_inverse,
- [TRANS_FDr] = TRANS_CUBE_BUr_inverse,
- [TRANS_FDm] = TRANS_CUBE_BUm_inverse,
- [TRANS_FLr] = TRANS_CUBE_LUr_inverse,
- [TRANS_FLm] = TRANS_CUBE_RUm_inverse,
- [TRANS_BUr] = TRANS_CUBE_FDr_inverse,
- [TRANS_BUm] = TRANS_CUBE_FDm_inverse,
- [TRANS_BRr] = TRANS_CUBE_LDr_inverse,
- [TRANS_BRm] = TRANS_CUBE_RDm_inverse,
- [TRANS_BDr] = TRANS_CUBE_BDr_inverse,
- [TRANS_BDm] = TRANS_CUBE_BDm_inverse,
- [TRANS_BLr] = TRANS_CUBE_RDr_inverse,
- [TRANS_BLm] = TRANS_CUBE_LDm_inverse,
+static uint8_t cube_trans_table_inverse[48][20] = {
+ [TRANS_UFr] = { TRANS_CUBE_UFr_INVERSE },
+ [TRANS_UFm] = { TRANS_CUBE_UFm_INVERSE },
+ [TRANS_ULr] = { TRANS_CUBE_ULr_INVERSE },
+ [TRANS_ULm] = { TRANS_CUBE_ULm_INVERSE },
+ [TRANS_UBr] = { TRANS_CUBE_UBr_INVERSE },
+ [TRANS_UBm] = { TRANS_CUBE_UBm_INVERSE },
+ [TRANS_URr] = { TRANS_CUBE_URr_INVERSE },
+ [TRANS_URm] = { TRANS_CUBE_URm_INVERSE },
+ [TRANS_DFr] = { TRANS_CUBE_DFr_INVERSE },
+ [TRANS_DFm] = { TRANS_CUBE_DFm_INVERSE },
+ [TRANS_DLr] = { TRANS_CUBE_DLr_INVERSE },
+ [TRANS_DLm] = { TRANS_CUBE_DLm_INVERSE },
+ [TRANS_DBr] = { TRANS_CUBE_DBr_INVERSE },
+ [TRANS_DBm] = { TRANS_CUBE_DBm_INVERSE },
+ [TRANS_DRr] = { TRANS_CUBE_DRr_INVERSE },
+ [TRANS_DRm] = { TRANS_CUBE_DRm_INVERSE },
+ [TRANS_RUr] = { TRANS_CUBE_RUr_INVERSE },
+ [TRANS_RUm] = { TRANS_CUBE_RUm_INVERSE },
+ [TRANS_RFr] = { TRANS_CUBE_RFr_INVERSE },
+ [TRANS_RFm] = { TRANS_CUBE_RFm_INVERSE },
+ [TRANS_RDr] = { TRANS_CUBE_RDr_INVERSE },
+ [TRANS_RDm] = { TRANS_CUBE_RDm_INVERSE },
+ [TRANS_RBr] = { TRANS_CUBE_RBr_INVERSE },
+ [TRANS_RBm] = { TRANS_CUBE_RBm_INVERSE },
+ [TRANS_LUr] = { TRANS_CUBE_LUr_INVERSE },
+ [TRANS_LUm] = { TRANS_CUBE_LUm_INVERSE },
+ [TRANS_LFr] = { TRANS_CUBE_LFr_INVERSE },
+ [TRANS_LFm] = { TRANS_CUBE_LFm_INVERSE },
+ [TRANS_LDr] = { TRANS_CUBE_LDr_INVERSE },
+ [TRANS_LDm] = { TRANS_CUBE_LDm_INVERSE },
+ [TRANS_LBr] = { TRANS_CUBE_LBr_INVERSE },
+ [TRANS_LBm] = { TRANS_CUBE_LBm_INVERSE },
+ [TRANS_FUr] = { TRANS_CUBE_FUr_INVERSE },
+ [TRANS_FUm] = { TRANS_CUBE_FUm_INVERSE },
+ [TRANS_FRr] = { TRANS_CUBE_FRr_INVERSE },
+ [TRANS_FRm] = { TRANS_CUBE_FRm_INVERSE },
+ [TRANS_FDr] = { TRANS_CUBE_FDr_INVERSE },
+ [TRANS_FDm] = { TRANS_CUBE_FDm_INVERSE },
+ [TRANS_FLr] = { TRANS_CUBE_FLr_INVERSE },
+ [TRANS_FLm] = { TRANS_CUBE_FLm_INVERSE },
+ [TRANS_BUr] = { TRANS_CUBE_BUr_INVERSE },
+ [TRANS_BUm] = { TRANS_CUBE_BUm_INVERSE },
+ [TRANS_BRr] = { TRANS_CUBE_BRr_INVERSE },
+ [TRANS_BRm] = { TRANS_CUBE_BRm_INVERSE },
+ [TRANS_BDr] = { TRANS_CUBE_BDr_INVERSE },
+ [TRANS_BDm] = { TRANS_CUBE_BDm_INVERSE },
+ [TRANS_BLr] = { TRANS_CUBE_BLr_INVERSE },
+ [TRANS_BLm] = { TRANS_CUBE_BLm_INVERSE },
};
STATIC cube_t
@@ -114,8 +114,8 @@ transform_edges(cube_t c, uint8_t t)
"transform: invalid transformation %" PRIu8
", must be between 0 and 47\n", t);
- trans_cube = cube_trans_table[t];
- trans_inv = cube_trans_table_inverse[t];
+ trans_cube = cubefromarray_single(cube_trans_table[t]);
+ trans_inv = cubefromarray_single(cube_trans_table_inverse[t]);
ret = compose_edges(trans_cube, c);
ret = compose_edges(ret, trans_inv);
@@ -132,8 +132,8 @@ transform_corners(cube_t c, uint8_t t)
"transform: invalid transformation %" PRIu8
", must be between 0 and 47\n", t);
- trans_cube = cube_trans_table[t];
- trans_inv = cube_trans_table_inverse[t];
+ trans_cube = cubefromarray_single(cube_trans_table[t]);
+ trans_inv = cubefromarray_single(cube_trans_table_inverse[t]);
ret = compose_corners(trans_cube, c);
ret = compose_corners(ret, trans_inv);
@@ -150,8 +150,8 @@ transform(cube_t c, uint8_t t)
"transform: invalid transformation %" PRIu8
", must be between 0 and 47\n", t);
- trans_cube = cube_trans_table[t];
- trans_inv = cube_trans_table_inverse[t];
+ trans_cube = cubefromarray_single(cube_trans_table[t]);
+ trans_inv = cubefromarray_single(cube_trans_table_inverse[t]);
ret = compose(trans_cube, c);
ret = compose(ret, trans_inv);