Add simd_reverse

This commit is contained in:
gingerBill
2022-05-26 11:14:22 +01:00
parent 0fd43c1a0b
commit 7ec0236fbf
6 changed files with 39 additions and 0 deletions
+13
View File
@@ -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));