Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ function(SET_INTERPROCEDURAL_OPTIMIZATION)
# On ARM, whole program optimization triggers an internal compiler error during code gen, so we don't turn it on
# When compiling as a shared lib with MinGW, turning on LTO causes errors of the form 'ld.exe: cannot export symbol X wrong type (4 vs 3)'
if (INTERPROCEDURAL_OPTIMIZATION
AND NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM64EC")
AND NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM64")
AND NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM")
AND (NOT CROSS_COMPILE_ARM OR ("${CROSS_COMPILE_ARM_TARGET}" STREQUAL "aarch64-linux-gnu"))
Expand Down
3 changes: 3 additions & 0 deletions Build/cmake_vs2022_cl_arm_ec.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
cmake -S . -B VS2022_CL_ARM_EC -G "Visual Studio 17 2022" -A ARM64EC %*
echo Open VS2022_CL_ARM_EC\JoltPhysics.sln to build the project.
28 changes: 14 additions & 14 deletions Jolt/Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,20 @@
#endif

// Detect CPU architecture
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)
#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM) || defined(_M_ARM64EC)
// ARM CPU architecture
#define JPH_CPU_ARM
#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#define JPH_CPU_ARCH_BITS 64
#define JPH_USE_NEON
#define JPH_VECTOR_ALIGNMENT 16
#define JPH_DVECTOR_ALIGNMENT 32
#else
#define JPH_CPU_ARCH_BITS 32
#define JPH_VECTOR_ALIGNMENT 8 // 32-bit ARM does not support aligning on the stack on 16 byte boundaries
#define JPH_DVECTOR_ALIGNMENT 8
#endif
#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)
// X86 CPU architecture
#define JPH_CPU_X86
#if defined(__x86_64__) || defined(_M_X64)
Expand Down Expand Up @@ -167,19 +180,6 @@
#error Undefined compiler
#endif
#endif
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)
// ARM CPU architecture
#define JPH_CPU_ARM
#if defined(__aarch64__) || defined(_M_ARM64)
#define JPH_CPU_ARCH_BITS 64
#define JPH_USE_NEON
#define JPH_VECTOR_ALIGNMENT 16
#define JPH_DVECTOR_ALIGNMENT 32
#else
#define JPH_CPU_ARCH_BITS 32
#define JPH_VECTOR_ALIGNMENT 8 // 32-bit ARM does not support aligning on the stack on 16 byte boundaries
#define JPH_DVECTOR_ALIGNMENT 8
#endif
#elif defined(__riscv)
// RISC-V CPU architecture
#define JPH_CPU_RISCV
Expand Down