diff --git a/Inc/DirectXMath.h b/Inc/DirectXMath.h index bc7451fc..f672f43c 100644 --- a/Inc/DirectXMath.h +++ b/Inc/DirectXMath.h @@ -86,6 +86,9 @@ #define _XM_SSE_INTRINSICS_ #elif defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__ #define _XM_ARM_NEON_INTRINSICS_ +#elif defined(__riscv) +// RISC-V currently uses the existing scalar no-intrinsics implementation. +#define _XM_NO_INTRINSICS_ #elif !defined(_XM_NO_INTRINSICS_) #error DirectX Math does not support this target #endif diff --git a/README.md b/README.md index 60cabff6..66aff30e 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,8 @@ copilot Officially the library is supported with Microsoft Visual C++ 2019 (16.11) or later, clang/LLVM v12 or later, and GCC 10 or later. It should also compile with the Intel C++ and MinGW compilers. +On RISC-V targets, DirectXMath selects its existing scalar `_XM_NO_INTRINSICS_` implementation by default. This does not provide any RISC-V vector or assembly optimizations. + When building with clang/LLVM or other GNU C compilers, the ``_XM_NO_XMVECTOR_OVERLOADS_`` control define is set because these compilers do not support creating operator overloads for the ``XMVECTOR`` type. You can choose to enable this preprocessor define explicitly to do the same thing with Visual C++ for improved portability. To build for non-Windows platforms, you need to provide a ``sal.h`` header in your include path. You can obtain an open source version from [GitHub](https://raw.githubusercontent.com/dotnet/runtime/main/src/coreclr/pal/inc/rt/sal.h).