Skip to content

Commit

Permalink
build: merge develop to next/kelvin/410, convert lagoon to zig build
Browse files Browse the repository at this point in the history
  • Loading branch information
pkova committed Oct 17, 2024
1 parent 79241e1 commit 7f43f54
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
9 changes: 9 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ fn build_single(
.optimize = optimize,
});

const softblas = b.dependency("softblas", .{
.target = target,
.optimize = optimize,
});

const softfloat = b.dependency("softfloat", .{
.target = target,
.optimize = optimize,
Expand Down Expand Up @@ -485,10 +490,12 @@ fn build_single(
pkg_noun.linkLibrary(pdjson.artifact("pdjson"));
pkg_noun.linkLibrary(sigsegv.artifact("sigsegv"));
pkg_noun.linkLibrary(softfloat.artifact("softfloat"));
pkg_noun.linkLibrary(softblas.artifact("softblas"));
if (t.os.tag == .linux)
pkg_noun.linkLibrary(unwind.artifact("unwind"));
pkg_noun.linkLibrary(urcrypt.artifact("urcrypt"));
pkg_noun.linkLibrary(whereami.artifact("whereami"));
pkg_noun.linkLibrary(zlib.artifact("z"));
pkg_noun.linkLibC();

pkg_noun.addIncludePath(b.path("pkg/noun"));
Expand Down Expand Up @@ -615,6 +622,7 @@ fn build_single(
"jets/e/argon2.c",
"jets/e/base.c",
"jets/e/blake.c",
"jets/e/crc32.c",
"jets/e/cue.c",
"jets/e/ed_add_double_scalarmult.c",
"jets/e/ed_add_scalarmult_scalarmult_base.c",
Expand Down Expand Up @@ -678,6 +686,7 @@ fn build_single(
"jets/f/ut_mull.c",
"jets/f/ut_nest.c",
"jets/f/ut_rest.c",
"jets/i/lagoon.c",
"jets/tree.c",
"log.c",
"manage.c",
Expand Down
3 changes: 3 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
.softfloat = .{
.path = "./ext/softfloat",
},
.softblas = .{
.path = "./ext/softblas",
},
.unwind = .{
.path = "./ext/unwind",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/noun/jets/e/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ u3qe_crc32(u3_noun input_octs)
c3_y* input;

if (c3y == u3a_is_cat(tail)) {
input = &tail;
input = (c3_y*)&tail;
}
else {
u3a_atom* vat_u = u3a_to_ptr(tail);
Expand Down
5 changes: 2 additions & 3 deletions pkg/noun/jets/i/lagoon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@
for (c3_d i = 0; i < len_x; i++) {
float32_t x_val32 = ((float32_t*)x_bytes)[i];
// Perform division x/n
float32_t div_result32 = f32_mul((float32_t)in32, (float32_t)x_val32);
float32_t div_result32 = f32_mul(in32, x_val32);
// Compute floor of the division result
c3_ds floor_result32 = f32_to_i64(div_result32, softfloat_round_minMag, false);
float32_t floor_float32 = i64_to_f32(floor_result32);
Expand Down Expand Up @@ -3284,13 +3284,12 @@
{
return u3m_bail(c3__exit);
} else {
u3_noun x_shape, x_bloq, x_kind, x_tail,
u3_noun x_shape, x_bloq, x_kind,
y_shape,
rnd;
x_shape = u3h(x_meta); // 2
x_bloq = u3h(u3t(x_meta)); // 6
x_kind = u3h(u3t(u3t(x_meta))); // 14
x_tail = u3t(u3t(u3t(x_meta))); // 15
y_shape = u3h(y_meta); // 2
rnd = u3h(u3t(u3t(u3t(cor)))); // 30
if ( c3n == _check(u3nc(x_meta, x_data)) ||
Expand Down

0 comments on commit 7f43f54

Please sign in to comment.