diff options
author | 2020-09-17 19:45:24 +0200 | |
---|---|---|
committer | 2020-09-17 19:45:24 +0200 | |
commit | ec742d3eda78e2fefd01b69a9f10ae1939422d16 (patch) | |
tree | 760b40381fb0c5814f9fd91362daeaa6779aaa3b | |
parent | e62e2d759b1a952390e0fe7a7ed36e33d2676ba5 (diff) |
netlist: emscripten can not use specialization efficiently.
* Consequently prefer to save on compile time and size.
-rw-r--r-- | src/lib/netlist/generated/static_solvers.cpp | 8 | ||||
-rw-r--r-- | src/lib/netlist/prg/nltool.cpp | 4 | ||||
-rw-r--r-- | src/lib/netlist/solver/nld_solver.cpp | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/netlist/generated/static_solvers.cpp b/src/lib/netlist/generated/static_solvers.cpp index 8c3173b98d2..367af35bbb9 100644 --- a/src/lib/netlist/generated/static_solvers.cpp +++ b/src/lib/netlist/generated/static_solvers.cpp @@ -1,5 +1,7 @@ #include "plib/pdynlib.h" +#if !defined(__EMSCRIPTEN__) + // elim static void nl_gcr_11c2ae166b240b6e_10_double_double(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) @@ -72411,8 +72413,12 @@ static void nl_gcr_feae15b80dd73620_7_double_double(double * __restrict V, const V[0] = (RHS0 - tmp0) / m_A0; } +#endif + extern const plib::dynlib_static_sym nl_static_solver_syms[]; const plib::dynlib_static_sym nl_static_solver_syms[] = { +#if !defined(__EMSCRIPTEN__) + // elim {"nl_gcr_11c2ae166b240b6e_10_double_double", reinterpret_cast<void *>(&nl_gcr_11c2ae166b240b6e_10_double_double)}, // tankbatt @@ -72809,5 +72815,7 @@ const plib::dynlib_static_sym nl_static_solver_syms[] = { {"nl_gcr_fd2796828f1ebd00_36_double_double", reinterpret_cast<void *>(&nl_gcr_fd2796828f1ebd00_36_double_double)}, // starfire {"nl_gcr_feae15b80dd73620_7_double_double", reinterpret_cast<void *>(&nl_gcr_feae15b80dd73620_7_double_double)}, +#endif + {"", nullptr} }; diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 27aa5b293c3..44b96bf0d6d 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -694,18 +694,22 @@ void tool_app_t::static_compile() throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_out())); sout << "#include \"plib/pdynlib.h\"\n\n"; + sout << "#if !defined(__EMSCRIPTEN__)\n\n"; for (auto &e : map) { sout << "// " << putf8string(e.second.m_module) << "\n"; sout << putf8string(e.second.m_code); } + sout << "#endif\n\n"; sout << "extern const plib::dynlib_static_sym nl_static_solver_syms[];\n"; sout << "const plib::dynlib_static_sym nl_static_solver_syms[] = {\n"; + sout << "#if !defined(__EMSCRIPTEN__)\n\n"; for (auto &e : map) { sout << "// " << putf8string(e.second.m_module) << "\n"; sout << "\t{\"" << putf8string(e.first) << "\", reinterpret_cast<void *>(&" << putf8string(e.first) << ")},\n"; } + sout << "#endif\n\n"; sout << "{\"\", nullptr}\n"; sout << "};\n"; diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 92a4af61399..9ea31925b98 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -227,6 +227,7 @@ namespace devices std::size_t net_count = nets.size(); switch (net_count) { +#if !defined(__EMSCRIPTEN__) case 1: return plib::make_unique<solver::matrix_solver_direct1_t<FT>, device_arena>(*this, sname, nets, params); case 2: @@ -243,6 +244,7 @@ namespace devices return create_solver<FT, 7>(7, sname, params, nets); case 8: return create_solver<FT, 8>(8, sname, params, nets); +#endif default: log().info(MI_NO_SPECIFIC_SOLVER(net_count)); if (net_count <= 16) |