Skip to content

Commit b3f4da8

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

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

749749
set(nvptx64_SOURCES ${GENERIC_SOURCES})
750750

751-
set(powerpc_SOURCES ${GENERIC_SOURCES})
752-
753751
set(powerpcspe_SOURCES ${GENERIC_SOURCES})
754752

755-
set(powerpc64_SOURCES
753+
set(powerpc_SOURCES
756754
ppc/divtc3.c
757755
ppc/fixtfdi.c
758756
ppc/fixunstfdi.c
@@ -767,14 +765,15 @@ set(powerpc64_SOURCES
767765
)
768766
# These routines require __int128, which isn't supported on AIX.
769767
if (NOT OS_NAME MATCHES "AIX")
770-
set(powerpc64_SOURCES
768+
set(powerpc_SOURCES
771769
ppc/floattitf.c
772770
ppc/fixtfti.c
773771
ppc/fixunstfti.c
774-
${powerpc64_SOURCES}
772+
${powerpc_SOURCES}
775773
)
776774
endif()
777-
set(powerpc64le_SOURCES ${powerpc64_SOURCES})
775+
set(powerpc64le_SOURCES ${powerpc_SOURCES})
776+
set(powerpc64_SOURCES ${powerpc_SOURCES})
778777

779778
set(riscv_SOURCES
780779
cpu_model/riscv.c
@@ -940,9 +939,9 @@ else ()
940939
list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
941940
endif()
942941

943-
# For RISCV32, we must force enable int128 for compiling long
942+
# For RISCV32/PPC32, we must force enable int128 for compiling long
944943
# double routines.
945-
if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32")
944+
if(COMPILER_RT_ENABLE_SOFTWARE_INT128 OR "${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc")
946945
list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128)
947946
endif()
948947

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)