From b9d9e510eadc9dbcd81519b8736a9ac17f995cb4 Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Tue, 29 Oct 2024 10:11:01 +0000 Subject: [PATCH] Add float_compose to complement float_decompose This can be useful for example to make a generic canonical_NaN() function. --- lib/float/common.sail | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/float/common.sail b/lib/float/common.sail index 47311231c..aac734da5 100644 --- a/lib/float/common.sail +++ b/lib/float/common.sail @@ -66,6 +66,9 @@ function float_decompose(op) = { } } +val float_compose : forall 'n, 'n in { 16, 32, 64, 128 }. float_bits('n) -> bits('n) +function float_compose(op) = op.sign @ op.exp @ op.mantissa + val not : forall ('p : Bool). bool('p) -> bool(not('p)) function not(b) = not_bool(b)