aboutsummaryrefslogtreecommitdiff
path: root/cbits
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-11-15 11:12:57 +0100
committerTom Smeding <tom@tomsmeding.com>2025-11-15 11:13:10 +0100
commitad3f44c8b170298e63b8b57ee02cb88fbbd210fc (patch)
tree60d4457b26640cb3dd016d3ac419f654ecf06a8e /cbits
parent11db054607e476c68be5681d99d96630642637e6 (diff)
arith: Support Int8 and Int16
Diffstat (limited to 'cbits')
-rw-r--r--cbits/arith.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cbits/arith.c b/cbits/arith.c
index f19b01e..1066463 100644
--- a/cbits/arith.c
+++ b/cbits/arith.c
@@ -20,6 +20,8 @@
// Shorter names, due to CPP used both in function names and in C types.
+typedef int8_t i8;
+typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;
@@ -248,6 +250,8 @@ void oxarrays_stats_print_all(void) {
#define GEN_ABS(x) \
_Generic((x), \
+ i8: abs, \
+ i16: abs, \
int: abs, \
long: labs, \
long long: llabs, \
@@ -738,7 +742,7 @@ enum redop_tag_t {
* Generate all the functions *
*****************************************************************************/
-#define INT_TYPES_XLIST X(i32) X(i64)
+#define INT_TYPES_XLIST X(i8) X(i16) X(i32) X(i64)
#define FLOAT_TYPES_XLIST X(double) X(float)
#define NUM_TYPES_XLIST INT_TYPES_XLIST FLOAT_TYPES_XLIST