[compiler-rt] aadec60 - [compiler-rt] support armv4t
Ties Stuij via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 1 13:25:15 PST 2022
Author: Ties Stuij
Date: 2022-12-01T21:24:53Z
New Revision: aadec60ad9b81f00cf6fcdcbff61f1144d206769
URL: https://github.com/llvm/llvm-project/commit/aadec60ad9b81f00cf6fcdcbff61f1144d206769
DIFF: https://github.com/llvm/llvm-project/commit/aadec60ad9b81f00cf6fcdcbff61f1144d206769.diff
LOG: [compiler-rt] support armv4t
The main thing that needed changing was excluding functionality that
isn't supported on armv4t. So excluding Arm specific builtin assembly files.
In the process some files were renamed and the source was annotated where
appropriate, so it's a bit easier to follow what group of files are meant for
what purpose.
Reviewed By: peter.smith, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D138725
Added:
Modified:
compiler-rt/cmake/base-config-ix.cmake
compiler-rt/cmake/builtin-config-ix.cmake
compiler-rt/lib/builtins/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index 58aa1a6776dad..0ad95d57fa74c 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -236,9 +236,10 @@ macro(test_targets)
if(WIN32)
test_target_arch(arm "" "" "")
else()
+ test_target_arch(armv4t "" "-march=armv4t" "-mfloat-abi=soft")
+ test_target_arch(armv6m "" "-march=armv6m" "-mfloat-abi=soft")
test_target_arch(arm "" "-march=armv7-a" "-mfloat-abi=soft")
test_target_arch(armhf "" "-march=armv7-a" "-mfloat-abi=hard")
- test_target_arch(armv6m "" "-march=armv6m" "-mfloat-abi=soft")
endif()
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "avr")
test_target_arch(avr "__AVR__" "--target=avr")
diff --git a/compiler-rt/cmake/builtin-config-ix.cmake b/compiler-rt/cmake/builtin-config-ix.cmake
index 0ecf411cda45b..3bc263a1bc4fb 100644
--- a/compiler-rt/cmake/builtin-config-ix.cmake
+++ b/compiler-rt/cmake/builtin-config-ix.cmake
@@ -45,7 +45,7 @@ asm(\"cas w0, w1, [x2]\");
")
set(ARM64 aarch64)
-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main)
+set(ARM32 arm armhf armv4t armv6m armv7m armv7em armv7 armv7s armv7k armv8m.main armv8.1m.main)
set(AVR avr)
set(HEXAGON hexagon)
set(X86 i386)
diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 3eefba8c358b6..4ae2e73ef9bdc 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -375,7 +375,9 @@ else () # MSVC
set(i386_SOURCES ${GENERIC_SOURCES} ${x86_ARCH_SOURCES})
endif () # if (NOT MSVC)
-set(arm_SOURCES
+
+# builtin support for Targets that have Arm state or have Thumb2
+set(arm_or_thumb2_base_SOURCES
arm/fp_mode.c
arm/bswapdi2.S
arm/bswapsi2.S
@@ -385,6 +387,13 @@ set(arm_SOURCES
arm/divmodsi4.S
arm/divsi3.S
arm/modsi3.S
+ arm/udivmodsi4.S
+ arm/udivsi3.S
+ arm/umodsi3.S
+ ${GENERIC_SOURCES}
+)
+
+set(arm_sync_SOURCES
arm/sync_fetch_and_add_4.S
arm/sync_fetch_and_add_8.S
arm/sync_fetch_and_and_4.S
@@ -405,13 +414,11 @@ set(arm_SOURCES
arm/sync_fetch_and_umin_8.S
arm/sync_fetch_and_xor_4.S
arm/sync_fetch_and_xor_8.S
- arm/udivmodsi4.S
- arm/udivsi3.S
- arm/umodsi3.S
- ${GENERIC_SOURCES}
)
-set(thumb1_SOURCES
+# builtin support for Thumb-only targets with very limited Thumb2 technology,
+# such as v6-m and v8-m.baseline
+set(thumb1_base_SOURCES
arm/divsi3.S
arm/udivsi3.S
arm/comparesf2.S
@@ -490,6 +497,8 @@ set(arm_Thumb1_VFPv2_SP_SOURCES
set(arm_Thumb1_icache_SOURCES
arm/sync_synchronize.S
)
+
+# thumb1 calling into Arm to cover support
set(arm_Thumb1_SOURCES
${arm_Thumb1_JT_SOURCES}
${arm_Thumb1_SjLj_EH_SOURCES}
@@ -498,6 +507,13 @@ set(arm_Thumb1_SOURCES
${arm_Thumb1_icache_SOURCES}
)
+# base functionality for Arm Targets prior to Arm v7-a and Armv6-m such as v6,
+# v5t, v4t
+set(arm_min_SOURCES
+ ${arm_or_thumb2_base_SOURCES}
+ ${arm_EABI_SOURCES}
+)
+
if(MINGW)
set(arm_SOURCES
arm/aeabi_idivmod.S
@@ -505,18 +521,24 @@ if(MINGW)
arm/aeabi_uidivmod.S
arm/aeabi_uldivmod.S
arm/chkstk.S
- ${arm_SOURCES}
+ ${arm_or_thumb2_base_SOURCES}
+ ${arm_sync_SOURCES}
+ )
+
+ set(thumb1_SOURCES
+ ${thumb1_base_SOURCES}
)
elseif(NOT WIN32)
# TODO the EABI sources should only be added to EABI targets
set(arm_SOURCES
- ${arm_SOURCES}
+ ${arm_or_thumb2_base_SOURCES}
+ ${arm_sync_SOURCES}
${arm_EABI_SOURCES}
${arm_Thumb1_SOURCES}
)
set(thumb1_SOURCES
- ${thumb1_SOURCES}
+ ${thumb1_base_SOURCES}
${arm_EABI_SOURCES}
)
endif()
@@ -563,6 +585,7 @@ if (MINGW)
)
endif()
+set(armv4t_SOURCES ${arm_min_SOURCES})
set(armhf_SOURCES ${arm_SOURCES})
set(armv7_SOURCES ${arm_SOURCES})
set(armv7s_SOURCES ${arm_SOURCES})
More information about the llvm-commits
mailing list