## Known Issues: DirectXMath 3.03

The Windows 8.0 SDK includes DirectXMath version 3.03 for use with Windows Style apps and Win32 desktop applications on Windows 8, Windows RT, Windows 7, and Windows Vista. DirectXMath 3.03 is also part of the Windows phone 8.0 SDK for use on Windows phone 8. There are a number of minor bugs in the library…

## DirectXMath: F16C and FMA

In this installment in our series, we cover a few additional instructions that extend the AVX instruction set. These instructions make use of the VEX prefix and require the OS implement “OXSAVE”. Without this support, these instructions are all invalid and will generate an invalid instruction hardware exception. Half-precision Floating-point Conversion The F16C instruction set…

## DirectXMath: AVX

The Advanced Vector Extensions (AVX) instruction set goes beyond just adding more instructions like we’ve seen in previous installments. AVX also introduces an extended register file and a new x86 instruction encoding prefix. The AVX instruction set expands the existing XMM register file of 128-bit registers used by SSE instructions. XMM now refers to the…

## DirectXMath: SSE4.1 and SSE4.2

The SSE4 instruction set consists of two parts, referred as SSE4.1 and 4.2. The intrinsics are located in the smmintrin.h header. The SSE4.1 instruction set is the most interesting for DirectXMath, while SSE 4.2 adds some more specialized instructions for CRC checks and string handling. The key new features are a flexible dot-product instruction, float4…

## DirectXMath: SSE3 and SSSE3

The SSE3 instruction set adds about a dozen instructions (intrinsics are in the pimmintrin.h header). The main operation these instructions provide is the ability to do “horizontal” adds and subtracts (ARM-NEON refers to these as ‘pairwise’ operations) for float4 and double2 data. Result = _mm_hadd_ps(V1,V2); -> Result[0] = V1[0] + V1[1]; Result[1] = V1[2] +…

## DirectXMath: SSE, SSE2, and ARM-NEON

The DirectXMath library provides high-performance linear algebra math support for the typical kinds of operations found in a 3D graphics application. The library achieves this by making use of specialized SIMD (Single-Instruction-Multiple-Data) instruction sets to work on 4 single-precision float values at a time. The design of the library is itself heavily influenced by these…

## Spherical Harmonics Math

DirectXMath (aka XNAMath version 3) provides almost all the functionality of the original D3DXMath library with two exceptions. The first is the ‘matrix stack’ helper and the second is the ‘spherical harmonics’ math functions. The matrix stack is fairly easy to implement, but the SH math functions are another story. The original code for SH…

## XNA Math Version 2.05: Smoothing the transition to DirectXMath

The July 2012 release of the Xbox 360 XDK includes a new version of XNA Math, version 2.05. We are making it available here for Windows developers. The update is subject to the same EULA as the DirectX SDK (June 2010) release MIT license. What’s New XNA Math version 2.05 includes: Template forms have been…

## XDSP.H: Digital Signal Processing helper functions

The DirectX SDK (June 2010) release includes a little utility header, XDSP.H. This contains CPU-based functions for computing the Fast Fourier Transform (FFT) as well as some related multi-channel audio interleave/deinterleave functionality primarily used in writing custom xAPOs for XAUDIO2. The DirectX SDK version makes use of SSE intrinsics, which means it supports Windows x86…

## Introducing DirectXMath

The Windows SDK for Windows 8 (included with Visual Studio 2012) ships with the DirectXMath library which is the next major revision of the C++ SIMD graphics math library known as “XNAMath” in the DirectX SDK and Xbox 360 XDK. Think of it as “XNAMath version 3”—for the historically inclined, XNAMath itself was essentially “xboxmath…