diff options
author | couriersud <couriersud@gmx.org> | 2017-04-06 00:03:59 +0200 |
---|---|---|
committer | couriersud <couriersud@gmx.org> | 2017-04-09 00:04:10 +0200 |
commit | 49d50c3045a71a75566ad4322bf2195b2adba0c2 (patch) | |
tree | ee1e5f74c8f4fbf04d896d6703e7a4c43bbc8f31 /src/lib/netlist/analog/nlid_twoterm.cpp | |
parent | 3f9f4eedcfc2757567d8bc46bd8e6f7850348683 (diff) |
Netlist code refactoring:
- more use of c++ features
- some CRTP in pfmtlog
- demangled code for truthtables
- use more constexpr
- rewrite main loop
- use default constructors and assignment operators were applicable.
- optimized 7448 and 9316
All of this has decreased startup time by approx. 25% to 30%. Complex
netlists like pong or kidniki are parsed, analyzed and constructed in
around 15 ms. Run performance has increased by about 5%.
All in all not to bad. A game like pong uses a clock of 7 MHz (after
division by 2). Thats 14 MHz clock invocations. Running at over 200%, 28
MHz. On a 3.9 GHz Machine about 140 cycles/clock change.
[Couriersud]
Diffstat (limited to 'src/lib/netlist/analog/nlid_twoterm.cpp')
-rw-r--r-- | src/lib/netlist/analog/nlid_twoterm.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp index 676042850ad..f54c2b3e68f 100644 --- a/src/lib/netlist/analog/nlid_twoterm.cpp +++ b/src/lib/netlist/analog/nlid_twoterm.cpp @@ -38,7 +38,7 @@ generic_diode::generic_diode(device_t &dev, pstring name) void generic_diode::set_param(const nl_double Is, const nl_double n, nl_double gmin) { - static const double csqrt2 = std::sqrt(2.0); + static constexpr double csqrt2 = 1.414213562373095048801688724209; //std::sqrt(2.0); m_Is = Is; m_logIs = std::log(Is); m_n = n; |