diff options
| author | gingerBill <bill@gingerbill.org> | 2022-06-02 12:10:43 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-06-02 12:10:43 +0100 |
| commit | bb7f291f5fa9d412d5ff15b8de4a46b6ad2704e2 (patch) | |
| tree | ea937bb951f272a956c19661372ff161c3292101 /src/check_builtin.cpp | |
| parent | ba5f7c4e2af5c82c220b7e1796fde2f026ce4208 (diff) | |
Remove `simd_rem`; Disallow `simd_div` for integers
Diffstat (limited to 'src/check_builtin.cpp')
| -rw-r--r-- | src/check_builtin.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index 92e3987a0..8108604ba 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -452,6 +452,13 @@ bool check_builtin_simd_operation(CheckerContext *c, Operand *operand, Ast *call return false; } + if (id == BuiltinProc_simd_div && is_type_integer(elem)) { + gbString xs = type_to_string(x.type); + error(x.expr, "'%.*s' is not supported for integer elements, got '%s'", LIT(builtin_name), xs); + gb_string_free(xs); + // don't return + } + operand->mode = Addressing_Value; operand->type = x.type; return true; @@ -460,7 +467,6 @@ bool check_builtin_simd_operation(CheckerContext *c, Operand *operand, Ast *call // Integer only case BuiltinProc_simd_add_sat: case BuiltinProc_simd_sub_sat: - case BuiltinProc_simd_rem: case BuiltinProc_simd_and: case BuiltinProc_simd_or: case BuiltinProc_simd_xor: @@ -492,7 +498,6 @@ bool check_builtin_simd_operation(CheckerContext *c, Operand *operand, Ast *call switch (id) { case BuiltinProc_simd_add_sat: case BuiltinProc_simd_sub_sat: - case BuiltinProc_simd_rem: if (!is_type_integer(elem)) { gbString xs = type_to_string(x.type); error(x.expr, "'%.*s' expected a #simd type with an integer element, got '%s'", LIT(builtin_name), xs); |