Skip to content

Commit fb0b039

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

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
@@ -749,11 +749,9 @@ set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
749749

750750
set(nvptx64_SOURCES ${GENERIC_SOURCES})
751751

752-
set(powerpc_SOURCES ${GENERIC_SOURCES})
753-
754752
set(powerpcspe_SOURCES ${GENERIC_SOURCES})
755753

756-
set(powerpc64_SOURCES
754+
set(powerpc_SOURCES
757755
ppc/divtc3.c
758756
ppc/fixtfdi.c
759757
ppc/fixunstfdi.c
@@ -768,14 +766,15 @@ set(powerpc64_SOURCES
768766
)
769767
# These routines require __int128, which isn't supported on AIX.
770768
if (NOT OS_NAME MATCHES "AIX")
771-
set(powerpc64_SOURCES
769+
set(powerpc_SOURCES
772770
ppc/floattitf.c
773771
ppc/fixtfti.c
774772
ppc/fixunstfti.c
775-
${powerpc64_SOURCES}
773+
${powerpc_SOURCES}
776774
)
777775
endif()
778-
set(powerpc64le_SOURCES ${powerpc64_SOURCES})
776+
set(powerpc64le_SOURCES ${powerpc_SOURCES})
777+
set(powerpc64_SOURCES ${powerpc_SOURCES})
779778

780779
set(riscv_SOURCES
781780
cpu_model/riscv.c
@@ -945,9 +944,9 @@ else ()
945944
list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
946945
endif()
947946

948-
# For RISCV32, we must force enable int128 for compiling long
947+
# For RISCV32/PPC32, we must force enable int128 for compiling long
949948
# double routines.
950-
if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32")
949+
if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc")
951950
list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128)
952951
endif()
953952

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)