aboutsummaryrefslogtreecommitdiff
path: root/src/arch/neon.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-04-06 15:55:33 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-04-06 15:55:33 +0200
commitfc41f7917531693680b5baf71ffe38c47333fe84 (patch)
treea6e62232e05e7779034c5f9d1bf743b6f1c198e3 /src/arch/neon.h
parentfe534f1497da6447153064d7bba00243000f803b (diff)
downloadnissy-core-fc41f7917531693680b5baf71ffe38c47333fe84.tar.gz
nissy-core-fc41f7917531693680b5baf71ffe38c47333fe84.zip
Make the project build with Microsoft's broken C compiler.
MSVC is not fully C11-compliant, even when compiling with /std:c11. Some changes were needed to make the codebase compatible. Notably, the notation a[static N] and a[n] for function parameters of array type is not supported, so that had to be hidden behind a macro. Atomic types are also an experimental feature, apparently, but at least they work with the correct compiler flag. One thing that MSVC does well, however, is warning on integer conversions on /W4 level. I am not sure if Clang and GCC have something similar, so I took this chance to fix some of these.
Diffstat (limited to 'src/arch/neon.h')
-rw-r--r--src/arch/neon.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/arch/neon.h b/src/arch/neon.h
index 725e589..501b722 100644
--- a/src/arch/neon.h
+++ b/src/arch/neon.h
@@ -59,7 +59,7 @@ popcount_u64(uint64_t x)
59} 59}
60 60
61STATIC void 61STATIC void
62pieces(cube_t cube[static 1], uint8_t c[static 8], uint8_t e[static 12]) 62pieces(cube_t cube[NON_NULL], uint8_t c[SIZE(8)], uint8_t e[SIZE(12)])
63{ 63{
64 // First 8 bytes of the corner vector are copied from the c array 64 // First 8 bytes of the corner vector are copied from the c array
65 vst1_u8(c, cube->corner); 65 vst1_u8(c, cube->corner);
@@ -244,7 +244,7 @@ coord_co(cube_t c)
244} 244}
245 245
246STATIC_INLINE void 246STATIC_INLINE void
247copy_co(cube_t cube[static 1], cube_t co) 247copy_co(cube_t cube[NON_NULL], cube_t co)
248{ 248{
249 uint8x8_t coclean; 249 uint8x8_t coclean;
250 250
@@ -340,19 +340,19 @@ coord_esep(cube_t c)
340} 340}
341 341
342STATIC_INLINE void 342STATIC_INLINE void
343copy_corners(cube_t dst[static 1], cube_t src) 343copy_corners(cube_t dst[NON_NULL], cube_t src)
344{ 344{
345 dst->corner = src.corner; 345 dst->corner = src.corner;
346} 346}
347 347
348STATIC_INLINE void 348STATIC_INLINE void
349copy_edges(cube_t dst[static 1], cube_t src) 349copy_edges(cube_t dst[NON_NULL], cube_t src)
350{ 350{
351 dst->edge = src.edge; 351 dst->edge = src.edge;
352} 352}
353 353
354STATIC_INLINE void 354STATIC_INLINE void
355set_eo(cube_t cube[static 1], uint64_t eo) 355set_eo(cube_t cube[NON_NULL], uint64_t eo)
356{ 356{
357 // Temp array to store the NEON vector 357 // Temp array to store the NEON vector
358 uint8_t mem[16]; 358 uint8_t mem[16];

Generated with cgit - Back to sebastiano.tronto.net