aboutsummaryrefslogtreecommitdiff
path: root/lib/builtins/fp_trunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/builtins/fp_trunc.h')
-rw-r--r--lib/builtins/fp_trunc.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/builtins/fp_trunc.h b/lib/builtins/fp_trunc.h
index 49a9aebbc67d..373ba1b0411d 100644
--- a/lib/builtins/fp_trunc.h
+++ b/lib/builtins/fp_trunc.h
@@ -16,7 +16,13 @@
#include "int_lib.h"
-#if defined SRC_DOUBLE
+#if defined SRC_SINGLE
+typedef float src_t;
+typedef uint32_t src_rep_t;
+#define SRC_REP_C UINT32_C
+static const int srcSigBits = 23;
+
+#elif defined SRC_DOUBLE
typedef double src_t;
typedef uint64_t src_rep_t;
#define SRC_REP_C UINT64_C
@@ -44,6 +50,12 @@ typedef uint32_t dst_rep_t;
#define DST_REP_C UINT32_C
static const int dstSigBits = 23;
+#elif defined DST_HALF
+typedef uint16_t dst_t;
+typedef uint16_t dst_rep_t;
+#define DST_REP_C UINT16_C
+static const int dstSigBits = 10;
+
#else
#error Destination should be single precision or double precision!
#endif //end destination precision