The XBOX tooling only works with Microsoft Program Database (PDB) files for debugging symbols. It doesn’t support the CodeView or DWARF debugging information that LLVM
.ld files emit.C++14, C++17, and C++20 language versions and features
Visual Studio 2019, Visual Studio 2022, and Visual Studio 2026 support C++11, C++14, and C++17. Visual Studio 2022 and Visual Studio 2026 also support C++20.Intrinsics
The Visual C++ compiler doesn’t support x64 inline assembly but does support a wide variety of intrinsics to support inclusion of specialized instruction sets for XBOX development.Any use of intrinsics assumes that you already verified that the target platform supports the instructions. If you don’t verify support, the app throws runtime
invalid instruction exceptions. Pay particular attention to the fact that XBOX One (AMD Jaguar CPU) supports AVX and F16C, and XBOX Series X|S (AMD Hercules CPU) also supports AVX2 and FMA3. Neither platform supports AVX-512 or later instructions.Visual Studio supports the /arch:AVX and /arch:AVX2 switches, which enable the use of the VEX prefix that’s part of the AVX instruction set standard. Use this switch for all XBOX applications. For more information, see the following articles.
- Microsoft Docs: x64 Intrinsics
- Intel: AVX
- Games for Windows and the DirectX SDK blog: DirectXMath series
clang/LLVM intrinsics
The clang/LLVM for Windows toolset implements many of the same intrinsics as MSVC, but some key differences exist:- clang/LLVM and GNUC treat SSE SIMD types differently than Visual C++ and the Intel Compiler. Specifically, the
__m128,__m128i, and__m128dtypes are opaque types rather than structs, so you can’t create C++ overloaded functions that use those types. This difference also means direct element access through__m128.m128_f32[0]doesn’t compile on clang/LLVM.
For this reason, DirectXMath defines _XM_NO_XMVECTOR_OVERLOADS_ when building by using clang/LLVM. For better portability, you can explicitly define this macro in your code to enforce it for MSVC as well.
- The cpuid intrinsics for clang/LLVM use a special header
#include <cpuid.h>. The__cpuidintrinsic takes a different parameter list, and__cpuid_countis the equivalent of the MSVC__cpuidexbut again with a different parameter list.
Calling conventions
The default calling convention for x64 native code is__fastcall, detailed on Microsoft Docs. The __cdecl and __stdcall calling conventions are just aliases for __fastcall on x64.
The MSVC and clang/LLVM compilers include support for the __vectorcall calling convention for x86 and x64 code. For more information, see
Visual C++ Team Blog: Introducing ‘Vector Calling Convention’ and Microsoft Docs.
Autovectorizer and autoparallelizer
The Visual C++ optimizer can change scalar integer or floating-point computations into SIMD instructions through the autovectorizer. The autovectorizer is automatically enabled with/O2 or /Ox. You can disable it for specific loops by using #pragma loop(no_vector).
These compiler toolsets also support autoparallelization for loops by using threads. Enable autoparallelization by using /Qpar. You can provide a hint for a specific loop by using #pragma (loop(hint_parallel(n))). For more information, see the following article.
Reporting bugs
Report bugs for the Visual C++ compiler (if possible) through Visual Studio Report a Problem…. See Microsoft Docs and the Developer Community website. For details on creating a good bug report for the compiler, see this page.If more NDA information is required to reproduce the issue, you can add a comment to a public report issue marked as “Microsoft only.”
