0031-compiler-rt-Enable-__int128-for-ppc32.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 2a622188e62705f20d7806926a99f47f727d8858 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Wed, 9 Mar 2022 16:28:16 -0800
  4. Subject: [PATCH] compiler-rt: Enable __int128 for ppc32
  5. Upstream-Status: Pending
  6. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  7. ---
  8. compiler-rt/lib/builtins/CMakeLists.txt | 15 +++++++--------
  9. compiler-rt/lib/builtins/int_types.h | 2 +-
  10. 2 files changed, 8 insertions(+), 9 deletions(-)
  11. diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
  12. index 2fc70522895f..55f0ecb20a1f 100644
  13. --- a/compiler-rt/lib/builtins/CMakeLists.txt
  14. +++ b/compiler-rt/lib/builtins/CMakeLists.txt
  15. @@ -668,11 +668,9 @@ set(mips64_SOURCES ${GENERIC_TF_SOURCES}
  16. set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
  17. ${mips_SOURCES})
  18. -set(powerpc_SOURCES ${GENERIC_SOURCES})
  19. -
  20. set(powerpcspe_SOURCES ${GENERIC_SOURCES})
  21. -set(powerpc64_SOURCES
  22. +set(powerpc_SOURCES
  23. ppc/divtc3.c
  24. ppc/fixtfdi.c
  25. ppc/fixunstfdi.c
  26. @@ -687,14 +685,15 @@ set(powerpc64_SOURCES
  27. )
  28. # These routines require __int128, which isn't supported on AIX.
  29. if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
  30. - set(powerpc64_SOURCES
  31. + set(powerpc_SOURCES
  32. ppc/floattitf.c
  33. ppc/fixtfti.c
  34. ppc/fixunstfti.c
  35. - ${powerpc64_SOURCES}
  36. + ${powerpc_SOURCES}
  37. )
  38. endif()
  39. -set(powerpc64le_SOURCES ${powerpc64_SOURCES})
  40. +set(powerpc64le_SOURCES ${powerpc_SOURCES})
  41. +set(powerpc64_SOURCES ${powerpc_SOURCES})
  42. set(riscv_SOURCES
  43. riscv/fp_mode.c
  44. @@ -818,9 +817,9 @@ else ()
  45. list(APPEND BUILTIN_CFLAGS_${arch} -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
  46. endif()
  47. - # For RISCV32, we must force enable int128 for compiling long
  48. + # For RISCV32/PPC32, we must force enable int128 for compiling long
  49. # double routines.
  50. - if("${arch}" STREQUAL "riscv32")
  51. + if("${arch}" STREQUAL "riscv32" OR "${arch}" STREQUAL "powerpc" )
  52. list(APPEND BUILTIN_CFLAGS_${arch} -fforce-enable-int128)
  53. endif()
  54. diff --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h
  55. index e94d3154c6d4..37b2cb43f932 100644
  56. --- a/compiler-rt/lib/builtins/int_types.h
  57. +++ b/compiler-rt/lib/builtins/int_types.h
  58. @@ -64,7 +64,7 @@ typedef union {
  59. } udwords;
  60. #if defined(__LP64__) || defined(__wasm__) || defined(__mips64) || \
  61. - defined(__SIZEOF_INT128__) || defined(_WIN64)
  62. + defined(__SIZEOF_INT128__) || defined(_WIN64) || defined(__powerpc__)
  63. #define CRT_HAS_128BIT
  64. #endif