Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions openmp/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ set(VE FALSE)
set(S390X FALSE)
set(WASM FALSE)
set(PPC FALSE)
set(SPARC FALSE)
set(SPARCV9 FALSE)
if("${LIBOMP_ARCH}" STREQUAL "i386" OR "${LIBOMP_ARCH}" STREQUAL "32") # IA-32 architecture
set(IA32 TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "x86_64" OR "${LIBOMP_ARCH}" STREQUAL "32e") # Intel(R) 64 architecture
Expand Down Expand Up @@ -226,6 +228,10 @@ elseif("${LIBOMP_ARCH}" STREQUAL "s390x") # S390x (Z) architecture
set(S390X TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "wasm32") # WebAssembly architecture
set(WASM TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "sparc") # SPARC architecture
set(SPARC TRUE)
elseif("${LIBOMP_ARCH}" STREQUAL "sparcv9") # SPARC V9 architecture
set(SPARCV9 TRUE)
endif()

# Set some flags based on build_type
Expand Down
20 changes: 10 additions & 10 deletions openmp/runtime/cmake/LibompHandleFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ function(libomp_get_cxxflags cxxflags)
libomp_append(flags_local -Qinline-min-size=1 LIBOMP_HAVE_INLINE_MIN_SIZE_FLAG)
endif()
# Architectural C and C++ flags
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
libomp_append(flags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
if(${IA32})
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
libomp_append(flags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
libomp_append(flags_local /arch:SSE2 LIBOMP_HAVE_ARCH_SSE2_FLAG)
libomp_append(flags_local -msse2 LIBOMP_HAVE_MSSE2_FLAG)
libomp_append(flags_local -falign-stack=maintain-16-byte LIBOMP_HAVE_FALIGN_STACK_FLAG)
Expand All @@ -81,10 +81,10 @@ endfunction()
function(libomp_get_asmflags asmflags)
set(asmflags_local)
# Architectural assembler flags
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
libomp_append(asmflags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
if(${IA32})
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
libomp_append(asmflags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
libomp_append(asmflags_local /safeseh LIBOMP_HAVE_SAFESEH_MASM_FLAG)
libomp_append(asmflags_local /coff LIBOMP_HAVE_COFF_MASM_FLAG)
elseif(${MIC})
Expand Down Expand Up @@ -112,10 +112,10 @@ function(libomp_get_ldflags ldflags)
libomp_append(ldflags_local -static-intel LIBOMP_HAVE_STATIC_INTEL_FLAG)
libomp_append(ldflags_local /SAFESEH LIBOMP_HAVE_SAFESEH_FLAG)
# Architectural linker flags
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
libomp_append(ldflags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
if(${IA32})
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
libomp_append(ldflags_local -m32 LIBOMP_HAVE_M32_FLAG)
endif()
libomp_append(ldflags_local -msse2 LIBOMP_HAVE_MSSE2_FLAG)
elseif(${MIC})
libomp_append(ldflags_local -mmic LIBOMP_HAVE_MMIC_FLAG)
Expand Down Expand Up @@ -162,7 +162,7 @@ endfunction()
# Fortran flags
function(libomp_get_fflags fflags)
set(fflags_local)
if(${IA32})
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
libomp_append(fflags_local -m32 LIBOMP_HAVE_M32_FORTRAN_FLAG)
endif()
set(fflags_local ${fflags_local} ${LIBOMP_FFLAGS})
Expand Down
4 changes: 4 additions & 0 deletions openmp/runtime/cmake/LibompUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ function(libomp_get_legal_arch return_arch_string)
set(${return_arch_string} "VE" PARENT_SCOPE)
elseif(${S390X})
set(${return_arch_string} "S390X" PARENT_SCOPE)
elseif(${SPARC})
set(${return_arch_string} "SPARC" PARENT_SCOPE)
elseif(${SPARCV9})
set(${return_arch_string} "SPARCV9" PARENT_SCOPE)
else()
set(${return_arch_string} "${LIBOMP_ARCH}" PARENT_SCOPE)
libomp_warning_say("libomp_get_legal_arch(): Warning: Unknown architecture: Using ${LIBOMP_ARCH}")
Expand Down
Loading