From 9afec991abda390238b72ec1dadf8cd5ceac7824 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 11 Oct 2022 08:23:29 -0700 Subject: [PATCH] Match and link float.c --- configure.py | 2 +- obj_files.mk | 2 +- src/Runtime/float.c | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/Runtime/float.c diff --git a/configure.py b/configure.py index d77e2417..2b66f67c 100755 --- a/configure.py +++ b/configure.py @@ -870,7 +870,7 @@ LIBS = [ ["Runtime/rand", True], "Runtime/sscanf", "Runtime/string", - "Runtime/float", + ["Runtime/float", True], "Runtime/strtold", ["Runtime/uart_console_io", True], ["Runtime/wchar_io", True], diff --git a/obj_files.mk b/obj_files.mk index 57b42513..13eb8f78 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -745,7 +745,7 @@ MSL_PPCEABI_BARE_H :=\ $(BUILD_DIR)/src/Runtime/rand.o\ $(BUILD_DIR)/asm/Runtime/sscanf.o\ $(BUILD_DIR)/asm/Runtime/string.o\ - $(BUILD_DIR)/asm/Runtime/float.o\ + $(BUILD_DIR)/src/Runtime/float.o\ $(BUILD_DIR)/asm/Runtime/strtold.o\ $(BUILD_DIR)/src/Runtime/uart_console_io.o\ $(BUILD_DIR)/src/Runtime/wchar_io.o diff --git a/src/Runtime/float.c b/src/Runtime/float.c new file mode 100644 index 00000000..333680a4 --- /dev/null +++ b/src/Runtime/float.c @@ -0,0 +1,17 @@ + +#include "math.h" + +_INT32 __float_nan[] = {0x7FFFFFFF}; +_INT32 __float_huge[] = {0x7F800000}; +_INT32 __double_min[] = {0x00100000, 0}; +_INT32 __double_max[] = {0x7fefffff, 0xffffffff}; +_INT32 __double_epsilon[] = {0x3cb00000, 0}; +_INT32 __double_tiny[] = {0, 1}; +_INT32 __double_huge[] = {0x7FF00000, 0}; +_INT32 __double_nan[] = {0x7FFFFFFF, 0xFFFFFFFF}; +_INT32 __extended_min[] = {0x00100000, 0}; +_INT32 __extended_max[] = {0x7fefffff, 0xffffffff}; +_INT32 __extended_epsilon[] = {0x3cb00000, 0}; +_INT32 __extended_tiny[] = {0, 1}; +_INT32 __extended_huge[] = {0x7FF00000, 0}; +_INT32 __extended_nan[] = {0x7FFFFFFF, 0xFFFFFFFF};