summaryrefslogtreecommitdiffstats
path: root/floattypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'floattypes.h')
-rw-r--r--floattypes.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/floattypes.h b/floattypes.h
new file mode 100644
index 0000000..008f695
--- /dev/null
+++ b/floattypes.h
@@ -0,0 +1,22 @@
+// -*-C++-*-
+
+#ifndef FLOATTYPESS_H
+#define FLOATTYPESS_H
+
+#include <cstdint>
+
+namespace vecmathlib {
+
+ struct fp8 {
+ // 1 bit sign, 4 bits exponent, 3 bits mantissa
+ std::uint8_t val;
+ };
+
+ struct fp16 {
+ // 1 bit sign, 5 bits exponent, 10 bits mantissa
+ std::uint16_t val;
+ };
+
+} // namespace vecmathlib
+
+#endif // #ifndef FLOATTYPES_H
OpenPOWER on IntegriCloud