Skip to content
Open
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
6 changes: 6 additions & 0 deletions docs/rtllib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ Multipliers
.. automodule:: pyrtl.rtllib.multipliers
:members:

Floating Point
--------------

.. automodule:: pyrtl.rtllib.float
:members:

Barrel Shifter
--------------

Expand Down
522 changes: 269 additions & 253 deletions pyrtl/helperfuncs.py

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions pyrtl/rtllib/float/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
Add, subtract, and multiply floating point numbers.

Several standard ``Float`` formats like :class:`Float16` and :class:`Float32` are
predefined. Users may also define custom floating point formats.

The main operators are :func:`add`, :func:`sub`, and :func:`mult`. These operators all
accept and return one of these ``Float`` formats. Inputs to an operator must share
the same ``Float`` format. The operator's output will be in the same ``Float`` format as
its inputs.
"""

from .add_sub import add, sub
from .multiplication import mult
from .types import BFloat16, Float16, Float32, Float64, RoundingMode
from .utils import get_default_rounding_mode, set_default_rounding_mode

__all__ = [
"BFloat16",
"Float16",
"Float32",
"Float64",
"RoundingMode",
"add",
"get_default_rounding_mode",
"mult",
"sub",
"set_default_rounding_mode",
]
Loading
Loading