Skip to content
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
10 changes: 10 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ check_type_size("void*" CMAKE_SIZEOF_VOID_P)
set(X86_64 OFF)
set(ARM32 OFF)
set(ARM64 OFF)
set(PPC64 OFF)
set(PPC64LE OFF)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
set(ARM32 ON)
set(Architecture "arm")
Expand All @@ -75,7 +77,11 @@ check_type_size("void*" CMAKE_SIZEOF_VOID_P)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc")
set(Architecture "ppc")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc64")
set(PPC64 ON)
set(Architecture "ppc64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
set(PPC64LE ON)
set(Architecture "ppc64le")
else()
set(Architecture "${CMAKE_SYSTEM_PROCESSOR}")
endif()
Expand Down Expand Up @@ -113,6 +119,10 @@ if(APPLE AND X86_64)
set(compiler_flags_release ${compiler_flags_global})
elseif(X86_64)
set(compiler_flags_release ${compiler_flags_global})
elseif(PPC64LE)
set(compiler_flags_release ${compiler_flags_global} -mcpu=power8)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POWER8 is the first to support Little Endian. This is the lowest common value for all CPUs that supports LE for example POWER8, POWER9 and POWER10

ref: https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.0?topic=options-mcpu

elseif(PPC64)
set(compiler_flags_release ${compiler_flags_global} -mcpu=powerpc64)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback to generic 64bit PPC64 if not LE

else()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(compiler_flags_release ${compiler_flags_global} -march=i686 -Winline -ffast-math -fomit-frame-pointer -finline-functions)
Expand Down
7 changes: 2 additions & 5 deletions src/qcommon/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3616,14 +3616,11 @@ static void Sys_GetProcessorId( char *vendor )
Com_sprintf( vendor, 128, "%s %s", ARCH_STRING, (const char*)getauxval( AT_PLATFORM ) );
#endif
#endif // !arm32
}

#if idppc || idppc64
static void Sys_GetProcessorId( char *vendor )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To address the build error:

/home/tle/Work/ETe/src/qcommon/common.c:3622:13: error: redefinition of ‘Sys_GetProcessorId’
 3622 | static void Sys_GetProcessorId( char *vendor )
      |             ^~~~~~~~~~~~~~~~~~

{
Com_sprintf( vendor, 100, "%s", ARCH_STRING );
}
Com_sprintf( vendor, 100, "%s", ARCH_STRING );
#endif
}

#endif // __linux__

Expand Down