Commit Graph

8 Commits

Author SHA1 Message Date
Lephenixnoir 6eeef0fce9
libnum: add optimized num16 division for SH4AL-DSP 2023-04-29 12:14:09 +02:00
Lephenixnoir a7529430dd
libnum: some additional functions 2023-04-23 23:03:28 +02:00
Lephenixnoir 1d8851cbf5
libnum: add experimental string representation
Currently only has hand-picked tests and very rough code, but it's a
start. In the future, I want to have better tests, more
options like printf's %e/%f/%g, and more versatile methods.
2022-08-07 11:32:57 +02:00
Lephenixnoir 4238d5853f
libnum: add performance tests for num32 2022-07-24 00:21:56 +01:00
Lephenixnoir 708ba1b017
libnum: unit tests, perf tests for num16, double limits
* Add a unit testing framework in libnum/test/. Assertions are checked
  against sparse sets of input values (a couple thousands for each
  type), distributed fractally.
* Add performance tests for num16.
* Fix an overly ambitious substitution of /256 by >>8 in num16::mul,
  which would give some incorrect results for negative results.
* Also fix an incorrect sign extension in the num16->num32 conversion.
* Express comparison-with-int operators in terms of the integer even
  though some versions are faster when expressed in terms of the fixed-
  point value. This is because the integer is frequently known at
  compile-time.
* Add minDouble and maxDouble static members to each num type to
  programmatically supply the bounds of the type.
2022-07-24 00:05:41 +01:00
Lephenixnoir e90abaaabc
libnum: add tests for how optimized compiled assembly code is
This change adds tests for libnum (run with `make -C build-x tests`)
that compile example programs with g++ and evaluate how optimized the
assembly code is. This is done by checking user-provided specifications
of what instructions should and shouldn't be used against the compiled
assembler.
2022-07-19 23:18:01 +01:00
Lephenixnoir 2e63daa59a
meta: new build system (and emscripten fullscreen)
* Update the build system to support intermediate installs (instead of
  exposing CMake targets that were only usable from within the main
  CMakeLists.txt).
* Finish the emscripten build and add detailed instructions in
  README.md.
* Get rid of runtime GLSL files by embedding them into a C file. This
  solves the annoying problem of where to install them and how to find
  them at runtime.
* Provide FindAzur.cmake to access the library. At the moment the module
  still needs to be found which requires a set(CMAKE_MODULE_PATH) in
  user applications. I consider this an acceptable compromise.
* Automatically go soft-fullscreen in the emscripten application.
2022-06-05 14:08:49 +01:00
Lephenixnoir bf5db2a0f0
libnum: initial commit 2022-06-02 21:18:28 +01:00