Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2K: added initial support of MCST Elbrus 2000 CPU architecture #646

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions externals/cmakemodules/GetCompilerAndPlatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
10 changes: 10 additions & 0 deletions physx/buildtools/cmake_generate_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
12 changes: 12 additions & 0 deletions physx/buildtools/presets/public/linux-e2k.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<preset name="linux-e2k" comment="Linux-e2k mcst-lcc (gcc compatible) PhysX SDK general settings">
<platform targetPlatform="linuxE2K" compiler="gcc" />
<CMakeSwitches>
<cmakeSwitch name="PX_BUILDSNIPPETS" value="True" comment="Generate the snippets" />
<cmakeSwitch name="PX_BUILDPUBLICSAMPLES" value="False" comment="Generate the samples" />
<cmakeSwitch name="PX_GENERATE_STATIC_LIBRARIES" value="True" comment="Generate static libs" />
</CMakeSwitches>
<CMakeParams>
<cmakeParam name="CMAKE_INSTALL_PREFIX" value="install/linux-e2k/PhysX" comment="Install path relative to PhysX SDK root" />
</CMakeParams>
</preset>
2 changes: 1 addition & 1 deletion physx/snippets/compiler/cmake/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions physx/snippets/compiler/cmake/linux/SnippetTemplate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
)
Expand Down
7 changes: 6 additions & 1 deletion physx/source/compiler/cmake/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion physx/source/geomutils/include/GuSIMDHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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] =
Expand All @@ -78,6 +79,7 @@ const char* sBinaryPlatformNames[SN_NUM_BINARY_PLATFORMS] =
"linuxaarch64",
"uwparm",
"uwparm64",
"linuxe2k",
};

}
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion pxshared/include/foundation/PxPreprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down