[test-suite] r337326 - [SPECCPU2017] Add additional platform options and missing flags.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 17 13:44:18 PDT 2018
Author: meinersbur
Date: Tue Jul 17 13:44:18 2018
New Revision: 337326
URL: http://llvm.org/viewvc/llvm-project?rev=337326&view=rev
Log:
[SPECCPU2017] Add additional platform options and missing flags.
Add portability flags for 64-bit Windows and Linux on ARM.
Also add missing SPEC and SPEC_CPU flags without which the compilation
could fail on these platforms.
Differential Revision: https://reviews.llvm.org/D48442
Modified:
test-suite/trunk/External/SPEC/CINT2017rate/525.x264_r/CMakeLists.txt
test-suite/trunk/External/SPEC/SpecCPU2017.cmake
Modified: test-suite/trunk/External/SPEC/CINT2017rate/525.x264_r/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/CINT2017rate/525.x264_r/CMakeLists.txt?rev=337326&r1=337325&r2=337326&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/CINT2017rate/525.x264_r/CMakeLists.txt (original)
+++ test-suite/trunk/External/SPEC/CINT2017rate/525.x264_r/CMakeLists.txt Tue Jul 17 13:44:18 2018
@@ -180,7 +180,7 @@ foreach (_file IN LISTS ldecod_SourceNam
endforeach ()
llvm_add_host_executable(ldecod_${SUFFIX}-host
ldecod_${SUFFIX} ${ldecod_Sources}
- CPPFLAGS -I "${SRC_DIR}/ldecod_src/inc"
+ CPPFLAGS -I "${SRC_DIR}/ldecod_src/inc" -DSPEC
LDFLAGS -lm
)
Modified: test-suite/trunk/External/SPEC/SpecCPU2017.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/SpecCPU2017.cmake?rev=337326&r1=337325&r2=337326&view=diff
==============================================================================
--- test-suite/trunk/External/SPEC/SpecCPU2017.cmake (original)
+++ test-suite/trunk/External/SPEC/SpecCPU2017.cmake Tue Jul 17 13:44:18 2018
@@ -106,7 +106,7 @@ macro (speccpu2017_benchmark)
# Mandatory flags
- add_definitions(-DSPEC -DNDEBUG)
+ add_definitions(-DSPEC -DSPEC_CPU -DNDEBUG)
if (RATE)
# rate benchmarks never use parallelism
@@ -114,12 +114,34 @@ macro (speccpu2017_benchmark)
endif ()
# Portability flags
- if(ARCH STREQUAL "x86" AND TARGET_OS STREQUAL "Linux")
- add_definitions(-DSPEC_LINUX) # 526.blender_r
+ if (ENDIAN STREQUAL "little")
add_definitions(-DSPEC_AUTO_BYTEORDER=0x12345678)
+ elseif (ENDIAN STREQUAL "big")
+ add_definitions(-DSPEC_AUTO_BYTEORDER=0x87654321)
+ endif ()
+
+ check_type_size("long long" SIZEOF_LONG_LONG)
+ check_type_size("long" SIZEOF_LONG)
+ check_type_size("int" SIZEOF_INT)
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND SIZEOF_LONG_LONG EQUAL 8 AND SIZEOF_LONG EQUAL 4 AND SIZEOF_INT EQUAL 4)
+ add_definitions(-DSPEC_ILP32)
+ elseif (CMAKE_SIZEOF_VOID_P EQUAL 8 AND SIZEOF_LONG_LONG EQUAL 8 AND SIZEOF_LONG EQUAL 4 AND SIZEOF_INT EQUAL 4)
+ add_definitions(-DSPEC_P64)
+ elseif (CMAKE_SIZEOF_VOID_P EQUAL 8 AND SIZEOF_LONG_LONG EQUAL 8 AND SIZEOF_LONG EQUAL 8 AND SIZEOF_INT EQUAL 4)
+ add_definitions(-DSPEC_LP64)
+ elseif (CMAKE_SIZEOF_VOID_P EQUAL 8 AND SIZEOF_LONG_LONG EQUAL 8 AND SIZEOF_LONG EQUAL 8 AND SIZEOF_INT EQUAL 8)
+ add_definitions(-DSPEC_ILP64)
+ else ()
+ message(FATAL_ERROR "SPEC CPU 2017 unsupported data model (supported: ILP32/LLP64/LP64/ILP64)")
+ endif ()
+
+ if (TARGET_OS STREQUAL "Linux")
+ add_definitions(-DSPEC_LINUX) # 526.blender_r
+ endif ()
+
+ if(ARCH STREQUAL "x86" AND TARGET_OS STREQUAL "Linux")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
# Linux x86_64
- add_definitions(-DSPEC_LP64)
add_definitions(-DSPEC_LINUX_X64) # perlbench
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
# Linux x86
@@ -127,7 +149,15 @@ macro (speccpu2017_benchmark)
add_definitions(-D_FILE_OFFSET_BITS=64)
add_definitions(-DSPEC_LINUX_I32) # perlbench
endif ()
+ elseif (ARCH STREQUAL "AArch64" AND TARGET_OS STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # Linux ARM
+ add_definitions(-DSPEC_LINUX_AARCH64)
+ elseif (ARCH STREQUAL "x86" AND TARGET_OS STREQUAL "Windows")
+ # Windows x86/x64
else ()
+ message("ARCH: ${ARCH}")
+ message("TARGET_OS: ${TARGET_OS}")
+ message("CMAKE_SIZEOF_VOID_P: ${CMAKE_SIZEOF_VOID_P}")
message(FATAL_ERROR
"Don't know portability flags for SPEC CPU 2017 on this platform")
endif ()
@@ -228,6 +258,7 @@ macro(speccpu2017_validate_image _imgfil
llvm_add_host_executable(
${VALIDATOR}-host ${VALIDATOR} ${_validator_sources}
LDFLAGS -lm
+ CPPFLAGS -DSPEC
)
endif ()
More information about the llvm-commits
mailing list