aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-05-25 23:49:23 +0100
committergingerBill <bill@gingerbill.org>2022-05-25 23:49:23 +0100
commitc2f5cbdeb48e49d25dc75c1fcc02ce688dc85e26 (patch)
tree1839596edc93ac35f118c3dc3fa05dbb438cfc77 /src/check_builtin.cpp
parent8e57511ffa58e9198ceab9e0e458ce6f132d37d1 (diff)
Allow integer vectors in select
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index eaf71fdab..add719280 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -824,8 +824,11 @@ bool check_builtin_simd_operation(CheckerContext *c, Operand *operand, Ast *call
error(cond.expr, "'%.*s' expected a simd vector boolean type", LIT(builtin_name));
return false;
}
- if (!is_type_boolean(base_array_type(cond.type))) {
- error(cond.expr, "'%.*s' expected a simd vector boolean type", LIT(builtin_name));
+ Type *cond_elem = base_array_type(cond.type);
+ if (!is_type_boolean(cond_elem) && !is_type_integer(cond_elem)) {
+ gbString cond_str = type_to_string(cond.type);
+ error(cond.expr, "'%.*s' expected a simd vector boolean or integer type, got '%s'", LIT(builtin_name), cond_str);
+ gb_string_free(cond_str);
return false;
}