Skip to content

Commit 4a7c51c

Browse files
committed
compiler-rt: Enable __int128 for ppc32
Upstream-Status: Pending Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent a8b586a commit 4a7c51c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

compiler-rt/lib/builtins/CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,9 @@ set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
752752

753753
set(nvptx64_SOURCES ${GENERIC_SOURCES})
754754

755-
set(powerpc_SOURCES ${GENERIC_SOURCES})
756-
757755
set(powerpcspe_SOURCES ${GENERIC_SOURCES})
758756

759-
set(powerpc64_SOURCES
757+
set(powerpc_SOURCES
760758
ppc/divtc3.c
761759
ppc/fixtfdi.c
762760
ppc/fixunstfdi.c
@@ -771,14 +769,15 @@ set(powerpc64_SOURCES
771769
)
772770
# These routines require __int128, which isn't supported on AIX.
773771
if (NOT OS_NAME MATCHES "AIX")
774-
set(powerpc64_SOURCES
772+
set(powerpc_SOURCES
775773
ppc/floattitf.c
776774
ppc/fixtfti.c
777775
ppc/fixunstfti.c
778-
${powerpc64_SOURCES}
776+
${powerpc_SOURCES}
779777
)
780778
endif()
781-
set(powerpc64le_SOURCES ${powerpc64_SOURCES})
779+
set(powerpc64le_SOURCES ${powerpc_SOURCES})
780+
set(powerpc64_SOURCES ${powerpc_SOURCES})
782781

783782
set(riscv_SOURCES
784783
cpu_model/riscv.c
@@ -948,9 +947,9 @@ else ()
948947
list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
949948
endif()
950949

951-
# For RISCV32, we must force enable int128 for compiling long
950+
# For RISCV32/PPC32, we must force enable int128 for compiling long
952951
# double routines.
953-
if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32")
952+
if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc")
954953
list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128)
955954
endif()
956955

compiler-rt/lib/builtins/int_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ typedef union {
6464
} udwords;
6565

6666
#if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \
67-
defined(__SIZEOF_INT128__) || defined(_WIN64)
67+
defined(__SIZEOF_INT128__) || defined(_WIN64) || defined(__powerpc__)
6868
#define CRT_HAS_128BIT
6969
#endif
7070

0 commit comments

Comments
 (0)