diff crc32i.h @ 3:6483683ac857 default tip

*: add profiling code too; expand x86 to use all eight XMM registers basically ported verbatim from the assembly
author Paper <paper@tflc.us>
date Mon, 09 Feb 2026 21:30:30 -0500
parents 90cb48b87dcc
children
line wrap: on
line diff
--- a/crc32i.h	Mon Feb 09 01:21:00 2026 -0500
+++ b/crc32i.h	Mon Feb 09 21:30:30 2026 -0500
@@ -13,11 +13,22 @@
  * to be destroyed or if it can be cached. */
 #define CRC32_POLYNOMIAL 0xedb88320
 
-/* crc32b.c */
+#if (__STDC_VERSION__ >= 201112L)
+# define CRC32_ALIGN(N) alignas(N)
+#elif defined(__GNUC__)
+# define CRC32_ALIGN(N) __attribute__((__aligned__(N)))
+#elif defined(_MSC_VER)
+# define CRC32_ALIGN(N) __declspec(align(N))
+#else
+# error fuck
+#endif
+
 #ifdef __GNUC__
-# define CRC32_PURE __attribute__((__pure__))
+# define CRC32_FORCEINLINE static inline __attribute__((__always_inline__))
+#elif defined(_MSC_VER)
+# define CRC32_FORCEINLINE static __forceinline
 #else
-# define CRC32_PURE
+# define CRC32_FORCEINLINE static inline
 #endif
 
 #define ALIGNOF(type) offsetof(struct { type a; char b; }, b)