From 0b5062d21cb2347fe2d9da31849808d0ef3c9485 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Fri, 9 Aug 2024 11:56:32 +0200 Subject: [PATCH] adds fp_functions here to remove dependencies in dbt-rise-core --- gen_input/templates/tcc/CORENAME.cpp.gtl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gen_input/templates/tcc/CORENAME.cpp.gtl b/gen_input/templates/tcc/CORENAME.cpp.gtl index c215a03..ec327a1 100644 --- a/gen_input/templates/tcc/CORENAME.cpp.gtl +++ b/gen_input/templates/tcc/CORENAME.cpp.gtl @@ -38,7 +38,9 @@ #include #include #include - +<%def fcsr = registers.find {it.name=='FCSR'} +if(fcsr != null) {%> +#include <%}%> #ifndef FMT_HEADER_ONLY #define FMT_HEADER_ONLY #endif @@ -86,7 +88,6 @@ protected: inline const char *name(size_t index){return traits::reg_aliases.at(index);} <% -def fcsr = registers.find {it.name=='FCSR'} if(fcsr != null) {%> inline const char *fname(size_t index){return index < 32?name(index+traits::F0):"illegal";} @@ -284,6 +285,7 @@ template void vm_impl::gen_trap_behavior(tu_builder& tu) { if(fcsr != null) {%> template void vm_impl::add_prologue(tu_builder& tu){ std::ostringstream os; + os << "uint32_t (*fget_flags)()=" << (uintptr_t)&fget_flags << ";\\n"; os << "uint32_t (*fadd_s)(uint32_t v1, uint32_t v2, uint8_t mode)=" << (uintptr_t)&fadd_s << ";\\n"; os << "uint32_t (*fsub_s)(uint32_t v1, uint32_t v2, uint8_t mode)=" << (uintptr_t)&fsub_s << ";\\n"; os << "uint32_t (*fmul_s)(uint32_t v1, uint32_t v2, uint8_t mode)=" << (uintptr_t)&fmul_s << ";\\n";