aboutsummaryrefslogtreecommitdiff
path: root/src/arch/avx2.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-09-05 08:53:38 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-09-05 08:55:25 +0200
commitfd5ddb3db9f50411ca579d84f225f265ca35b56a (patch)
treeb659112cc0e2abd6c7edb08b0938c0d2de4ca066 /src/arch/avx2.h
parentc9e2d6466e42d6b779ac9ffa7c5ee9a9c7558df8 (diff)
downloadnissy-core-fd5ddb3db9f50411ca579d84f225f265ca35b56a.tar.gz
nissy-core-fd5ddb3db9f50411ca579d84f225f265ca35b56a.zip
Rename constants from _underscore to CAPS
Diffstat (limited to 'src/arch/avx2.h')
-rw-r--r--src/arch/avx2.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/arch/avx2.h b/src/arch/avx2.h
index b1a7ab7..8d53f8f 100644
--- a/src/arch/avx2.h
+++ b/src/arch/avx2.h
@@ -16,7 +16,7 @@
16#define solved static_cube( \ 16#define solved static_cube( \
17 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) 17 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
18 18
19_static void 19STATIC void
20pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12]) 20pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
21{ 21{
22 uint8_t aux[32]; 22 uint8_t aux[32];
@@ -26,7 +26,7 @@ pieces(cube_t *cube, uint8_t c[static 8], uint8_t e[static 12])
26 memcpy(e, aux+16, 12); 26 memcpy(e, aux+16, 12);
27} 27}
28 28
29_static_inline bool 29STATIC_INLINE bool
30equal(cube_t c1, cube_t c2) 30equal(cube_t c1, cube_t c2)
31{ 31{
32 int32_t mask; 32 int32_t mask;
@@ -38,7 +38,7 @@ equal(cube_t c1, cube_t c2)
38 return mask == ~0; 38 return mask == ~0;
39} 39}
40 40
41_static_inline cube_t 41STATIC_INLINE cube_t
42invertco(cube_t c) 42invertco(cube_t c)
43{ 43{
44 cube_t co, shleft, shright, summed, newco, cleanco, ret; 44 cube_t co, shleft, shright, summed, newco, cleanco, ret;
@@ -54,7 +54,7 @@ invertco(cube_t c)
54 return ret; 54 return ret;
55} 55}
56 56
57_static_inline cube_t 57STATIC_INLINE cube_t
58compose_epcpeo(cube_t c1, cube_t c2) 58compose_epcpeo(cube_t c1, cube_t c2)
59{ 59{
60 cube_t b, s, eo2; 60 cube_t b, s, eo2;
@@ -74,13 +74,13 @@ compose_epcpeo(cube_t c1, cube_t c2)
74 return s; 74 return s;
75} 75}
76 76
77_static_inline cube_t 77STATIC_INLINE cube_t
78compose_edges(cube_t c1, cube_t c2) 78compose_edges(cube_t c1, cube_t c2)
79{ 79{
80 return compose_epcpeo(c1, c2); 80 return compose_epcpeo(c1, c2);
81} 81}
82 82
83_static_inline cube_t 83STATIC_INLINE cube_t
84compose_corners(cube_t c1, cube_t c2) 84compose_corners(cube_t c1, cube_t c2)
85{ 85{
86 /* 86 /*
@@ -91,7 +91,7 @@ compose_corners(cube_t c1, cube_t c2)
91 return compose(c1, c2); 91 return compose(c1, c2);
92} 92}
93 93
94_static_inline cube_t 94STATIC_INLINE cube_t
95compose(cube_t c1, cube_t c2) 95compose(cube_t c1, cube_t c2)
96{ 96{
97 cube_t s, co1, co2, aux, auy1, auy2, auz1, auz2; 97 cube_t s, co1, co2, aux, auy1, auy2, auz1, auz2;
@@ -114,7 +114,7 @@ compose(cube_t c1, cube_t c2)
114 return s; 114 return s;
115} 115}
116 116
117_static_inline cube_t 117STATIC_INLINE cube_t
118cleanaftershuffle(cube_t c) 118cleanaftershuffle(cube_t c)
119{ 119{
120 __m256i b; 120 __m256i b;
@@ -127,7 +127,7 @@ cleanaftershuffle(cube_t c)
127 return _mm256_andnot_si256(b, c); 127 return _mm256_andnot_si256(b, c);
128} 128}
129 129
130_static_inline cube_t 130STATIC_INLINE cube_t
131inverse(cube_t c) 131inverse(cube_t c)
132{ 132{
133 /* Method taken from Andrew Skalski's vcube[1]. The addition sequence 133 /* Method taken from Andrew Skalski's vcube[1]. The addition sequence
@@ -166,7 +166,7 @@ inverse(cube_t c)
166 return invertco(ret); 166 return invertco(ret);
167} 167}
168 168
169_static_inline int64_t 169STATIC_INLINE int64_t
170coord_co(cube_t c) 170coord_co(cube_t c)
171{ 171{
172 cube_t co; 172 cube_t co;
@@ -182,7 +182,7 @@ coord_co(cube_t c)
182 return ret; 182 return ret;
183} 183}
184 184
185_static_inline int64_t 185STATIC_INLINE int64_t
186coord_csep(cube_t c) 186coord_csep(cube_t c)
187{ 187{
188 cube_t cp, shifted; 188 cube_t cp, shifted;
@@ -195,13 +195,13 @@ coord_csep(cube_t c)
195 return mask & 0x7F; 195 return mask & 0x7F;
196} 196}
197 197
198_static_inline int64_t 198STATIC_INLINE int64_t
199coord_cocsep(cube_t c) 199coord_cocsep(cube_t c)
200{ 200{
201 return (coord_co(c) << 7) + coord_csep(c); 201 return (coord_co(c) << 7) + coord_csep(c);
202} 202}
203 203
204_static_inline int64_t 204STATIC_INLINE int64_t
205coord_eo(cube_t c) 205coord_eo(cube_t c)
206{ 206{
207 cube_t eo, shifted; 207 cube_t eo, shifted;
@@ -214,7 +214,7 @@ coord_eo(cube_t c)
214 return mask >> 17; 214 return mask >> 17;
215} 215}
216 216
217_static_inline int64_t 217STATIC_INLINE int64_t
218coord_esep(cube_t c) 218coord_esep(cube_t c)
219{ 219{
220 cube_t ep; 220 cube_t ep;
@@ -229,8 +229,8 @@ coord_esep(cube_t c)
229 for (i = 0, j = 0; i < 12; i++, mem[i/8 + 2] >>= 8) { 229 for (i = 0, j = 0; i < 12; i++, mem[i/8 + 2] >>= 8) {
230 e = mem[i/8 + 2]; 230 e = mem[i/8 + 2];
231 231
232 bit1 = (e & _esepbit1) >> 2; 232 bit1 = (e & ESEPBIT_1) >> 2;
233 bit2 = (e & _esepbit2) >> 3; 233 bit2 = (e & ESEPBIT_2) >> 3;
234 is1 = (1 - bit2) * bit1; 234 is1 = (1 - bit2) * bit1;
235 235
236 ret1 += bit2 * binomial[11-i][k]; 236 ret1 += bit2 * binomial[11-i][k];
@@ -245,19 +245,19 @@ coord_esep(cube_t c)
245 return ret1 * 70 + ret2; 245 return ret1 * 70 + ret2;
246} 246}
247 247
248_static_inline void 248STATIC_INLINE void
249copy_corners(cube_t *dest, cube_t src) 249copy_corners(cube_t *dest, cube_t src)
250{ 250{
251 *dest = _mm256_blend_epi32(*dest, src, 0x0F); 251 *dest = _mm256_blend_epi32(*dest, src, 0x0F);
252} 252}
253 253
254_static_inline void 254STATIC_INLINE void
255copy_edges(cube_t *dest, cube_t src) 255copy_edges(cube_t *dest, cube_t src)
256{ 256{
257 *dest = _mm256_blend_epi32(*dest, src, 0xF0); 257 *dest = _mm256_blend_epi32(*dest, src, 0xF0);
258} 258}
259 259
260_static_inline void 260STATIC_INLINE void
261set_eo(cube_t *cube, int64_t eo) 261set_eo(cube_t *cube, int64_t eo)
262{ 262{
263 int64_t eo12, eotop, eobot; 263 int64_t eo12, eotop, eobot;
@@ -282,7 +282,7 @@ set_eo(cube_t *cube, int64_t eo)
282 *cube = _mm256_or_si256(*cube, veo); 282 *cube = _mm256_or_si256(*cube, veo);
283} 283}
284 284
285_static_inline cube_t 285STATIC_INLINE cube_t
286invcoord_esep(int64_t esep) 286invcoord_esep(int64_t esep)
287{ 287{
288 cube_t eee, ret; 288 cube_t eee, ret;

Generated with cgit - Back to sebastiano.tronto.net