Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .trinity/seals/conformance_T27bConformanceLibmLogf.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"built_by": "t27c-bootstrap@0.5.2+5d5d2cdef",
"built_by": "t27c-bootstrap@0.5.2+8ea472041",
"closure": [
{
"spec": "specs/tri/t27b/libm.t27",
"spec_hash": "sha256:d4414973506e15dbe7e061ff41077da40fc844d55c4647c7ef970ff47192a378"
"spec_hash": "sha256:bb2d59aae61115c012a7062f1e7b19c6becb1985fcb5913109cc8dd4727601ee"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
Expand All @@ -14,7 +14,7 @@
"module": "T27bConformanceLibmLogf",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-09T14:59:45Z",
"sealed_at": "2026-10-18T11:14:32Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:5ba2c342e8d8677a4fa381c538c758f3ed6a9e270b7c9d8d320384518f00d8d0",
"spec_path": "specs/tri/t27b/conformance/libm_logf.t27",
Expand All @@ -23,7 +23,8 @@
"failing": [],
"forced": false,
"passed": 6,
"total": 6
"total": 6,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
Expand Down
9 changes: 5 additions & 4 deletions .trinity/seals/conformance_T27bConformanceLibmPowf.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"built_by": "t27c-bootstrap@0.5.2+dfcf30c4a",
"built_by": "t27c-bootstrap@0.5.2+8ea472041",
"closure": [
{
"spec": "specs/tri/t27b/libm.t27",
"spec_hash": "sha256:f7086aa8a7f25aa5bce5729f0dd63dd9852591096f69ad10641fbc4cebec64e4"
"spec_hash": "sha256:bb2d59aae61115c012a7062f1e7b19c6becb1985fcb5913109cc8dd4727601ee"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
Expand All @@ -14,7 +14,7 @@
"module": "T27bConformanceLibmPowf",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-09T22:21:26Z",
"sealed_at": "2026-10-18T11:14:35Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:85821ccd9875656eb388a87c6accd788f1a6fcfa3498547378e09a65ec876f6c",
"spec_path": "specs/tri/t27b/conformance/libm_powf.t27",
Expand All @@ -23,7 +23,8 @@
"failing": [],
"forced": false,
"passed": 6,
"total": 6
"total": 6,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
Expand Down
21 changes: 11 additions & 10 deletions .trinity/seals/conformance_T27bConformanceLibmRounding.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
{
"built_by": "t27c-bootstrap@0.5.2+5d5d2cdef",
"built_by": "t27c-bootstrap@0.5.2+8ea472041",
"closure": [
{
"spec": "specs/tri/t27b/libm.t27",
"spec_hash": "sha256:d4414973506e15dbe7e061ff41077da40fc844d55c4647c7ef970ff47192a378"
"spec_hash": "sha256:bb2d59aae61115c012a7062f1e7b19c6becb1985fcb5913109cc8dd4727601ee"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:afdbaa78df9aaeb454ab448c98e5ef6dc7e9b01d2f1051d7bd3cc2d54e818433",
"gen_hash_rust": "sha256:af62c5acd6c4fbf87e136e976cfbdd42417788f85ececc741146ae8e6ebb4c1a",
"gen_hash_verilog": "sha256:5d9822c0f36bdf6a68bb3578d44e160fd7f5ae57a4a589dd0aa6d89daf5765f1",
"gen_hash_zig": "sha256:7717c7922c14602ea131553af33bc84b8e7408d037b326c78c6a21d55cc7cdcb",
"gen_hash_c": "sha256:856073fc6a349dd6302b7668ceb904356cb89a1cd2929ec6b82dd98d5b6dec61",
"gen_hash_rust": "sha256:1110044ff659cc7dfec6203afc5fcc4b65434b2f3efb8ececa92b417e8caf0b4",
"gen_hash_verilog": "sha256:b07789baaa6a8da13ef4f6463a3fc6c50688ff9f65a381e9ffb9dd91e50e4863",
"gen_hash_zig": "sha256:fadd5f667ca7b6ed44baba164d5d585cdcaafd5f28037d214d0b0d961186d20a",
"module": "T27bConformanceLibmRounding",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-09T14:59:47Z",
"sealed_at": "2026-10-18T11:14:01Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:8957bfba1bea5bfb90db4b913c081bc08f302b2b4446b1a107eaff8eed25ea88",
"spec_hash": "sha256:38e07bbcdfd7304554cc26c7fb4f5a5263f3cb1e8bd5466fd38b39337ad6feff",
"spec_path": "specs/tri/t27b/conformance/libm_rounding.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 5,
"total": 5
"passed": 8,
"total": 8,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
Expand Down
9 changes: 5 additions & 4 deletions .trinity/seals/conformance_T27bConformanceLibmStdMath.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"built_by": "t27c-bootstrap@0.5.2+5d5d2cdef",
"built_by": "t27c-bootstrap@0.5.2+8ea472041",
"closure": [
{
"spec": "specs/tri/t27b/libm.t27",
"spec_hash": "sha256:d4414973506e15dbe7e061ff41077da40fc844d55c4647c7ef970ff47192a378"
"spec_hash": "sha256:bb2d59aae61115c012a7062f1e7b19c6becb1985fcb5913109cc8dd4727601ee"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
Expand All @@ -14,7 +14,7 @@
"module": "T27bConformanceLibmStdMath",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-09T14:59:49Z",
"sealed_at": "2026-10-18T11:14:35Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:46d16893692257fab86e9688458ec165f34965c5642bb7271d6209bfb5d06180",
"spec_path": "specs/tri/t27b/conformance/libm_std_math.t27",
Expand All @@ -23,7 +23,8 @@
"failing": [],
"forced": false,
"passed": 7,
"total": 7
"total": 7,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
Expand Down
19 changes: 10 additions & 9 deletions .trinity/seals/conformance_T27bConformanceRemInt.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"built_by": "t27c-bootstrap@0.5.2+9a73c9883",
"built_by": "t27c-bootstrap@0.5.2+8ea472041",
"closure": [],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:ffa76615872926b972027c331c46ccc8877f5458f70709aba0f4d2585f08f4bb",
"gen_hash_rust": "sha256:024c952eafbf87cb41f1a226340bf64ef77df54bec6df58bfa3b62c73f1f196e",
"gen_hash_verilog": "sha256:820beadf7954d96fe8556827a621579239ab3fa60ded2aa99680bac06e913541",
"gen_hash_zig": "sha256:93d60e8fdff9193c0e1199191604ee87cc8558dc64d6617334264b010752f080",
"gen_hash_c": "sha256:fba2bc4ca42582b8fe1d740617af2bb690a604e6da93565cfb8027f512f95230",
"gen_hash_rust": "sha256:e1d78592d7020117c806c51d4f0eb88cd26f3a4e76b9357f465d7ca9146b7f86",
"gen_hash_verilog": "sha256:1d225dd532cb58ab45c4196116bd9a5a9e15f382a97a3d861b98501c9a61fba2",
"gen_hash_zig": "sha256:5bb64df244d6d26188a53c9e2503d26ddca665324ce2185142489298d21517ad",
"module": "T27bConformanceRemInt",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-10T14:12:56Z",
"sealed_at": "2026-10-18T11:14:01Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:1d209c9a3fc42132de9dfe00125106cbea0fbb10acb409b9a34396a4a300c3d7",
"spec_hash": "sha256:6cb6dc2002cab87fb3dd6010105291dee503677b6851a9c74d29ab58def11fe3",
"spec_path": "specs/tri/t27b/conformance/rem_int.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 4,
"total": 4
"passed": 6,
"total": 6,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:1982ae948e24d00c5d221ccec12dfce1eb01204b53e37b0f857f93b16d64629d",
Expand Down
18 changes: 9 additions & 9 deletions .trinity/seals/t27b_T27bLibm.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"built_by": "t27c-bootstrap@0.5.2+39d5af36b",
"built_by": "t27c-bootstrap@0.5.2+8ea472041",
"closure": [],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:58b23c2e16d47adc167ec6e2d0592af6438ea34b6de01e35668f25ef0cefd605",
"gen_hash_rust": "sha256:57296efd12854ef27cf9f180728b2fde77edc0c84feba39e1b80077052de8ce6",
"gen_hash_verilog": "sha256:0b9c80e3dae4f86e979c6bd6cc09eabd63ff6ce10286b0ee9a4622c48cbb5c74",
"gen_hash_zig": "sha256:f9b3decf7f1dd65f59a8d0bc97b678734626db5c04229f8180c766ce31e4f009",
"gen_hash_c": "sha256:693fb3a509396e1c81680e2dabf04bdee382bd54d312c21e20dd863452d48030",
"gen_hash_rust": "sha256:56811beafc887cb8773c9a21d9f5e4e4686fc94a550d359c0dbda2f0164db126",
"gen_hash_verilog": "sha256:88588ac711a6efe50d1eb069130c43b7ec0a63d2bed153190b1ff261796d2760",
"gen_hash_zig": "sha256:a29f31fedc07b5e0cf8709743216fa5726493984e06e5a864c910788e5c54bec",
"module": "T27bLibm",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-11T04:13:20Z",
"sealed_at": "2026-10-18T11:13:57Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:62fa9277171c545081235a4021a976bd0234e724751489a3152835536d268aaf",
"spec_hash": "sha256:bb2d59aae61115c012a7062f1e7b19c6becb1985fcb5913109cc8dd4727601ee",
"spec_path": "specs/tri/t27b/libm.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 29,
"total": 29,
"passed": 30,
"total": 30,
"vacuous": 0
},
"toolchain": {
Expand Down
18 changes: 9 additions & 9 deletions .trinity/seals/t27b_T27bLibmPlan.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"built_by": "t27c-bootstrap@0.5.2+39d5af36b",
"built_by": "t27c-bootstrap@0.5.2+8ea472041",
"closure": [],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:6f70b1c72bee6a5a01f074d8bdf8133aa6503e21377719b1e0833b22b43b1f64",
"gen_hash_rust": "sha256:2419c5ee6968dccffe2236913208646b02f619ee73ca67885833d7c6796172eb",
"gen_hash_verilog": "sha256:bd7648b75bee2c18e802aa51e2e78767c71132870b6dab441994af9cf10af868",
"gen_hash_zig": "sha256:fddb93572b708c69c124bb1dc8cceee2211b23ca07b23790073b0ffb132acd04",
"gen_hash_c": "sha256:bba02f9b9f4a1572d001f52952d7378e102e7502e5ef8bfe61b0329c780615b9",
"gen_hash_rust": "sha256:aea1217193961c1c858a2545c41e5eb8050bd320abc98904d5bc9ad05c60aeb0",
"gen_hash_verilog": "sha256:9d337661883412424964dc7f532d2edaaedd6b7543198f63a77c757e459ab3e5",
"gen_hash_zig": "sha256:10892615534ebe25a212d555d7d4c4ee0726c3b9dc72f2ca29a3518a2e3e20c0",
"module": "T27bLibmPlan",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-11T04:13:20Z",
"sealed_at": "2026-10-18T11:14:00Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:19682872c60a8286cc843f662560b50d619f9b0eccdf48b4881c2db17703f177",
"spec_hash": "sha256:cf0b297711d7619d177ff2089aabcbf7dd8674adfea4c4062d1a9ed9b42ea229",
"spec_path": "specs/tri/t27b/libm_plan.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 15,
"total": 15,
"passed": 16,
"total": 16,
"vacuous": 0
},
"toolchain": {
Expand Down
10 changes: 5 additions & 5 deletions cli/t27b/src/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3807,7 +3807,7 @@ impl<'a> Lower<'a> {
}
}

/// A builtin of libm_plan.t27 (`@exp`, `@log`; an integer `@rem` is t27b's `%`): a call of its routine from libm.t27, compiler_rt's
/// A builtin of libm_plan.t27 (`@exp`, `@log`, an i64 `@mod`; an integer `@rem` is t27b's `%`): a call of its routine from libm.t27, compiler_rt's
/// algorithm, so the bits are the reference's, folded or not. What is refused instead is the plan's.
fn libm_call(&mut self, n: &Node) -> R<Val> {
self.see(n);
Expand All @@ -3823,15 +3823,15 @@ impl<'a> Lower<'a> {
Val::Cf(..) | Val::Ct(_) => xp::K_LITERAL,
_ => xp::K_OTHER,
};
let named = if k == xp::K_F64 { "f64" } else { "f32" };
let (named, ty0) = (if k == xp::K_F64 { "f64" } else { "f32" }, match &v { Val::E(e) => e.ty, _ if k == xp::K_F32 => Ty::F32, _ => Ty::F64 });
let base_e = n.children.get(1).filter(|c| c.name == "e").is_some_and(|c| self.std_const(c).is_some());
let a = xp::with_base(b, xp::plan(b, n.children.len(), k), base_e, n.children.first().is_some_and(|c| c.name == named));
match (v, self.sigs.get(xp::routine(b, a)).filter(|s| !s.poisoned).map(|s| (s.id, s.ret.clone()))) {
(v, _) if a == xp::OPERATOR => { let r = self.expr(&n.children[1])?; self.binary(xp::OPERATOR_TEXT, v, r) }
(v, Some((func, Some(LTy::S(ty))))) if t || matches!(v, Val::E(_)) => {
let mut args = if t { vec![] } else { vec![self.reg(v)?] };
(v, Some((func, Some(LTy::S(ty))))) if t || matches!(v, Val::E(_) | Val::Cf(..)) => {
let mut args = if t { vec![] } else { vec![self.coerce(v, ty0)?] }; // `@log(10.0)`: the literal, one rounding to f64
for c in &n.children[at + 1..] {
let r = self.expr_as(c, &LTy::S(if k == xp::K_F64 { Ty::F64 } else { Ty::F32 }))?; // `@rem(x, 2.0)`: the first one's type
let r = self.expr_as(c, &LTy::S(ty0))?; // `@rem(x, 2.0)`, `@mod(i, 2147483648)`: the first one's type
args.push(self.reg(r)?);
}
Ok(Val::E(Expr { ty, kind: ExprKind::Call { func, args } }))
Expand Down
Loading
Loading