mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
constant_truncate -> constant_trunc to be consistent with other intrinsics
This commit is contained in:
@@ -244,10 +244,10 @@ constant_utf16_cstring :: proc($literal: string) -> [^]u16 ---
|
|||||||
|
|
||||||
constant_log2 :: proc($v: $T) -> T where type_is_integer(T) ---
|
constant_log2 :: proc($v: $T) -> T where type_is_integer(T) ---
|
||||||
|
|
||||||
constant_floor :: proc($v: $T) -> T where type_is_integer(T) || type_is_float(T) ---
|
constant_floor :: proc($v: $T) -> T where type_is_integer(T) || type_is_float(T) ---
|
||||||
constant_truncate :: proc($v: $T) -> T where type_is_integer(T) || type_is_float(T) ---
|
constant_trunc :: proc($v: $T) -> T where type_is_integer(T) || type_is_float(T) ---
|
||||||
constant_ceil :: proc($v: $T) -> T where type_is_integer(T) || type_is_float(T) ---
|
constant_ceil :: proc($v: $T) -> T where type_is_integer(T) || type_is_float(T) ---
|
||||||
constant_round :: proc($v: $T) -> T where type_is_integer(T) || type_is_float(T) ---
|
constant_round :: proc($v: $T) -> T where type_is_integer(T) || type_is_float(T) ---
|
||||||
|
|
||||||
// SIMD related
|
// SIMD related
|
||||||
simd_add :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
simd_add :: proc(a, b: #simd[N]T) -> #simd[N]T ---
|
||||||
|
|||||||
@@ -4769,7 +4769,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
}
|
}
|
||||||
|
|
||||||
case BuiltinProc_constant_floor:
|
case BuiltinProc_constant_floor:
|
||||||
case BuiltinProc_constant_truncate:
|
case BuiltinProc_constant_trunc:
|
||||||
case BuiltinProc_constant_ceil:
|
case BuiltinProc_constant_ceil:
|
||||||
case BuiltinProc_constant_round:
|
case BuiltinProc_constant_round:
|
||||||
{
|
{
|
||||||
@@ -4789,10 +4789,10 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
} else if (value.kind == ExactValue_Float) {
|
} else if (value.kind == ExactValue_Float) {
|
||||||
f64 f = value.value_float;
|
f64 f = value.value_float;
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case BuiltinProc_constant_floor: f = floor(f); break;
|
case BuiltinProc_constant_floor: f = floor(f); break;
|
||||||
case BuiltinProc_constant_truncate: f = trunc(f); break;
|
case BuiltinProc_constant_trunc: f = trunc(f); break;
|
||||||
case BuiltinProc_constant_ceil: f = ceil(f); break;
|
case BuiltinProc_constant_ceil: f = ceil(f); break;
|
||||||
case BuiltinProc_constant_round: f = round(f); break;
|
case BuiltinProc_constant_round: f = round(f); break;
|
||||||
default:
|
default:
|
||||||
GB_PANIC("Unhandled built-in: %.*s", LIT(builtin_name));
|
GB_PANIC("Unhandled built-in: %.*s", LIT(builtin_name));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ enum BuiltinProcId {
|
|||||||
BuiltinProc_constant_log2,
|
BuiltinProc_constant_log2,
|
||||||
|
|
||||||
BuiltinProc_constant_floor,
|
BuiltinProc_constant_floor,
|
||||||
BuiltinProc_constant_truncate,
|
BuiltinProc_constant_trunc,
|
||||||
BuiltinProc_constant_ceil,
|
BuiltinProc_constant_ceil,
|
||||||
BuiltinProc_constant_round,
|
BuiltinProc_constant_round,
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ gb_global BuiltinProc builtin_procs[BuiltinProc_COUNT] = {
|
|||||||
|
|
||||||
{STR_LIT("constant_log2"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
{STR_LIT("constant_log2"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
||||||
{STR_LIT("constant_floor"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
{STR_LIT("constant_floor"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
||||||
{STR_LIT("constant_truncate"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
{STR_LIT("constant_trunc"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
||||||
{STR_LIT("constant_ceil"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
{STR_LIT("constant_ceil"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
||||||
{STR_LIT("constant_round"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
{STR_LIT("constant_round"), 1, false, Expr_Expr, BuiltinProcPkg_intrinsics},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user