encoding/cbor: support simd vectors

This commit is contained in:
Laytan Laats
2025-06-04 22:00:02 +02:00
parent 85224b21e6
commit 9eefa2006e
3 changed files with 38 additions and 0 deletions
@@ -44,6 +44,7 @@ Foo :: struct {
smallest: big.Int,
ignore_this: ^Foo `cbor:"-"`,
mat: matrix[4, 4]f32,
vec: #simd [4]f64,
}
FooBar :: enum {
@@ -97,6 +98,7 @@ test_marshalling :: proc(t: ^testing.T) {
small_onetwenty = -i128(max(u64)),
ignore_this = &Foo{},
mat = 1,
vec = 2,
}
big.atoi(&f.biggest, "1234567891011121314151617181920")
@@ -145,6 +147,12 @@ test_marshalling :: proc(t: ^testing.T) {
"now": 1(1701117968),
"pos": 1212,
"str": "Hellope",
"vec": [
2.0000,
2.0000,
2.0000,
2.0000
],
"yes": true,
"comp": [
32.0000,