Skip to content

Commit

Permalink
Fix the incorrect inclusion of arm64_neon.h on unsupported compilers
Browse files Browse the repository at this point in the history
Technically ARM64 on VS2017 and the experimental Clang might not work but I don't think that is a problem and it'll keep the fix simpler
Also enable the ARM64 and double types for _M_ARM64EC
  • Loading branch information
redorav committed Dec 22, 2024
1 parent 94f266a commit 6f5274c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/hlsl++/platforms/neon.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#pragma once

#if defined(_M_ARM64) || defined(__aarch64__)
#if defined(_M_ARM64) || defined(_M_ARM64EC) || defined(__aarch64__)

#define HLSLPP_ARM64
#define HLSLPP_DOUBLE

#endif

#if defined(_M_ARM64)
// Before VS2019 MSVC didn't handle arm_neon.h properly which is the standard
// way of including the NEON header. Many intrinsics were poorly mapped there
// too so we keep this compatibility layer. Later VS versions handle it properly
#if defined(_M_ARM64) && (_MSC_VER < 1920)

// The Microsoft ARM64 header is named differently
#include <arm64_neon.h>

// The Microsoft ARM64 headers don't define these
#if !defined(vmaxvq_u32)
#define vmaxvq_u32(x) neon_umaxvq32(x)
#endif
Expand Down

0 comments on commit 6f5274c

Please sign in to comment.