diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-04 12:02:56 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-04-04 12:02:56 +0200 |
| commit | e6be287bbfa6beda038ec8b085300c5dc9c2ecd8 (patch) | |
| tree | 55d0acb9efde811985157068f3656514b90344cf /src/arch | |
| parent | 2ac46cb4d4133e5d5de90bacfc9b6e979d1d6046 (diff) | |
| download | nissy-core-e6be287bbfa6beda038ec8b085300c5dc9c2ecd8.tar.gz nissy-core-e6be287bbfa6beda038ec8b085300c5dc9c2ecd8.zip | |
Use macro for [static N]
Diffstat (limited to 'src/arch')
| -rw-r--r-- | src/arch/avx2.h | 10 | ||||
| -rw-r--r-- | src/arch/common.h | 14 | ||||
| -rw-r--r-- | src/arch/neon.h | 10 | ||||
| -rw-r--r-- | src/arch/portable.h | 10 |
4 files changed, 22 insertions, 22 deletions
diff --git a/src/arch/avx2.h b/src/arch/avx2.h index b80b0fb..7d8deef 100644 --- a/src/arch/avx2.h +++ b/src/arch/avx2.h | |||
| @@ -35,7 +35,7 @@ popcount_u32(uint32_t x) | |||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | STATIC void | 37 | STATIC void |
| 38 | pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) | 38 | pieces(cube_t cube[NON_NULL], uint8_t c[SIZE(8)], uint8_t e[SIZE(12)]) |
| 39 | { | 39 | { |
| 40 | uint8_t aux[32]; | 40 | uint8_t aux[32]; |
| 41 | 41 | ||
| @@ -161,7 +161,7 @@ coord_co(cube_t c) | |||
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | STATIC_INLINE void | 163 | STATIC_INLINE void |
| 164 | copy_co(cube_t cube[static 1], cube_t co) | 164 | copy_co(cube_t cube[NON_NULL], cube_t co) |
| 165 | { | 165 | { |
| 166 | cube_t coclean; | 166 | cube_t coclean; |
| 167 | 167 | ||
| @@ -268,19 +268,19 @@ invcoord_esep(uint64_t esep) | |||
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | STATIC_INLINE void | 270 | STATIC_INLINE void |
| 271 | copy_corners(cube_t dest[static 1], cube_t src) | 271 | copy_corners(cube_t dest[NON_NULL], cube_t src) |
| 272 | { | 272 | { |
| 273 | *dest = _mm256_blend_epi32(*dest, src, 0x0F); | 273 | *dest = _mm256_blend_epi32(*dest, src, 0x0F); |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | STATIC_INLINE void | 276 | STATIC_INLINE void |
| 277 | copy_edges(cube_t dest[static 1], cube_t src) | 277 | copy_edges(cube_t dest[NON_NULL], cube_t src) |
| 278 | { | 278 | { |
| 279 | *dest = _mm256_blend_epi32(*dest, src, 0xF0); | 279 | *dest = _mm256_blend_epi32(*dest, src, 0xF0); |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | STATIC_INLINE void | 282 | STATIC_INLINE void |
| 283 | set_eo(cube_t cube[static 1], uint64_t eo) | 283 | set_eo(cube_t cube[NON_NULL], uint64_t eo) |
| 284 | { | 284 | { |
| 285 | uint64_t eo12, eotop, eobot; | 285 | uint64_t eo12, eotop, eobot; |
| 286 | __m256i veo; | 286 | __m256i veo; |
diff --git a/src/arch/common.h b/src/arch/common.h index 4412562..2a83fbf 100644 --- a/src/arch/common.h +++ b/src/arch/common.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | STATIC_INLINE int popcount_u32(uint32_t); | 15 | STATIC_INLINE int popcount_u32(uint32_t); |
| 16 | 16 | ||
| 17 | STATIC void pieces(cube_t [static 1], uint8_t [static 8], uint8_t [static 12]); | 17 | STATIC void pieces(cube_t [NON_NULL], uint8_t [SIZE(8)], uint8_t [SIZE(12)]); |
| 18 | STATIC_INLINE bool equal(cube_t, cube_t); | 18 | STATIC_INLINE bool equal(cube_t, cube_t); |
| 19 | STATIC_INLINE cube_t invertco(cube_t); | 19 | STATIC_INLINE cube_t invertco(cube_t); |
| 20 | STATIC_INLINE cube_t compose_edges(cube_t, cube_t); | 20 | STATIC_INLINE cube_t compose_edges(cube_t, cube_t); |
| @@ -34,12 +34,12 @@ STATIC_INLINE cube_t invcoord_epudsep(uint64_t); | |||
| 34 | 34 | ||
| 35 | STATIC_INLINE bool is_eo_even(cube_t); | 35 | STATIC_INLINE bool is_eo_even(cube_t); |
| 36 | 36 | ||
| 37 | STATIC_INLINE void copy_corners(cube_t [static 1], cube_t); | 37 | STATIC_INLINE void copy_corners(cube_t [NON_NULL], cube_t); |
| 38 | STATIC_INLINE void copy_co(cube_t [static 1], cube_t); | 38 | STATIC_INLINE void copy_co(cube_t [NON_NULL], cube_t); |
| 39 | STATIC_INLINE void copy_edges(cube_t [static 1], cube_t); | 39 | STATIC_INLINE void copy_edges(cube_t [NON_NULL], cube_t); |
| 40 | STATIC_INLINE void set_eo(cube_t [static 1], uint64_t); | 40 | STATIC_INLINE void set_eo(cube_t [NON_NULL], uint64_t); |
| 41 | 41 | ||
| 42 | STATIC_INLINE void invcoord_esep_array(uint64_t, uint64_t, uint8_t[static 12]); | 42 | STATIC_INLINE void invcoord_esep_array(uint64_t, uint64_t, uint8_t[SIZE(12)]); |
| 43 | STATIC_INLINE cube_t invcoord_eoesep(uint64_t); | 43 | STATIC_INLINE cube_t invcoord_eoesep(uint64_t); |
| 44 | STATIC_INLINE uint64_t coord_epudsep_array(const uint8_t [8]); | 44 | STATIC_INLINE uint64_t coord_epudsep_array(const uint8_t [8]); |
| 45 | STATIC_INLINE void invcoord_epudsep_array(uint64_t, uint8_t [8]); | 45 | STATIC_INLINE void invcoord_epudsep_array(uint64_t, uint8_t [8]); |
| @@ -52,7 +52,7 @@ STATIC_INLINE uint64_t coord_epe(cube_t); | |||
| 52 | STATIC_INLINE cube_t invcoord_epe(uint64_t); | 52 | STATIC_INLINE cube_t invcoord_epe(uint64_t); |
| 53 | 53 | ||
| 54 | STATIC_INLINE void | 54 | STATIC_INLINE void |
| 55 | invcoord_esep_array(uint64_t set1, uint64_t set2, uint8_t mem[static 12]) | 55 | invcoord_esep_array(uint64_t set1, uint64_t set2, uint8_t mem[SIZE(12)]) |
| 56 | { | 56 | { |
| 57 | uint64_t bit1, bit2, i, j, jj, k, l, s, v, w, is1; | 57 | uint64_t bit1, bit2, i, j, jj, k, l, s, v, w, is1; |
| 58 | uint8_t slice[3] = {0}; | 58 | uint8_t slice[3] = {0}; |
diff --git a/src/arch/neon.h b/src/arch/neon.h index f997813..1157938 100644 --- a/src/arch/neon.h +++ b/src/arch/neon.h | |||
| @@ -48,7 +48,7 @@ popcount_u32(uint32_t x) | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | STATIC void | 50 | STATIC void |
| 51 | pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) | 51 | pieces(cube_t cube[NON_NULL], uint8_t c[SIZE(8)], uint8_t e[SIZE(12)]) |
| 52 | { | 52 | { |
| 53 | // First 8 bytes of the corner vector are copied from the c array | 53 | // First 8 bytes of the corner vector are copied from the c array |
| 54 | vst1_u8(c, cube->corner); | 54 | vst1_u8(c, cube->corner); |
| @@ -233,7 +233,7 @@ coord_co(cube_t c) | |||
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | STATIC_INLINE void | 235 | STATIC_INLINE void |
| 236 | copy_co(cube_t cube[static 1], cube_t co) | 236 | copy_co(cube_t cube[NON_NULL], cube_t co) |
| 237 | { | 237 | { |
| 238 | uint8x8_t coclean; | 238 | uint8x8_t coclean; |
| 239 | 239 | ||
| @@ -329,19 +329,19 @@ coord_esep(cube_t c) | |||
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | STATIC_INLINE void | 331 | STATIC_INLINE void |
| 332 | copy_corners(cube_t dst[static 1], cube_t src) | 332 | copy_corners(cube_t dst[NON_NULL], cube_t src) |
| 333 | { | 333 | { |
| 334 | dst->corner = src.corner; | 334 | dst->corner = src.corner; |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | STATIC_INLINE void | 337 | STATIC_INLINE void |
| 338 | copy_edges(cube_t dst[static 1], cube_t src) | 338 | copy_edges(cube_t dst[NON_NULL], cube_t src) |
| 339 | { | 339 | { |
| 340 | dst->edge = src.edge; | 340 | dst->edge = src.edge; |
| 341 | } | 341 | } |
| 342 | 342 | ||
| 343 | STATIC_INLINE void | 343 | STATIC_INLINE void |
| 344 | set_eo(cube_t cube[static 1], uint64_t eo) | 344 | set_eo(cube_t cube[NON_NULL], uint64_t eo) |
| 345 | { | 345 | { |
| 346 | // Temp array to store the NEON vector | 346 | // Temp array to store the NEON vector |
| 347 | uint8_t mem[16]; | 347 | uint8_t mem[16]; |
diff --git a/src/arch/portable.h b/src/arch/portable.h index 4b66fb6..311d427 100644 --- a/src/arch/portable.h +++ b/src/arch/portable.h | |||
| @@ -35,7 +35,7 @@ popcount_u32(uint32_t x) | |||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | STATIC void | 37 | STATIC void |
| 38 | pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) | 38 | pieces(cube_t cube[NON_NULL], uint8_t c[SIZE(8)], uint8_t e[SIZE(12)]) |
| 39 | { | 39 | { |
| 40 | memcpy(c, cube->corner, 8); | 40 | memcpy(c, cube->corner, 8); |
| 41 | memcpy(e, cube->edge, 12); | 41 | memcpy(e, cube->edge, 12); |
| @@ -155,7 +155,7 @@ inverse(cube_t cube) | |||
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | STATIC_INLINE void | 157 | STATIC_INLINE void |
| 158 | copy_co(cube_t cube[static 1], cube_t co) | 158 | copy_co(cube_t cube[NON_NULL], cube_t co) |
| 159 | { | 159 | { |
| 160 | uint8_t c; | 160 | uint8_t c; |
| 161 | size_t i; | 161 | size_t i; |
| @@ -280,19 +280,19 @@ invcoord_esep(uint64_t esep) | |||
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | STATIC_INLINE void | 282 | STATIC_INLINE void |
| 283 | copy_corners(cube_t dest[static 1], cube_t src) | 283 | copy_corners(cube_t dest[NON_NULL], cube_t src) |
| 284 | { | 284 | { |
| 285 | memcpy(&dest->corner, src.corner, sizeof(src.corner)); | 285 | memcpy(&dest->corner, src.corner, sizeof(src.corner)); |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | STATIC_INLINE void | 288 | STATIC_INLINE void |
| 289 | copy_edges(cube_t dest[static 1], cube_t src) | 289 | copy_edges(cube_t dest[NON_NULL], cube_t src) |
| 290 | { | 290 | { |
| 291 | memcpy(&dest->edge, src.edge, sizeof(src.edge)); | 291 | memcpy(&dest->edge, src.edge, sizeof(src.edge)); |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | STATIC_INLINE void | 294 | STATIC_INLINE void |
| 295 | set_eo(cube_t cube[static 1], uint64_t eo) | 295 | set_eo(cube_t cube[NON_NULL], uint64_t eo) |
| 296 | { | 296 | { |
| 297 | uint8_t i, sum, flip; | 297 | uint8_t i, sum, flip; |
| 298 | 298 | ||
