diff --git a/externals/cmakemodules/GetCompilerAndPlatform.cmake b/externals/cmakemodules/GetCompilerAndPlatform.cmake index 3ab5cfbfa..753e0a9cd 100644 --- a/externals/cmakemodules/GetCompilerAndPlatform.cmake +++ b/externals/cmakemodules/GetCompilerAndPlatform.cmake @@ -125,6 +125,8 @@ FUNCTION (GetPlatformBinName PLATFORM_BIN_NAME LIBPATH_SUFFIX) SET(RETVAL "linux.clang") ELSEIF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") SET(RETVAL "linux.aarch64") + ELSEIF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "e2k") + SET(RETVAL "linux.e2k") ENDIF() ENDIF() diff --git a/physx/buildtools/cmake_generate_projects.py b/physx/buildtools/cmake_generate_projects.py index ebd304962..c93eb9cc4 100644 --- a/physx/buildtools/cmake_generate_projects.py +++ b/physx/buildtools/cmake_generate_projects.py @@ -118,6 +118,8 @@ def isMultiConfigPlatform(self): return False elif self.targetPlatform == 'linuxAarch64': return False + elif self.targetPlatform == 'linuxE2K': + return False elif self.targetPlatform == 'android': return False return True @@ -165,6 +167,8 @@ def getPlatformCMakeParams(self): outString = outString + '-G \"Unix Makefiles\"' elif self.targetPlatform == 'linuxAarch64': outString = outString + '-G \"Unix Makefiles\"' + elif self.targetPlatform == 'linuxE2K': + outString = outString + '-G \"Unix Makefiles\"' if self.targetPlatform == 'win32': outString = outString + ' -AWin32' @@ -314,6 +318,12 @@ def getPlatformCMakeParams(self): os.environ['PM_CMakeModules_PATH'] + \ '/linux/LinuxAarch64.cmake\"' return outString + elif self.targetPlatform == 'linuxE2K': + outString = outString + ' -DTARGET_BUILD_PLATFORM=linux' + outString = outString + ' -DPX_OUTPUT_ARCH=e2k' + outString = outString + ' -DCMAKE_C_COMPILER=gcc' + outString = outString + ' -DCMAKE_CXX_COMPILER=g++' + return outString elif self.targetPlatform == 'mac64': outString = outString + ' -DTARGET_BUILD_PLATFORM=mac' outString = outString + ' -DPX_OUTPUT_ARCH=x86' diff --git a/physx/buildtools/presets/public/linux-e2k.xml b/physx/buildtools/presets/public/linux-e2k.xml new file mode 100644 index 000000000..332bb3f77 --- /dev/null +++ b/physx/buildtools/presets/public/linux-e2k.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/physx/snippets/compiler/cmake/linux/CMakeLists.txt b/physx/snippets/compiler/cmake/linux/CMakeLists.txt index 8152bd3fe..016ce6652 100644 --- a/physx/snippets/compiler/cmake/linux/CMakeLists.txt +++ b/physx/snippets/compiler/cmake/linux/CMakeLists.txt @@ -53,7 +53,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath='$ORIGIN'") # Include all of the projects SET(PLATFORM_SNIPPETS_LIST Convert LoadCollection) -IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") +IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "e2k") SET(SNIPPET_RENDER_ENABLED 0) ELSE() SET(SNIPPET_RENDER_ENABLED 1) diff --git a/physx/snippets/compiler/cmake/linux/SnippetTemplate.cmake b/physx/snippets/compiler/cmake/linux/SnippetTemplate.cmake index 5261d4feb..06cd3c62d 100644 --- a/physx/snippets/compiler/cmake/linux/SnippetTemplate.cmake +++ b/physx/snippets/compiler/cmake/linux/SnippetTemplate.cmake @@ -29,7 +29,7 @@ # Build Snippet linux template # -IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") +IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "e2k") SET(SNIPPET_COMPILE_DEFS # Common to all configurations @@ -71,7 +71,7 @@ IF(${SNIPPET_NAME} STREQUAL "ArticulationLoader") ) ENDIF() -IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") +IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "e2k") SET(SNIPPET_PLATFORM_LINKED_LIBS rt pthread dl ) diff --git a/physx/snippets/compiler/cmake/linux/SnippetVehicleTemplate.cmake b/physx/snippets/compiler/cmake/linux/SnippetVehicleTemplate.cmake index 2688d393a..6cdba6d03 100644 --- a/physx/snippets/compiler/cmake/linux/SnippetVehicleTemplate.cmake +++ b/physx/snippets/compiler/cmake/linux/SnippetVehicleTemplate.cmake @@ -29,7 +29,7 @@ # Build SnippetVehicle linux template # -IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") +IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "e2k") SET(SNIPPET_COMPILE_DEFS # Common to all configurations @@ -61,7 +61,7 @@ SET(SNIPPET_PLATFORM_INCLUDES ) -IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") +IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "e2k") SET(SNIPPET_PLATFORM_LINKED_LIBS rt pthread dl ) diff --git a/physx/source/compiler/cmake/linux/CMakeLists.txt b/physx/source/compiler/cmake/linux/CMakeLists.txt index aba53365a..b034de49b 100644 --- a/physx/source/compiler/cmake/linux/CMakeLists.txt +++ b/physx/source/compiler/cmake/linux/CMakeLists.txt @@ -31,6 +31,11 @@ STRING(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWERCASE) SET(CLANG_WARNINGS "-ferror-limit=0 -Wall -Wextra -Werror -Wno-alloca -Wno-anon-enum-enum-conversion -Wstrict-aliasing=2 -Weverything -Wno-documentation-deprecated-sync -Wno-documentation-unknown-command -Wno-gnu-anonymous-struct -Wno-undef -Wno-unused-function -Wno-nested-anon-types -Wno-float-equal -Wno-padded -Wno-weak-vtables -Wno-cast-align -Wno-conversion -Wno-missing-noreturn -Wno-missing-variable-declarations -Wno-shift-sign-overflow -Wno-covered-switch-default -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes -Wno-unreachable-code -Wno-unused-macros -Wno-unused-member-function -Wno-used-but-marked-unused -Wno-weak-template-vtables -Wno-deprecated -Wno-non-virtual-dtor -Wno-invalid-noreturn -Wno-return-type-c-linkage -Wno-reserved-id-macro -Wno-c++98-compat-pedantic -Wno-unused-local-typedef -Wno-old-style-cast -Wno-newline-eof -Wno-unused-private-field -Wno-format-nonliteral -Wno-implicit-fallthrough -Wno-undefined-reinterpret-cast -Wno-disabled-macro-expansion -Wno-zero-as-null-pointer-constant -Wno-shadow -Wno-unknown-warning-option -Wno-atomic-implicit-seq-cst -Wno-extra-semi-stmt") SET(GCC_WARNINGS "-Wall -Werror -Wno-invalid-offsetof -Wno-uninitialized") +IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "e2k") + # suppress warnings that's become errors on mcst-lcc compiler (MCST eLbrus Compiler Collection) + SET(GCC_WARNINGS "${GCC_WARNINGS} -Wno-unused-but-set-variable -Wno-unused-function -Wno-array-bounds -Wno-bad-macro-redef") +ENDIF() + IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # using Clang SET(PHYSX_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -fstrict-aliasing ${CLANG_WARNINGS}" CACHE INTERNAL "PhysX CXX") @@ -56,7 +61,7 @@ SET(CMAKE_CXX_FLAGS_RELEASE ${PHYSX_CXX_FLAGS_RELEASE}) # Controls PX_NVTX for all projects SET(NVTX_FLAG "PX_NVTX=0") -IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") +IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "e2k") SET(CUDA_FLAG "DISABLE_CUDA_PHYSX") ENDIF() diff --git a/physx/source/geomutils/include/GuSIMDHelpers.h b/physx/source/geomutils/include/GuSIMDHelpers.h index caa8e5a6d..c8acb42c3 100644 --- a/physx/source/geomutils/include/GuSIMDHelpers.h +++ b/physx/source/geomutils/include/GuSIMDHelpers.h @@ -72,7 +72,7 @@ namespace Gu const QuatV qV = V4LoadU(&q.x); Vec3V column0V, column1V, column2V; QuatGetMat33V(qV, column0V, column1V, column2V); -#if defined(PX_SIMD_DISABLED) || PX_ANDROID || (PX_LINUX && (PX_ARM || PX_A64)) || (PX_UWP && (PX_ARM || PX_A64)) +#if defined(PX_SIMD_DISABLED) || PX_ANDROID || (PX_LINUX && (PX_ARM || PX_A64 || PX_E2K)) || (PX_UWP && (PX_ARM || PX_A64)) V3StoreU(column0V, column0); V3StoreU(column1V, column1); V3StoreU(column2V, column2); diff --git a/physx/source/physxextensions/src/serialization/SnSerialUtils.cpp b/physx/source/physxextensions/src/serialization/SnSerialUtils.cpp index 282b9810b..f0be74e52 100644 --- a/physx/source/physxextensions/src/serialization/SnSerialUtils.cpp +++ b/physx/source/physxextensions/src/serialization/SnSerialUtils.cpp @@ -39,7 +39,7 @@ using namespace physx; namespace { -#define SN_NUM_BINARY_PLATFORMS 16 +#define SN_NUM_BINARY_PLATFORMS 17 const PxU32 sBinaryPlatformTags[SN_NUM_BINARY_PLATFORMS] = { PX_MAKE_FOURCC('W','_','3','2'), @@ -58,6 +58,7 @@ const PxU32 sBinaryPlatformTags[SN_NUM_BINARY_PLATFORMS] = PX_MAKE_FOURCC('L','A','6','4'), PX_MAKE_FOURCC('W','A','3','2'), PX_MAKE_FOURCC('W','A','6','4'), + PX_MAKE_FOURCC('L','E','2','K'), }; const char* sBinaryPlatformNames[SN_NUM_BINARY_PLATFORMS] = @@ -78,6 +79,7 @@ const char* sBinaryPlatformNames[SN_NUM_BINARY_PLATFORMS] = "linuxaarch64", "uwparm", "uwparm64", + "linuxe2k", }; } @@ -118,6 +120,8 @@ PxU32 getBinaryPlatformTag() return sBinaryPlatformTags[14]; #elif PX_UWP && PX_A64 return sBinaryPlatformTags[15]; +#elif PX_LINUX && PX_E2K + return sBinaryPlatformTags[16]; #else #error Unknown binary platform #endif diff --git a/pxshared/include/foundation/PxPreprocessor.h b/pxshared/include/foundation/PxPreprocessor.h index 12d6147f1..f37d3cd99 100644 --- a/pxshared/include/foundation/PxPreprocessor.h +++ b/pxshared/include/foundation/PxPreprocessor.h @@ -125,6 +125,8 @@ Architecture defines, see http://sourceforge.net/p/predef/wiki/Architectures/ #define PX_ARM 1 #elif defined(__ppc__) || defined(_M_PPC) || defined(__CELLOS_LV2__) #define PX_PPC 1 +#elif defined(__e2k__) +#define PX_E2K 1 #else #error "Unknown architecture" #endif @@ -204,6 +206,9 @@ define anything not defined on this platform to 0 #ifndef PX_PPC #define PX_PPC 0 #endif +#ifndef PX_E2K +#define PX_E2K 0 +#endif #ifndef PX_SSE2 #define PX_SSE2 0 #endif @@ -255,7 +260,7 @@ family shortcuts // architecture #define PX_INTEL_FAMILY (PX_X64 || PX_X86) #define PX_ARM_FAMILY (PX_ARM || PX_A64) -#define PX_P64_FAMILY (PX_X64 || PX_A64) // shortcut for 64-bit architectures +#define PX_P64_FAMILY (PX_X64 || PX_A64 || PX_E2K) // shortcut for 64-bit architectures /** C++ standard library defines