Commit Graph

14 Commits

Author SHA1 Message Date
Sylvain PILLOT 406cc3739e Resync with last Azur update 2023-05-13 11:28:27 +02:00
Lephenixnoir ec74a983b3
libnum: add unary vector operators 2022-08-30 13:14:21 +02:00
Lephenixnoir cd95fad8d0
libnum: add basic vector types 2022-08-20 22:23:56 +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 ec1593d4f8
libnum: add floor/ceil/frac functions, and int limits 2022-08-04 10:18:28 +01:00
Lephenixnoir 10cf9951a0
libnum: rename the namespace [num] -> [libnum]
The first name would make `num` on its own ambiguous when using the
namespace.
2022-08-01 23:01:35 +01: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 967eb034f4
libnum: num8 optimizations 2022-07-20 00:50:58 +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 d77c7fef78
libnum: add num8/num16 comparisons with integers and some tests 2022-07-19 23:12:23 +01:00
Lephenixnoir d75ef1b2e9
libnum: use C++20 concepts 2022-07-19 23:11:29 +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