From: Khem Raj Date: Sun, 24 Jul 2022 17:17:22 +0000 (-0700) Subject: [compiler-rt][CMake] Enable TF intrinsics on powerpc32 Linux X-Git-Tag: upstream/15.0.7~649 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f24a56a3a9363f353c8da318d97491a6818781d;p=platform%2Fupstream%2Fllvm.git [compiler-rt][CMake] Enable TF intrinsics on powerpc32 Linux clang generates calls to these intrinsics when used for ppc32/linux, when using libgcc this works ok but when using compiler-rt for rtlib it fails with missing intrinsic symbols. also see [1] [1] https://lists.llvm.org/pipermail/llvm-dev/2014-May/072784.html Reviewed By: MaskRay, glaubitz Differential Revision: https://reviews.llvm.org/D121379 --- diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index 795fe2a..0b91b4c 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -621,11 +621,9 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES} set(mips64el_SOURCES ${GENERIC_TF_SOURCES} ${mips_SOURCES}) -set(powerpc_SOURCES ${GENERIC_SOURCES}) - set(powerpcspe_SOURCES ${GENERIC_SOURCES}) -set(powerpc64_SOURCES +set(powerpc_SOURCES ppc/divtc3.c ppc/fixtfdi.c ppc/fixunstfdi.c @@ -640,14 +638,15 @@ set(powerpc64_SOURCES ) # These routines require __int128, which isn't supported on AIX. if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX") - set(powerpc64_SOURCES + set(powerpc_SOURCES ppc/floattitf.c ppc/fixtfti.c ppc/fixunstfti.c - ${powerpc64_SOURCES} + ${powerpc_SOURCES} ) endif() -set(powerpc64le_SOURCES ${powerpc64_SOURCES}) +set(powerpc64le_SOURCES ${powerpc_SOURCES}) +set(powerpc64_SOURCES ${powerpc_SOURCES}) set(riscv_SOURCES riscv/save.S @@ -754,9 +753,8 @@ else () list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET) endif() - # For RISCV32, we must force enable int128 for compiling long - # double routines. - if("${arch}" STREQUAL "riscv32") + # For some arches, force enable int128 for compiling long double routines. + if("${arch}" STREQUAL "powerpc" OR "${arch}" STREQUAL "riscv32") list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128) endif() diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h index 7a72de4..9ee5a32 100644 --- a/compiler-rt/lib/builtins/int_types.h +++ b/compiler-rt/lib/builtins/int_types.h @@ -64,7 +64,7 @@ typedef union { } udwords; #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \ - defined(__riscv) || defined(_WIN64) + defined(__riscv) || defined(_WIN64) || defined(__powerpc__) #define CRT_HAS_128BIT #endif