Mercurial > vec
changeset 1:1d9d2308c1d2
*: fixup formatting
ew
author | Paper <paper@tflc.us> |
---|---|
date | Tue, 22 Oct 2024 01:28:48 -0400 |
parents | 02a517e4c492 |
children | f12b5dd4e18c |
files | include/vec/impl/gcc.h include/vec/impl/generic.h |
diffstat | 2 files changed, 16 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/include/vec/impl/gcc.h Tue Oct 22 01:22:41 2024 -0400 +++ b/include/vec/impl/gcc.h Tue Oct 22 01:28:48 2024 -0400 @@ -30,8 +30,8 @@ #define VEC_DEFINE_OPERATIONS(sign, bits, size) \ static inline VEC_ALWAYS_INLINE v##sign##int##bits##x##size v##sign##int##bits##x##size##_splat(sign##int##bits##_t x) \ { \ - v##sign##int##bits##x##size vec; \ - for (int i = 0; i < size; i++) vec[i] = x; \ + v##sign##int##bits##x##size vec; \ + for (int i = 0; i < size; i++) vec[i] = x; \ return vec; \ } \ \
--- a/include/vec/impl/generic.h Tue Oct 22 01:22:41 2024 -0400 +++ b/include/vec/impl/generic.h Tue Oct 22 01:28:48 2024 -0400 @@ -28,48 +28,48 @@ #include <string.h> #define VEC_DEFINE_STRUCT(sign, bits, size) \ - typedef struct { \ - sign##int##bits##_t arr[size]; \ - } v##sign##int##bits##x##size; + typedef struct { \ + sign##int##bits##_t arr[size]; \ + } v##sign##int##bits##x##size; #define VEC_DEFINE_OPERATIONS(sign, bits, size) \ static inline VEC_ALWAYS_INLINE v##sign##int##bits##x##size v ## sign ## int ## bits ## x ## size ## _splat(sign ## int ## bits ## _t x) \ { \ - v##sign##int##bits##x##size vec; \ - for (int i = 0; i < size; i++) vec.arr[i] = x; \ + v##sign##int##bits##x##size vec; \ + for (int i = 0; i < size; i++) vec.arr[i] = x; \ return vec; \ } \ \ static inline VEC_ALWAYS_INLINE v ## sign ## int ## bits ## x ## size v ## sign ## int ## bits ## x ## size ## _load(const sign ## int ## bits ## _t in[size]) \ { \ - v##sign##int##bits##x##size vec; \ - memcpy(vec.arr, in, sizeof(vec.arr)); \ + v##sign##int##bits##x##size vec; \ + memcpy(vec.arr, in, sizeof(vec.arr)); \ return vec; \ } \ \ static inline VEC_ALWAYS_INLINE void v ## sign ## int ## bits ## x ## size ## _store(v ## sign ## int ## bits ## x ## size vec, sign ## int ## bits ## _t out[size]) \ { \ - memcpy(out, vec.arr, sizeof(vec.arr)); \ + memcpy(out, vec.arr, sizeof(vec.arr)); \ } \ \ static inline VEC_ALWAYS_INLINE v ## sign ## int ## bits ## x ## size v ## sign ## int ## bits ## x ## size ## _add(v ## sign ## int ## bits ## x ## size vec1, v ## sign ## int ## bits ## x ## size vec2) \ { \ - v##sign##int##bits##x##size vec; \ - for (int i = 0; i < size; i++) vec.arr[i] = vec1.arr[i] + vec2.arr[i]; \ + v##sign##int##bits##x##size vec; \ + for (int i = 0; i < size; i++) vec.arr[i] = vec1.arr[i] + vec2.arr[i]; \ return vec; \ } \ \ static inline VEC_ALWAYS_INLINE v ## sign ## int ## bits ## x ## size v ## sign ## int ## bits ## x ## size ## _sub(v ## sign ## int ## bits ## x ## size vec1, v ## sign ## int ## bits ## x ## size vec2) \ { \ - v##sign##int##bits##x##size vec; \ - for (int i = 0; i < size; i++) vec.arr[i] = vec1.arr[i] - vec2.arr[i]; \ + v##sign##int##bits##x##size vec; \ + for (int i = 0; i < size; i++) vec.arr[i] = vec1.arr[i] - vec2.arr[i]; \ return vec; \ } \ \ static inline VEC_ALWAYS_INLINE v ## sign ## int ## bits ## x ## size v ## sign ## int ## bits ## x ## size ## _mul(v ## sign ## int ## bits ## x ## size vec1, v ## sign ## int ## bits ## x ## size vec2) \ { \ - v##sign##int##bits##x##size vec; \ - for (int i = 0; i < size; i++) vec.arr[i] = vec1.arr[i] * vec2.arr[i]; \ + v##sign##int##bits##x##size vec; \ + for (int i = 0; i < size; i++) vec.arr[i] = vec1.arr[i] * vec2.arr[i]; \ return vec; \ }