aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-05-26 11:14:22 +0100
committergingerBill <bill@gingerbill.org>2022-05-26 11:14:22 +0100
commit7ec0236fbf55939ef46662a732b00908730f826b (patch)
tree5ca74a442892c211c334d3d1d91eb242aeb3dafe /src/check_builtin.cpp
parent0fd43c1a0b697ea919efdeef42427694f32692bf (diff)
Add `simd_reverse`
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index 74c28f4d2..edf84b152 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -912,6 +912,19 @@ bool check_builtin_simd_operation(CheckerContext *c, Operand *operand, Ast *call
return true;
}
+ case BuiltinProc_simd_reverse:
+ {
+ Operand x = {};
+ check_expr(c, &x, ce->args[0]); if (x.mode == Addressing_Invalid) { return false; }
+
+ if (!is_type_simd_vector(x.type)) {
+ error(x.expr, "'%.*s' expected a simd vector type", LIT(builtin_name));
+ return false;
+ }
+ operand->type = x.type;
+ operand->mode = Addressing_Value;
+ return true;
+ }
default:
GB_PANIC("Unhandled simd intrinsic: %.*s", LIT(builtin_name));