diff options
| author | gingerBill <bill@gingerbill.org> | 2021-02-23 20:39:59 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-02-23 20:39:59 +0000 |
| commit | 79eb46bce3ab28336a8e44bcff78d71fa6287820 (patch) | |
| tree | 90a0c66523c389f165c051aaabc8568434eec332 | |
| parent | 533dde464848d8774e55e2fd9e267096c5af5d00 (diff) | |
Replace `inline` uses in the rest of core with `#force_inline`
| -rw-r--r-- | core/math/linalg/extended.odin | 32 | ||||
| -rw-r--r-- | core/runtime/dynamic_map_internal.odin | 32 | ||||
| -rw-r--r-- | core/slice/ptr.odin | 2 |
3 files changed, 33 insertions, 33 deletions
diff --git a/core/math/linalg/extended.odin b/core/math/linalg/extended.odin index e9c5ef77e..86b803725 100644 --- a/core/math/linalg/extended.odin +++ b/core/math/linalg/extended.odin @@ -114,10 +114,10 @@ abs :: proc(a: $T) -> (out: T) where IS_NUMERIC(ELEM_TYPE(T)) { sign :: proc(a: $T) -> (out: T) where IS_NUMERIC(ELEM_TYPE(T)) { when IS_ARRAY(T) { for i in 0..<len(T) { - out[i] = inline math.sign(a[i]); + out[i] = #force_inline math.sign(a[i]); } } else { - out = inline math.sign(a); + out = #force_inline math.sign(a); } return; } @@ -376,10 +376,10 @@ pow :: proc(x, e: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { ceil :: proc(x: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { when IS_ARRAY(T) { for i in 0..<len(T) { - out[i] = inline math.ceil(x[i]); + out[i] = #force_inline math.ceil(x[i]); } } else { - out = inline math.ceil(x); + out = #force_inline math.ceil(x); } return; } @@ -387,10 +387,10 @@ ceil :: proc(x: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { floor :: proc(x: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { when IS_ARRAY(T) { for i in 0..<len(T) { - out[i] = inline math.floor(x[i]); + out[i] = #force_inline math.floor(x[i]); } } else { - out = inline math.floor(x); + out = #force_inline math.floor(x); } return; } @@ -398,21 +398,21 @@ floor :: proc(x: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { round :: proc(x: $T) -> (out: T) where IS_FLOAT(ELEM_TYPE(T)) { when IS_ARRAY(T) { for i in 0..<len(T) { - out[i] = inline math.round(x[i]); + out[i] = #force_inline math.round(x[i]); } } else { - out = inline math.round(x); + out = #force_inline math.round(x); } return; } fract :: proc(x: $T) -> T where IS_FLOAT(ELEM_TYPE(T)) { - f := inline floor(x); + f := #force_inline floor(x); return x - f; } mod :: proc(x, m: $T) -> T where IS_FLOAT(ELEM_TYPE(T)) { - f := inline floor(x / m); + f := #force_inline floor(x / m); return x - f * m; } @@ -441,34 +441,34 @@ refract :: proc(I, N: $T) -> (out: T) where IS_ARRAY(T), IS_FLOAT(ELEM_TYPE(T)) is_nan_single :: proc(x: $T) -> bool where IS_FLOAT(T) { - return inline math.is_nan(x); + return #force_inline math.is_nan(x); } is_nan_array :: proc(x: $A/[$N]$T) -> (out: [N]bool) where IS_FLOAT(T) { for i in 0..<N { - out[i] = inline is_nan(x[i]); + out[i] = #force_inline is_nan(x[i]); } return; } is_inf_single :: proc(x: $T) -> bool where IS_FLOAT(T) { - return inline math.is_inf(x); + return #force_inline math.is_inf(x); } is_inf_array :: proc(x: $A/[$N]$T) -> (out: [N]bool) where IS_FLOAT(T) { for i in 0..<N { - out[i] = inline is_inf(x[i]); + out[i] = #force_inline is_inf(x[i]); } return; } classify_single :: proc(x: $T) -> math.Float_Class where IS_FLOAT(T) { - return inline math.classify(x); + return #force_inline math.classify(x); } classify_array :: proc(x: $A/[$N]$T) -> (out: [N]math.Float_Class) where IS_FLOAT(T) { for i in 0..<N { - out[i] = inline classify_single(x[i]); + out[i] = #force_inline classify_single(x[i]); } return; } diff --git a/core/runtime/dynamic_map_internal.odin b/core/runtime/dynamic_map_internal.odin index 4c3c3929f..824d2ce61 100644 --- a/core/runtime/dynamic_map_internal.odin +++ b/core/runtime/dynamic_map_internal.odin @@ -101,22 +101,22 @@ default_hasher_n :: #force_inline proc "contextless" (data: rawptr, seed: uintpt // NOTE(bill): There are loads of predefined ones to improve optimizations for small types -default_hasher1 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 1); } -default_hasher2 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 2); } -default_hasher3 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 3); } -default_hasher4 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 4); } -default_hasher5 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 5); } -default_hasher6 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 6); } -default_hasher7 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 7); } -default_hasher8 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 8); } -default_hasher9 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 9); } -default_hasher10 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 10); } -default_hasher11 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 11); } -default_hasher12 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 12); } -default_hasher13 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 13); } -default_hasher14 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 14); } -default_hasher15 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 15); } -default_hasher16 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return inline _default_hasher_const(data, seed, 16); } +default_hasher1 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 1); } +default_hasher2 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 2); } +default_hasher3 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 3); } +default_hasher4 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 4); } +default_hasher5 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 5); } +default_hasher6 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 6); } +default_hasher7 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 7); } +default_hasher8 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 8); } +default_hasher9 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 9); } +default_hasher10 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 10); } +default_hasher11 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 11); } +default_hasher12 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 12); } +default_hasher13 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 13); } +default_hasher14 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 14); } +default_hasher15 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 15); } +default_hasher16 :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { return #force_inline _default_hasher_const(data, seed, 16); } default_hasher_string :: proc "contextless" (data: rawptr, seed: uintptr) -> uintptr { h := u64(seed) + 0xcbf29ce484222325; diff --git a/core/slice/ptr.odin b/core/slice/ptr.odin index defd144fa..a63272818 100644 --- a/core/slice/ptr.odin +++ b/core/slice/ptr.odin @@ -6,7 +6,7 @@ ptr_add :: proc(p: $P/^$T, x: int) -> ^T { return (^T)(uintptr(p) + size_of(T)*x); } ptr_sub :: proc(p: $P/^$T, x: int) -> ^T { - return inline ptr_add(p, -x); + return #force_inline ptr_add(p, -x); } ptr_swap_non_overlapping :: proc(x, y: rawptr, len: int) { |