Skip to content

Commit 0951d8e

Browse files
author
Federico Rossi
committed
Added doxygen comments
1 parent d2bbf5c commit 0951d8e

File tree

9 files changed

+235
-133
lines changed

9 files changed

+235
-133
lines changed

.hdoc.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ version = "1.0.0"
44

55
# Optional, adding this will enable direct links from the documentation
66
# to your source code.
7+
git_repo_url = "https://github.com/federicorossifr/cppposit/"
8+
git_default_branch = "main"
79

810
[pages]
911
homepage="docs/getting_started.md"
@@ -13,6 +15,19 @@ paths = [
1315
"docs/Tabulation.md"
1416
]
1517

18+
[ignore]
19+
paths = [
20+
"include/floats",
21+
"include/interface",
22+
"include/traits/floattraits.hpp",
23+
"include/traits/fixedtraits.hpp",
24+
"include/typehelpers.hpp",
25+
"include/bithippop.hpp"
26+
27+
]
28+
29+
30+
1631
[paths]
1732
compile_commands = "builddir/compile_commands.json"
1833
output_dir = "cppposit_docs/"

include/backends/fixed.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ namespace posit {
2020
template <class PT>
2121
struct UnpackedPosit;
2222

23+
/// @brief Fixed Backend for Posit
24+
/// @tparam FT FixedTrait class to specify fixed-point number of bits
25+
/// @tparam ET ExponentType used to construct the underlying UnpackedPosit
2326
template <class FT, class ET>
2427
struct BackendFixed
2528
{

include/backends/float.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace posit {
1818
template <class PT>
1919
struct UnpackedPosit;
2020

21+
/// @brief Floating-point like backend
22+
/// @tparam B floating-point type (can be float or double)
2123
template <class B>
2224
struct BackendFloat
2325
{

include/backends/hwbaseback.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace posit {
1313

14+
/// @brief Generalized helper class to mark hardware-based backends
1415
struct HwBaseBackend {};
1516

1617
}

include/backends/softback.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ enum class NumberType {
3333
Infinity,
3434
NaN,
3535
Zero
36-
}; /// signed infinity and nan require the extra X bit
36+
};
3737

38+
/// @brief Unpacked backend for full-software posit emulation
39+
/// @tparam FT Holder type for the fraction
40+
/// @tparam ET Holder type for the exponent
3841
template <class FT = uint64_t, class ET = int32_t>
3942
struct Unpacked {
4043
using fraction_type = FT;

include/backends/tabback.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ namespace posit {
1515
template <class T>
1616
struct is_posit_backend;
1717

18+
/// @brief Posit table trait struct: describes characteristic of a tabulated set of operations
19+
/// @tparam T holder type
20+
/// @tparam n number of Posit bits
21+
/// @tparam e number of exponent bits
22+
/// @tparam log True if contains logarithmic alternativ to mul and div tables
1823
template <class T, int n, int e, bool log>
1924
struct PositTableTrait {
2025
using type = T;
@@ -23,7 +28,10 @@ namespace posit {
2328
using isLogtab = std::integral_constant<bool,log>;
2429
};
2530

26-
31+
/// @brief Tabulated Backend for posit
32+
/// @tparam PositEmu Posit type used for full-software emulation as a fallback
33+
/// @tparam PTable Posit Table class containing the tables used for the operations as static constexpr members
34+
/// @tparam PTableTrait Posit Table trait
2735
template <class PTableTrait, class PositEmu, class PTable>
2836
struct TabulatedBackend: public HwBaseBackend
2937
{

include/backends/unpacked.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,18 @@ namespace posit {
3838
typename PT::POSIT_UTYPE fraction; /// decoded fraciton left aligned with the leading 1
3939
};
4040

41+
/// @brief Helper class to pack and unpack posit from/to backend
42+
/// @tparam PT Posit type
43+
/// @tparam FT Fraction type
4144
template <class PT, class FT>
4245
struct PositPacker<PT,Unpacked<FT,typename PT::exponenttype> >
4346
{
4447
using BE = Unpacked<FT,typename PT::exponenttype>;
4548
using UP = UnpackedPosit<PT>;
4649

50+
/// @brief Construct the posit Backend from an UnpackedPosit instance
51+
/// @param up Unpacked Posit instance
52+
/// @return Backend type instance
4753
static CONSTEXPR14 BE unpacked_to_backend(UP up)
4854
{
4955
using BE = Unpacked<FT,typename PT::exponenttype>;
@@ -59,6 +65,9 @@ namespace posit {
5965
return r;
6066
}
6167

68+
/// @brief Construct an Unpacked posit instance from a Backend instance
69+
/// @param b Backend instance
70+
/// @return UnpackedPosit
6271
static CONSTEXPR14 UP backend_to_unpacked(BE b)
6372
{
6473
if(b.type == NumberType::Regular)

include/backends/xpositback.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ namespace posit {
1212
template <class T>
1313
struct is_posit_backend;
1414

15+
/// @brief Demo Backend for ISA-extended Posit backend
16+
/// @tparam T holder type
17+
/// @tparam PositEmu Posit type used for full-software emulation as fallback
1518
template <class T,class PositEmu>
1619
struct BackendXPosit: public HwBaseBackend
1720
{

0 commit comments

Comments
 (0)