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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion math/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#
#-------------------------------------------------------------------------
TARGETACT=_all_.act fxp.act misc.act
TARGETACT=_all_.act fxp.act misc.act sint.act
TARGETACTSUBDIR=math

include $(ACT_HOME)/scripts/Makefile.std
Expand Down
1 change: 1 addition & 0 deletions math/_all_.act
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@

import "math/fxp.act";
import "math/misc.act";
import "math/sint.act";
24 changes: 24 additions & 0 deletions math/sint.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace math {
export
template<pint W>
deftype sint <: fixpoint<W,0> ()
{
methods {
function positive() : bool {
chp {
self := fxp::positive<W,0>(x)
}
}
}
}

export
namespace sint_ops {
template<pint W,N>
function clsl(sint<W> v) : sint<W> {
chp {
self.x := v.x << N
}
}
}
}