diff --git a/include/kernel_float/base.h b/include/kernel_float/base.h index b3edb20..49f15a9 100644 --- a/include/kernel_float/base.h +++ b/include/kernel_float/base.h @@ -21,126 +21,42 @@ struct alignas(Alignment) aligned_array { T items_[N] = {}; }; -template -struct aligned_array { - KERNEL_FLOAT_INLINE - T* data() { - while (true) - ; - } - - KERNEL_FLOAT_INLINE - const T* data() const { - while (true) - ; - } -}; - template struct alignas(Alignment) aligned_array { KERNEL_FLOAT_INLINE - aligned_array(T value = {}) : x(value) {} + aligned_array(T item = {}) : item_(item) {} KERNEL_FLOAT_INLINE operator T() const { - return x; - } - - KERNEL_FLOAT_INLINE - T* data() { - return &x; - } - - KERNEL_FLOAT_INLINE - const T* data() const { - return &x; - } - - T x; -}; - -template -struct alignas(Alignment) aligned_array { - KERNEL_FLOAT_INLINE - aligned_array(T x, T y) : x(x), y(y) {} - - KERNEL_FLOAT_INLINE - aligned_array() : aligned_array(T {}, T {}) {} - - KERNEL_FLOAT_INLINE - T* data() { - return items; + return item_; } - KERNEL_FLOAT_INLINE - const T* data() const { - return items; - } - - union { - T items[2]; - struct { - T x; - T y; - }; - }; -}; - -template -struct alignas(Alignment) aligned_array { - KERNEL_FLOAT_INLINE - aligned_array(T x, T y, T z) : x(x), y(y), z(z) {} - - KERNEL_FLOAT_INLINE - aligned_array() : aligned_array(T {}, T {}, T {}) {} - KERNEL_FLOAT_INLINE T* data() { - return items; + return &item_; } KERNEL_FLOAT_INLINE const T* data() const { - return items; + return &item_; } - union { - T items[3]; - struct { - T x; - T y; - T z; - }; - }; + T item_ = {}; }; template -struct alignas(Alignment) aligned_array { - KERNEL_FLOAT_INLINE - aligned_array(T x, T y, T z, T w) : x(x), y(y), z(z), w(w) {} - - KERNEL_FLOAT_INLINE - aligned_array() : aligned_array(T {}, T {}, T {}, T {}) {} - +struct aligned_array { KERNEL_FLOAT_INLINE T* data() { - return items; + while (true) + ; } KERNEL_FLOAT_INLINE const T* data() const { - return items; + while (true) + ; } - - union { - T items[4]; - struct { - T x; - T y; - T z; - T w; - }; - }; }; KERNEL_FLOAT_INLINE diff --git a/single_include/kernel_float.h b/single_include/kernel_float.h index fb02c84..37e3c1d 100644 --- a/single_include/kernel_float.h +++ b/single_include/kernel_float.h @@ -16,8 +16,8 @@ //================================================================================ // this file has been auto-generated, do not modify its contents! -// date: 2023-09-28 12:12:55.542179 -// git hash: 0ae5853b782118d9842541588429b4aec7ff186a +// date: 2023-10-06 16:02:20.461619 +// git hash: d578b7a87ead79baf78e181e8fbe14c03ea3f9a6 //================================================================================ #ifndef KERNEL_FLOAT_MACROS_H @@ -365,126 +365,42 @@ struct alignas(Alignment) aligned_array { T items_[N] = {}; }; -template -struct aligned_array { - KERNEL_FLOAT_INLINE - T* data() { - while (true) - ; - } - - KERNEL_FLOAT_INLINE - const T* data() const { - while (true) - ; - } -}; - template struct alignas(Alignment) aligned_array { KERNEL_FLOAT_INLINE - aligned_array(T value = {}) : x(value) {} + aligned_array(T item = {}) : item_(item) {} KERNEL_FLOAT_INLINE operator T() const { - return x; + return item_; } KERNEL_FLOAT_INLINE T* data() { - return &x; + return &item_; } KERNEL_FLOAT_INLINE const T* data() const { - return &x; + return &item_; } - T x; + T item_ = {}; }; template -struct alignas(Alignment) aligned_array { - KERNEL_FLOAT_INLINE - aligned_array(T x, T y) : x(x), y(y) {} - - KERNEL_FLOAT_INLINE - aligned_array() : aligned_array(T {}, T {}) {} - - KERNEL_FLOAT_INLINE - T* data() { - return items; - } - - KERNEL_FLOAT_INLINE - const T* data() const { - return items; - } - - union { - T items[2]; - struct { - T x; - T y; - }; - }; -}; - -template -struct alignas(Alignment) aligned_array { - KERNEL_FLOAT_INLINE - aligned_array(T x, T y, T z) : x(x), y(y), z(z) {} - - KERNEL_FLOAT_INLINE - aligned_array() : aligned_array(T {}, T {}, T {}) {} - - KERNEL_FLOAT_INLINE - T* data() { - return items; - } - - KERNEL_FLOAT_INLINE - const T* data() const { - return items; - } - - union { - T items[3]; - struct { - T x; - T y; - T z; - }; - }; -}; - -template -struct alignas(Alignment) aligned_array { - KERNEL_FLOAT_INLINE - aligned_array(T x, T y, T z, T w) : x(x), y(y), z(z), w(w) {} - - KERNEL_FLOAT_INLINE - aligned_array() : aligned_array(T {}, T {}, T {}, T {}) {} - +struct aligned_array { KERNEL_FLOAT_INLINE T* data() { - return items; + while (true) + ; } KERNEL_FLOAT_INLINE const T* data() const { - return items; + while (true) + ; } - - union { - T items[4]; - struct { - T x; - T y; - T z; - T w; - }; - }; }; KERNEL_FLOAT_INLINE