DirectXMath VS glibc

Compare DirectXMath vs glibc and see what are their differences.

DirectXMath

DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps (by microsoft)

glibc

GNU Libc (by lattera)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
DirectXMath glibc
13 25
1,481 1,228
1.5% -
6.8 0.0
24 days ago over 5 years ago
C++ C
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

DirectXMath

Posts with mentions or reviews of DirectXMath. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-04-15.
  • Vector math library benchmarks (C++)
    3 projects | /r/GraphicsProgramming | 15 Apr 2023
    For those unfamiliar, like I was, DXM is DirectXMath.
  • Learning DirectX 12 in 2023
    13 projects | dev.to | 30 Jan 2023
    Alongside MiniEngine, you’ll want to look into the DirectX Toolkit. This is a set of utilities by Microsoft that simplify graphics and game development. It contains libraries like DirectXMesh for parsing and optimizing meshes for DX12, or DirectXMath which handles 3D math operations like the OpenGL library glm. It also has utilities for gamepad input or sprite fonts. You can see a list of the headers here to get an idea of the features. You’ll definitely want to include this in your project if you don’t want to think about a lot of these solved problems (and don’t have to worry about cross-platform support).
  • Optimizing compilers reload vector constants needlessly
    7 projects | news.ycombinator.com | 6 Dec 2022
    Bad news. For SIMD there are not cross-platform intrinsics. Intel intrinsics map directly to SSE/AVX instructions and ARM intrinsics map directly to NEON instructions.

    For cross-platform, your best bet is probably https://github.com/VcDevel/std-simd

    There's https://eigen.tuxfamily.org/index.php?title=Main_Page But, it's tremendously complicated for anything other than large-scale linear algebra.

    And, there's https://github.com/microsoft/DirectXMath But, it has obvious biases :P

  • MATHRIL - Custom math library for game programming
    3 projects | /r/cpp | 6 Jul 2022
    I am not in gamedev, but work with 3D graphics, we use DirectX 11, so DirectXMath was a natural choice, it is header only, it supports SIMD instructions (SSE, AVX, NEON etc.), it can even be used on Linux (has no dependence on Windows). It of course just one choice: https://github.com/Microsoft/DirectXMath.
  • When i had to look up what a Quaternion is
    2 projects | /r/ProgrammerHumor | 5 Jul 2022
  • Eigen: A C++ template library for linear algebra
    6 projects | news.ycombinator.com | 4 Apr 2022
    I never really used GLM, but Eigen was substantially slower than DirectXMath https://github.com/microsoft/DirectXMath for these things. Despite the name, 99% of that library is OS agnostic, only a few small pieces (like projection matrix formula) are specific to Direct3D. When enabled with corresponding macros, inline functions from that library normally compile into pretty efficient manually vectorized SSE, AVX or NEON code.

    The only major issue, DirectXMath doesn’t support FP64 precision.

  • maths - templated c++ linear algebra library with vector swizzling, intersection tests and useful functions for games and graphics dev... includes live webgl/wasm demo ?
    3 projects | /r/cpp | 12 Jan 2022
    If you’re the author, consider comparisons with the industry standards, glm and DirectXMath, which both ensure easy interoperability with the two graphics APIs.
  • Algorithms for division: Using Newton's method
    1 project | news.ycombinator.com | 8 Dec 2021
    Good article, but note that if the hardware supports the division instruction, will be much faster than the described workarounds.

    Personally, I recently did what’s written in 2 cases: FP32 division on ARMv7, and FP64 division on GPUs who don’t support that instruction.

    For ARM CPUs, not only they have FRECPE, they also have FRECPS for the iteration step. An example there: https://github.com/microsoft/DirectXMath/blob/jan2021/Inc/Di...

    For GPUs, Microsoft classified FP64 division as “extended double shader instruction” and the support is optional. However, GPUs are guaranteed to support FP32 division. The result of FP32 division provides an awesome starting point for Newton-Raphson refinement in FP64 precision.

  • Use of BLAS vs direct SIMD for linear algebra library operations?
    3 projects | /r/cpp | 28 Aug 2021
    For graphics DX math is a very good library.
  • Speeding Up `Atan2f` by 50x
    7 projects | news.ycombinator.com | 17 Aug 2021
    I wonder how does it compare with Microsoft’s implementation, there: https://github.com/microsoft/DirectXMath/blob/jan2021/Inc/Di...

    Based on the code your version is probably much faster. It would be interesting to compare precision still, MS uses 17-degree polynomial there.

glibc

Posts with mentions or reviews of glibc. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-05-10.
  • `Strlen` in Glibc
    1 project | news.ycombinator.com | 23 Oct 2023
  • How does sqrt() work in glibc?
    1 project | /r/learnprogramming | 11 Jul 2023
    I am writing a short paper for school and the topic is Fast Inverse Square Root and alternatives. One of the questions is how the sqrt-function is implemented in glibc. Here is the code of that function.
  • A collection of lock-free data structures written in standard C++11
    7 projects | news.ycombinator.com | 10 May 2023
    The code isn't the easiest to read but in glibc it seems that the syscall is only performed if waiter are detected in userspace during an unlock operation

    https://github.com/lattera/glibc/blob/master/nptl/pthread_mu...

  • Converting my new code (Bytearray2Float64) into 19 Programming Language
    3 projects | /r/rust | 6 May 2023
    You might still not realize, but floats are a large topic. Have a look at eg. this implementation here: https://github.com/lattera/glibc/blob/master/stdlib/strtod_l.c
  • Honest question about this "The byte order fallacy" blog post.
    1 project | /r/C_Programming | 17 Apr 2023
    This is a nice write up, thank you. However, I'm stilling interpreting this as a "fun trick" rather than the common sense method for solving the problem. For example, looking at the source code for htonl() from glibc: https://github.com/lattera/glibc/blob/master/inet/htonl.c
  • Dio deleted the tweet shortly after
    2 projects | /r/ShitPostCrusaders | 14 Apr 2023
    Second of all: The horrifying truth is that there is no such thing as a canonical text representation for IPv4 (source) (and yes... I am indeed citing the failed attempt to standardize this as my source for it not being standardized). Authoritatively speaking, all possible (non-binary) representations are equally invalid. In fact, text address resolution is typically delegated to the OS kernel, so what constitutes a "usable" address is liable to vary depending on if you're using Linux, OSX, Windows, or Other.
  • Discussion Thread
    1 project | /r/neoliberal | 14 Apr 2023
    Optimized code gets really weird. The creators of strlen, for example, decided that iterating over each character to find the end was far too slow. So instead, they convert the character pointer into an int pointer and do bitwise manipulation with the int on two different magic numbers so they can check four/eight characters at once.
  • Tengo una duda en algo C/C++
    1 project | /r/programacion | 27 Dec 2022
  • How does jvm deal with syscalls
    3 projects | /r/learnprogramming | 6 Nov 2022
    If you're using a cross-platform C compiler like gcc or clang, you're usually expected to switch to assembly. Here's the syscall instruction in glibc
  • Math Functions with -nostdlib
    3 projects | /r/C_Programming | 16 Oct 2022
    Maybe you should include the math part of a libc statically with your code. glibc is one option, or dietlibc if you want it to be as small as possible.

What are some alternatives?

When comparing DirectXMath and glibc you can also consider the following projects:

GLM - OpenGL Mathematics (GLM)

fastapprox - Approximate and vectorized versions of common mathematical functions

highway - Performance-portable, length-agnostic SIMD with runtime dispatch

openlibm - High quality system independent, portable, open source libm implementation

libjxl - JPEG XL image format reference implementation

Fastor - A lightweight high performance tensor algebra framework for modern C++

nixpkgs - Nix Packages collection & NixOS

Vc - SIMD Vector Classes for C++

illumos-gate - An open-source Unix operating system

highway - Highway - A Modern Javascript Transitions Manager

crux - General purpose bitemporal database for SQL, Datalog & graph queries. Backed by @juxt [Moved to: https://github.com/xtdb/xtdb]