From b33f6ba1b0971f000522c0da044a7011d4df8369 Mon Sep 17 00:00:00 2001 From: Antonino Simone Di Stefano Date: Sat, 21 Sep 2024 00:30:36 +0200 Subject: [PATCH 1/7] Fix type in parameter of atomic_compare_exchange_weak_explicit desited -> desired --- core/c/libc/stdatomic.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/c/libc/stdatomic.odin b/core/c/libc/stdatomic.odin index 8dc243b78..43a0e51df 100644 --- a/core/c/libc/stdatomic.odin +++ b/core/c/libc/stdatomic.odin @@ -235,7 +235,7 @@ atomic_compare_exchange_weak :: #force_inline proc(object, expected: ^$T, desire return ok } -atomic_compare_exchange_weak_explicit :: #force_inline proc(object, expected: ^$T, desited: T, success, failure: memory_order) -> bool { +atomic_compare_exchange_weak_explicit :: #force_inline proc(object, expected: ^$T, desired: T, success, failure: memory_order) -> bool { assert(failure != .release) assert(failure != .acq_rel) From 355f84d0cd8826ddef953b8ab003cfe56078c04b Mon Sep 17 00:00:00 2001 From: Antonino Simone Di Stefano Date: Sat, 21 Sep 2024 00:30:50 +0200 Subject: [PATCH 2/7] Use package qualifier for type_info_base and Type_Info_map --- core/slice/map.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/slice/map.odin b/core/slice/map.odin index 545ba8305..2d16e3ae1 100644 --- a/core/slice/map.odin +++ b/core/slice/map.odin @@ -52,7 +52,7 @@ map_entry_infos :: proc(m: $M/map[$K]$V, allocator := context.allocator) -> (ent m := m rm := (^runtime.Raw_Map)(&m) - info := type_info_base(type_info_of(M)).variant.(Type_Info_Map) + info := runtime.type_info_base(type_info_of(M)).variant.(runtime.Type_Info_Map) if info.map_info != nil { entries = make(type_of(entries), len(m), allocator) or_return From 5a6f7615356136ea7ec0f11e38e7deed532bd7f6 Mon Sep 17 00:00:00 2001 From: Antonino Simone Di Stefano Date: Sun, 22 Sep 2024 23:15:36 +0200 Subject: [PATCH 3/7] Add missing package qualifier to Context --- core/crypto/_chacha20/simd128/chacha20_simd128.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/crypto/_chacha20/simd128/chacha20_simd128.odin b/core/crypto/_chacha20/simd128/chacha20_simd128.odin index 2f91ac52a..fe0d0d518 100644 --- a/core/crypto/_chacha20/simd128/chacha20_simd128.odin +++ b/core/crypto/_chacha20/simd128/chacha20_simd128.odin @@ -51,7 +51,7 @@ _ROT_16: simd.u32x4 : {16, 16, 16, 16} when ODIN_ENDIAN == .Big { @(private = "file") - _increment_counter :: #force_inline proc "contextless" (ctx: ^Context) -> simd.u32x4 { + _increment_counter :: #force_inline proc "contextless" (ctx: ^_chacha20.Context) -> simd.u32x4 { // In the Big Endian case, the low and high portions in the vector // are flipped, so the 64-bit addition can't be done with a simple // vector add. From 3d202da63fc1b4b0d68f80f057c3c1ad827cf298 Mon Sep 17 00:00:00 2001 From: Antonino Simone Di Stefano Date: Sun, 22 Sep 2024 23:15:48 +0200 Subject: [PATCH 4/7] Add missing package qualifier to alloc --- examples/demo/demo.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index 4b761f0e2..0dc30e2c0 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -906,7 +906,7 @@ parametric_polymorphism :: proc() { // This is how `new` is implemented alloc_type :: proc($T: typeid) -> ^T { - t := cast(^T)alloc(size_of(T), align_of(T)) + t := cast(^T)mem.alloc(size_of(T), align_of(T)) t^ = T{} // Use default initialization value return t } From baf5a06fbadc445a4d7bd1a076a8d1a564ff7e45 Mon Sep 17 00:00:00 2001 From: Antonino Simone Di Stefano Date: Sun, 22 Sep 2024 23:16:59 +0200 Subject: [PATCH 5/7] Remove address operator, which lead to a type error --- core/slice/map.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/slice/map.odin b/core/slice/map.odin index 2d16e3ae1..a1b0a8925 100644 --- a/core/slice/map.odin +++ b/core/slice/map.odin @@ -61,8 +61,8 @@ map_entry_infos :: proc(m: $M/map[$K]$V, allocator := context.allocator) -> (ent entry_index := 0 for bucket_index in 0.. Date: Sun, 22 Sep 2024 23:19:36 +0200 Subject: [PATCH 6/7] Replace "." with "," in parameter list --- core/simd/x86/sse2.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/simd/x86/sse2.odin b/core/simd/x86/sse2.odin index aaddbe6b4..4c231c377 100644 --- a/core/simd/x86/sse2.odin +++ b/core/simd/x86/sse2.odin @@ -240,7 +240,7 @@ _mm_sll_epi64 :: #force_inline proc "c" (a, count: __m128i) -> __m128i { } @(require_results, enable_target_feature="sse2") _mm_srai_epi16 :: #force_inline proc "c" (a: __m128i, $IMM8: u32) -> __m128i { - return transmute(__m128i)psraiw(transmute(i16x8)a. IMM8) + return transmute(__m128i)psraiw(transmute(i16x8)a, IMM8) } @(require_results, enable_target_feature="sse2") _mm_sra_epi16 :: #force_inline proc "c" (a, count: __m128i) -> __m128i { @@ -262,7 +262,7 @@ _mm_srli_si128 :: #force_inline proc "c" (a: __m128i, $IMM8: u32) -> __m128i { } @(require_results, enable_target_feature="sse2") _mm_srli_epi16 :: #force_inline proc "c" (a: __m128i, $IMM8: u32) -> __m128i { - return transmute(__m128i)psrliw(transmute(i16x8)a. IMM8) + return transmute(__m128i)psrliw(transmute(i16x8)a, IMM8) } @(require_results, enable_target_feature="sse2") _mm_srl_epi16 :: #force_inline proc "c" (a, count: __m128i) -> __m128i { From 5bced00f5d37f9ac513c7ad7350e38aa4b58c85b Mon Sep 17 00:00:00 2001 From: Antonino Simone Di Stefano Date: Sun, 22 Sep 2024 23:25:46 +0200 Subject: [PATCH 7/7] Return Allocator_Error in map_entry_infos --- core/slice/map.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/slice/map.odin b/core/slice/map.odin index a1b0a8925..c68488d26 100644 --- a/core/slice/map.odin +++ b/core/slice/map.odin @@ -48,7 +48,7 @@ map_entries :: proc(m: $M/map[$K]$V, allocator := context.allocator) -> (entries return } -map_entry_infos :: proc(m: $M/map[$K]$V, allocator := context.allocator) -> (entries: []Map_Entry_Info(K, V)) #no_bounds_check { +map_entry_infos :: proc(m: $M/map[$K]$V, allocator := context.allocator) -> (entries: []Map_Entry_Info(K, V), err: runtime.Allocator_Error) #no_bounds_check { m := m rm := (^runtime.Raw_Map)(&m)