Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion include/kernel_float/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@
#define KERNEL_FLOAT_CALL(F, ...) F(__VA_ARGS__)

// TOOD: check if this way is support across all compilers
#if defined(__has_builtin) && __has_builtin(__builtin_assume_aligned) && 0
#if defined(__has_builtin)
#if __has_builtin(__builtin_assume_aligned)
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) \
static_cast<TYPE*>(__builtin_assume_aligned(static_cast<TYPE*>(PTR), (ALIGNMENT)))
#else
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) (PTR)
#endif
#else
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) (PTR)
#endif

#define KERNEL_FLOAT_MAX_ALIGNMENT (32)

Expand Down
10 changes: 7 additions & 3 deletions single_include/kernel_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

//================================================================================
// this file has been auto-generated, do not modify its contents!
// date: 2023-10-24 14:14:37.228322
// git hash: 28f811af866d73bef37acd541bac6a95df9a94c3
// date: 2024-04-26 09:45:38.335903
// git hash: 91f4860ae4ece05ec4d8e198d62d9486efa761db
//================================================================================

#ifndef KERNEL_FLOAT_MACROS_H
Expand Down Expand Up @@ -72,12 +72,16 @@
#define KERNEL_FLOAT_CALL(F, ...) F(__VA_ARGS__)

// TOOD: check if this way is support across all compilers
#if defined(__has_builtin) && __has_builtin(__builtin_assume_aligned) && 0
#if defined(__has_builtin)
#if __has_builtin(__builtin_assume_aligned)
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) \
static_cast<TYPE*>(__builtin_assume_aligned(static_cast<TYPE*>(PTR), (ALIGNMENT)))
#else
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) (PTR)
#endif
#else
#define KERNEL_FLOAT_ASSUME_ALIGNED(TYPE, PTR, ALIGNMENT) (PTR)
#endif

#define KERNEL_FLOAT_MAX_ALIGNMENT (32)

Expand Down