From b17411249b17133f35833c202e6c2e4bf43b3298 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 5 Sep 2024 10:04:34 +0200 Subject: More renaming --- src/arch/avx2.h | 48 ++++++++++++++++++++++++------------------------ src/arch/neon.h | 22 +++++++++++----------- src/arch/portable.h | 14 +++++++------- 3 files changed, 42 insertions(+), 42 deletions(-) (limited to 'src/arch') diff --git a/src/arch/avx2.h b/src/arch/avx2.h index 8d53f8f..2c3371e 100644 --- a/src/arch/avx2.h +++ b/src/arch/avx2.h @@ -1,19 +1,19 @@ -#define _co2_avx2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x6060606060606060)) -#define _cocw_avx2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x2020202020202020)) -#define _cp_avx2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x0707070707070707)) -#define _ep_avx2 \ +#define CO2_AVX2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x6060606060606060)) +#define COCW_AVX2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x2020202020202020)) +#define CP_AVX2 _mm256_set_epi64x(0, 0, 0, INT64_C(0x0707070707070707)) +#define EP_AVX2 \ _mm256_set_epi64x(INT64_C(0x0F0F0F0F), INT64_C(0x0F0F0F0F0F0F0F0F), 0, 0) -#define _eo_avx2 \ +#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, \ +#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 _mm256_set_epi64x(0, 0, 0, 0) -#define solved static_cube( \ +#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 @@ -43,11 +43,11 @@ invertco(cube_t c) { cube_t co, shleft, shright, summed, newco, cleanco, ret; - co = _mm256_and_si256(c, _co2_avx2); + co = _mm256_and_si256(c, CO2_AVX2); shleft = _mm256_slli_epi32(co, 1); shright = _mm256_srli_epi32(co, 1); summed = _mm256_or_si256(shleft, shright); - newco = _mm256_and_si256(summed, _co2_avx2); + newco = _mm256_and_si256(summed, CO2_AVX2); cleanco = _mm256_xor_si256(c, co); ret = _mm256_or_si256(cleanco, newco); @@ -68,7 +68,7 @@ compose_epcpeo(cube_t c1, cube_t c2) s = _mm256_andnot_si256(b, s); /* Change EO */ - eo2 = _mm256_and_si256(c2, _eo_avx2); + eo2 = _mm256_and_si256(c2, EO_AVX2); s = _mm256_xor_si256(s, eo2); return s; @@ -99,16 +99,16 @@ compose(cube_t c1, cube_t c2) s = compose_epcpeo(c1, c2); /* Change CO */ - co1 = _mm256_and_si256(s, _co2_avx2); - co2 = _mm256_and_si256(c2, _co2_avx2); + co1 = _mm256_and_si256(s, CO2_AVX2); + co2 = _mm256_and_si256(c2, CO2_AVX2); aux = _mm256_add_epi8(co1, co2); - auy1 = _mm256_add_epi8(aux, _cocw_avx2); + auy1 = _mm256_add_epi8(aux, COCW_AVX2); auy2 = _mm256_srli_epi32(auy1, 2); auz1 = _mm256_add_epi8(aux, auy2); - auz2 = _mm256_and_si256(auz1, _co2_avx2); + auz2 = _mm256_and_si256(auz1, CO2_AVX2); /* Put together */ - s = _mm256_andnot_si256(_co2_avx2, s); + s = _mm256_andnot_si256(CO2_AVX2, s); s = _mm256_or_si256(s, auz2); return s; @@ -157,9 +157,9 @@ inverse(cube_t c) vi = _mm256_shuffle_epi8(vi, vi); vi = _mm256_shuffle_epi8(vi, c); - vo = _mm256_and_si256(c, _mm256_or_si256(_eo_avx2, _co2_avx2)); + vo = _mm256_and_si256(c, _mm256_or_si256(EO_AVX2, CO2_AVX2)); vo = _mm256_shuffle_epi8(vo, vi); - vp = _mm256_andnot_si256(_mm256_or_si256(_eo_avx2, _co2_avx2), vi); + vp = _mm256_andnot_si256(_mm256_or_si256(EO_AVX2, CO2_AVX2), vi); ret = _mm256_or_si256(vp, vo); ret = cleanaftershuffle(ret); @@ -172,7 +172,7 @@ coord_co(cube_t c) cube_t co; int64_t mem[4], ret, i, p; - co = _mm256_and_si256(c, _co2_avx2); + co = _mm256_and_si256(c, CO2_AVX2); _mm256_storeu_si256((__m256i *)mem, co); mem[0] >>= 5; @@ -188,7 +188,7 @@ coord_csep(cube_t c) cube_t cp, shifted; int64_t mask; - cp = _mm256_and_si256(c, _cp_avx2); + cp = _mm256_and_si256(c, CP_AVX2); shifted = _mm256_slli_epi32(cp, 5); mask = _mm256_movemask_epi8(shifted); @@ -207,7 +207,7 @@ coord_eo(cube_t c) cube_t eo, shifted; int64_t mask; - eo = _mm256_and_si256(c, _eo_avx2); + eo = _mm256_and_si256(c, EO_AVX2); shifted = _mm256_slli_epi32(eo, 3); mask = _mm256_movemask_epi8(shifted); @@ -220,7 +220,7 @@ coord_esep(cube_t c) cube_t ep; int64_t e, mem[4], i, j, jj, k, l, ret1, ret2, bit1, bit2, is1; - ep = _mm256_and_si256(c, _ep_avx2); + ep = _mm256_and_si256(c, EP_AVX2); _mm256_storeu_si256((__m256i *)mem, ep); mem[3] <<= 8; @@ -278,7 +278,7 @@ set_eo(cube_t *cube, int64_t eo) (eo12 & 1) << 4; veo = _mm256_set_epi64x(eotop, eobot, 0, 0); - *cube = _mm256_andnot_si256(_eo_avx2, *cube); + *cube = _mm256_andnot_si256(EO_AVX2, *cube); *cube = _mm256_or_si256(*cube, veo); } @@ -290,7 +290,7 @@ invcoord_esep(int64_t esep) invcoord_esep_array(esep % 70, esep / 70, mem+16); - ret = solved; + ret = SOLVED_CUBE; eee = _mm256_loadu_si256((__m256i_u *)&mem); copy_edges(&ret, eee); diff --git a/src/arch/neon.h b/src/arch/neon.h index dee0eba..acb75c3 100644 --- a/src/arch/neon.h +++ b/src/arch/neon.h @@ -1,21 +1,21 @@ -#define _co2_neon vdupq_n_u8(0x60) -#define _cocw_neon vdupq_n_u8(0x20) -#define _cp_neon vdupq_n_u8(0x07) -#define _ep_neon vcombine_u8(vdupq_n_u8(0x0F), vdupq_n_u8(0x0F)) -#define _eo_neon vcombine_u8(vdupq_n_u8(0x10), vdupq_n_u8(0x10)) +#define CO2_NEON vdupq_n_u8(0x60) +#define COCW_NEON vdupq_n_u8(0x20) +#define CP_NEON vdupq_n_u8(0x07) +#define EP_NEON vcombine_u8(vdupq_n_u8(0x0F), vdupq_n_u8(0x0F)) +#define EO_NEON vcombine_u8(vdupq_n_u8(0x10), vdupq_n_u8(0x10)) 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, \ +#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 \ +#define ZERO_CUBE \ (cube_t) \ { \ .corner = vdupq_n_u8(0), \ @@ -23,7 +23,7 @@ STATIC_INLINE uint8x16_t compose_corners_slim(uint8x16_t, uint8x16_t); } // solved cube -#define solved static_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 @@ -68,11 +68,11 @@ invertco(cube_t c) cube_t ret; uint8x16_t co, shleft, shright, summed, newco, cleanco; - co = vandq_u8(c.corner, _co2_neon); + co = vandq_u8(c.corner, CO2_NEON); shleft = vshlq_n_u8(co, 1); shright = vshrq_n_u8(co, 1); summed = vorrq_u8(shleft, shright); - newco = vandq_u8(summed, _co2_neon); + newco = vandq_u8(summed, CO2_NEON); cleanco = veorq_u8(c.corner, co); ret.corner = vorrq_u8(cleanco, newco); ret.edge = c.edge; @@ -323,7 +323,7 @@ invcoord_esep(int64_t esep) invcoord_esep_array(esep % 70, esep / 70, mem); - ret = solved; + ret = SOLVED_CUBE; ret.edge = vld1q_u8(mem); return ret; diff --git a/src/arch/portable.h b/src/arch/portable.h index fdadb02..e9a8dd0 100644 --- a/src/arch/portable.h +++ b/src/arch/portable.h @@ -1,12 +1,12 @@ -#define static_cube(c_ufr, c_ubl, c_dfl, c_dbr, c_ufl, c_ubr, c_dfr, c_dbl, \ +#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 static_cube( \ +#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 static_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 @@ -80,7 +80,7 @@ compose_corners_inplace(cube_t c1, cube_t c2, cube_t *ret) STATIC_INLINE cube_t compose_edges(cube_t c1, cube_t c2) { - cube_t ret = zero; + cube_t ret = ZERO_CUBE; compose_edges_inplace(c1, c2, &ret); @@ -90,7 +90,7 @@ compose_edges(cube_t c1, cube_t c2) STATIC_INLINE cube_t compose_corners(cube_t c1, cube_t c2) { - cube_t ret = zero; + cube_t ret = ZERO_CUBE; compose_corners_inplace(c1, c2, &ret); @@ -100,7 +100,7 @@ compose_corners(cube_t c1, cube_t c2) STATIC_INLINE cube_t compose(cube_t c1, cube_t c2) { - cube_t ret = zero; + cube_t ret = ZERO_CUBE; compose_edges_inplace(c1, c2, &ret); compose_corners_inplace(c1, c2, &ret); @@ -244,7 +244,7 @@ invcoord_esep(int64_t esep) { cube_t ret; - ret = solved; + ret = SOLVED_CUBE; invcoord_esep_array(esep % 70, esep / 70, ret.edge); return ret; -- cgit v1.3