Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Detect VFP Size at compile time #27890

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions _build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ usage()
echo ""
echo "Common Options:"
echo ""
echo "BuildArch can be: -x64, -x86, -arm, -armel, -arm64"
echo "BuildArch can be: -x64, -x86, -arm, -armel, -armv7d16, -arm64"
echo "BuildType can be: -debug, -checked, -release"
echo "-bindir - output directory (defaults to $__ProjectRoot/bin)"
echo "-clang - optional argument to build using clang in PATH (default)."
Expand Down Expand Up @@ -178,6 +178,10 @@ while :; do
__BuildArch=armel
;;

armv7d16|-armv7d16)
__BuildArch=armv7d16
;;

bindir|-bindir)
if [ -n "$2" ]; then
__RootBinDir="$2"
Expand Down Expand Up @@ -415,7 +419,7 @@ fi

# Set default clang version
if [ "$__ClangMajorVersion" = 0 ] && [ "$__ClangMinorVersion" = 0 ]; then
if [ "$__BuildArch" = "arm" ] || [ "$__BuildArch" = "armel" ]; then
if [ "$__BuildArch" = "arm" ] || [ "$__BuildArch" = "armel" ] || [ "$__BuildArch" = "armv7d16" ]; then
__ClangMajorVersion=5
__ClangMinorVersion=0
else
Expand Down
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ check_prereqs()
echo "Please install CMake 3.14 or newer from http://www.cmake.org/download/ or https://apt.kitware.com and ensure it is on your path."; exit 1;
fi

# Minimum required version of clang is version 4.0 for arm/armel cross build
if [[ $__CrossBuild == 1 && $__GccBuild == 0 && ("$__BuildArch" == "arm" || "$__BuildArch" == "armel") ]]; then
# Minimum required version of clang is version 4.0 for arm/armel/armv7d16 cross build
if [[ $__CrossBuild == 1 && $__GccBuild == 0 && ("$__BuildArch" == "arm" || "$__BuildArch" == "armel" || "$__BuildArch" == "armv7d16") ]]; then
if ! [[ "$__ClangMajorVersion" -ge "4" ]]; then
echo "Please install clang4.0 or latest for arm/armel cross build"; exit 1;
echo "Please install clang4.0 or latest for arm/armel/armv7d16 cross build"; exit 1;
fi
fi

Expand Down Expand Up @@ -288,7 +288,7 @@ build_cross_architecture_components()

__SkipCrossArchBuild=1
# check supported cross-architecture components host(__HostArch)/target(__BuildArch) pair
if [[ ("$__BuildArch" == "arm" || "$__BuildArch" == "armel") && ("$__CrossArch" == "x86" || "$__CrossArch" == "x64") ]]; then
if [[ ("$__BuildArch" == "arm" || "$__BuildArch" == "armel" || "$__BuildArch" == "armv7d16") && ("$__CrossArch" == "x86" || "$__CrossArch" == "x64") ]]; then
__SkipCrossArchBuild=0
elif [[ "$__BuildArch" == "arm64" && "$__CrossArch" == "x64" ]]; then
__SkipCrossArchBuild=0
Expand Down
4 changes: 2 additions & 2 deletions clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
add_definitions(-DDBG_TARGET_64BIT)
add_definitions(-DDBG_TARGET_ARM64)
add_definitions(-DFEATURE_MULTIREG_RETURN)
elseif (CLR_CMAKE_TARGET_ARCH_ARM)
elseif (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARMV7D16)
if (CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DDBG_TARGET_ARM_UNIX)
elseif (WIN32 AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD)
Expand Down Expand Up @@ -63,7 +63,7 @@ if (CLR_CMAKE_PLATFORM_UNIX)

if (CLR_CMAKE_TARGET_ARCH_AMD64)
add_definitions(-DUNIX_AMD64_ABI)
elseif (CLR_CMAKE_TARGET_ARCH_ARM)
elseif (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARMV7D16)
add_definitions(-DUNIX_ARM_ABI)
elseif (CLR_CMAKE_TARGET_ARCH_I386)
add_definitions(-DUNIX_X86_ABI)
Expand Down
39 changes: 31 additions & 8 deletions configurecompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Set initial flags for each configuration
#ramel Set initial flags for each configuration

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_C_STANDARD 11)
Expand Down Expand Up @@ -29,7 +29,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
if(CLR_CROSS_COMPONENTS_BUILD)
# CMAKE_HOST_SYSTEM_PROCESSOR returns the value of `uname -p` on host.
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL amd64)
if(CLR_CMAKE_TARGET_ARCH STREQUAL "arm" OR CLR_CMAKE_TARGET_ARCH STREQUAL "armel")
if(CLR_CMAKE_TARGET_ARCH STREQUAL "arm" OR CLR_CMAKE_TARGET_ARCH STREQUAL "armel" OR CLR_CMAKE_TARGET_ARCH STREQUAL "armv7d16")
if(CMAKE_CROSSCOMPILING)
set(CLR_CMAKE_PLATFORM_UNIX_X86 1)
else()
Expand All @@ -52,6 +52,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CLR_CMAKE_PLATFORM_UNIX_AMD64 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
set(CLR_CMAKE_PLATFORM_UNIX_ARM 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7d16)
set(CLR_CMAKE_PLATFORM_UNIX_ARMV7D16 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
set(CLR_CMAKE_PLATFORM_UNIX_ARM 1)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
Expand Down Expand Up @@ -138,7 +140,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/configureoptimization.cmake)
# - for complete list of such binaries refer to file crosscomponents.cmake
#-------------------------------------------------------------
# Set HOST architecture variables
if(CLR_CMAKE_PLATFORM_UNIX_ARM)
if(CLR_CMAKE_PLATFORM_UNIX_ARMV7D16)
set(CLR_CMAKE_PLATFORM_ARCH_ARMV7D16 1)
set(CLR_CMAKE_HOST_ARCH "armv7d16")
elseif(CLR_CMAKE_PLATFORM_UNIX_ARM)
set(CLR_CMAKE_PLATFORM_ARCH_ARM 1)
set(CLR_CMAKE_HOST_ARCH "arm")
elseif(CLR_CMAKE_PLATFORM_UNIX_ARM64)
Expand Down Expand Up @@ -181,6 +186,8 @@ if (CLR_CMAKE_TARGET_ARCH STREQUAL x64)
set(CLR_CMAKE_TARGET_ARCH_ARM64 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm)
set(CLR_CMAKE_TARGET_ARCH_ARM 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armv7d16)
set(CLR_CMAKE_TARGET_ARCH_ARMV7D16 1)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL armel)
set(CLR_CMAKE_TARGET_ARCH_ARM 1)
set(ARM_SOFTFP 1)
Expand All @@ -190,7 +197,7 @@ endif()

# check if host & target arch combination are valid
if(NOT(CLR_CMAKE_TARGET_ARCH STREQUAL CLR_CMAKE_HOST_ARCH))
if(NOT((CLR_CMAKE_PLATFORM_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM64) OR (CLR_CMAKE_PLATFORM_ARCH_I386 AND CLR_CMAKE_TARGET_ARCH_ARM) OR (CLR_CMAKE_PLATFORM_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM)))
if(NOT((CLR_CMAKE_PLATFORM_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM64) OR (CLR_CMAKE_PLATFORM_ARCH_I386 AND CLR_CMAKE_TARGET_ARCH_ARM) OR (CLR_CMAKE_PLATFORM_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM) OR (CLR_CMAKE_PLATFORM_ARCH_I386 AND CLR_CMAKE_TARGET_ARCH_ARMV7D16) OR (CLR_CMAKE_PLATFORM_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARMV7D16)))
message(FATAL_ERROR "Invalid host and target arch combination")
endif()
endif()
Expand Down Expand Up @@ -378,6 +385,11 @@ elseif (CLR_CMAKE_PLATFORM_ARCH_I386)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM)
add_definitions(-D_ARM_)
add_definitions(-DARM)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARMV7D16)
add_definitions(-D_ARMV7D16_)
add_definitions(-DARMV7D16)
add_definitions(-D_ARM_)
add_definitions(-DARM)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_definitions(-D_ARM64_)
add_definitions(-DARM64)
Expand All @@ -391,6 +403,9 @@ if (CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
message("Detected Linux x86_64")
add_definitions(-DLINUX64)
elseif(CLR_CMAKE_PLATFORM_UNIX_ARMV7D16)
message("Detected Linux ARMv7D16")
add_definitions(-DLINUX32)
elseif(CLR_CMAKE_PLATFORM_UNIX_ARM)
message("Detected Linux ARM")
add_definitions(-DLINUX32)
Expand Down Expand Up @@ -438,6 +453,8 @@ elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
set(ARCH_SOURCES_DIR arm64)
elseif (CLR_CMAKE_TARGET_ARCH_ARM)
set(ARCH_SOURCES_DIR arm)
elseif (CLR_CMAKE_TARGET_ARCH_ARMV7D16)
set(ARCH_SOURCES_DIR arm)
elseif (CLR_CMAKE_TARGET_ARCH_I386)
set(ARCH_SOURCES_DIR i386)
else ()
Expand Down Expand Up @@ -535,7 +552,13 @@ if (CLR_CMAKE_PLATFORM_UNIX)
endif(CLR_CMAKE_PLATFORM_DARWIN)
endif(CLR_CMAKE_PLATFORM_UNIX)

if(CLR_CMAKE_PLATFORM_UNIX_ARM)
if(CLR_CMAKE_PLATFORM_UNIX_ARMV7D16)
# Because we don't use CMAKE_C_COMPILER/CMAKE_CXX_COMPILER to use clang
# we have to set the triple by adding a compiler argument
add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3-d16)
add_compile_options(-march=armv7-a)
elseif(CLR_CMAKE_PLATFORM_UNIX_ARM)
# Because we don't use CMAKE_C_COMPILER/CMAKE_CXX_COMPILER to use clang
# we have to set the triple by adding a compiler argument
add_compile_options(-mthumb)
Expand All @@ -545,7 +568,7 @@ if(CLR_CMAKE_PLATFORM_UNIX_ARM)
add_definitions(-DARM_SOFTFP)
add_compile_options(-mfloat-abi=softfp)
endif(ARM_SOFTFP)
endif(CLR_CMAKE_PLATFORM_UNIX_ARM)
endif()

if(CLR_CMAKE_PLATFORM_UNIX)
add_compile_options(${CLR_ADDITIONAL_COMPILER_OPTIONS})
Expand Down Expand Up @@ -609,10 +632,10 @@ if (MSVC)

add_compile_options($<$<COMPILE_LANGUAGE:ASM_MASM>:/ZH:SHA_256>)

if (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
if (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARMV7D16)
# Contracts work too slow on ARM/ARM64 DEBUG/CHECKED.
add_definitions(-DDISABLE_CONTRACTS)
endif (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
endif (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARMV7D16)

endif (MSVC)

Expand Down
2 changes: 1 addition & 1 deletion configuretools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if(NOT WIN32)

if (NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
if (CMAKE_CROSSCOMPILING AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm OR CMAKE_SYSTEM_PROCESSOR STREQUAL armv7d16)
find_program(OBJCOPY ${TOOLCHAIN}-objcopy)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL i686)
find_program(OBJCOPY objcopy)
Expand Down
22 changes: 16 additions & 6 deletions eng/common/cross/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ if(TARGET_ARCH_NAME STREQUAL "armel")
if("$ENV{__DistroRid}" MATCHES "tizen.*")
set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/6.2.1")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "armv7d16")
set(CMAKE_SYSTEM_PROCESSOR armv7d16)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
set(TOOLCHAIN "armv6-alpine-linux-musleabihf")
else()
set(TOOLCHAIN "arm-linux-gnueabihf")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm")
set(CMAKE_SYSTEM_PROCESSOR armv7l)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
Expand All @@ -28,7 +35,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86")
set(CMAKE_SYSTEM_PROCESSOR i686)
set(TOOLCHAIN "i686-linux-gnu")
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!")
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv7d16, arm64 and x86 are supported!")
endif()

if(DEFINED ENV{TOOLCHAIN})
Expand Down Expand Up @@ -63,13 +70,16 @@ endif()

# Specify compile options

if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$")
if(TARGET_ARCH_NAME MATCHES "^(arm|armv7d16|armel|arm64)$")
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
endif()

if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
if(TARGET_ARCH_NAME MATCHES "^(armv7d16)$")
add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3-d16)
elseif(TARGET_ARCH_NAME MATCHES "^(arm|armel)$")
add_compile_options(-mthumb)
add_compile_options(-mfpu=vfpv3)
if(TARGET_ARCH_NAME STREQUAL "armel")
Expand All @@ -85,10 +95,10 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86")
endif()

# Set LLDB include and library paths for builds that need lldb.
if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$")
if(TARGET_ARCH_NAME MATCHES "^(arm|armv7d16|armel|x86)$")
if(TARGET_ARCH_NAME STREQUAL "x86")
set(LLVM_CROSS_DIR "$ENV{LLVM_CROSS_HOME}")
else() # arm/armel case
else() # arm/armel/armv7d16 case
set(LLVM_CROSS_DIR "$ENV{LLVM_ARM_HOME}")
endif()
if(LLVM_CROSS_DIR)
Expand All @@ -105,7 +115,7 @@ if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$")
else()
set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include")
endif()
else() # arm/armel case
else() # arm/armel/armv7d16 case
set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}" CACHE STRING "")
set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include" CACHE STRING "")
endif()
Expand Down
5 changes: 4 additions & 1 deletion init-distro-rid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ initDistroRidGlobal()
export __PortableBuild=0
isPortable=0
fi
if [ "$buildArch" = "armv7d16" ]; then
buildArch=arm
fi

initNonPortableDistroRid ${buildOs} ${buildArch} ${isPortable} ${rootfsDir}

Expand Down Expand Up @@ -185,4 +188,4 @@ initDistroRidGlobal()

export __RuntimeId=${__DistroRid}
fi
}
}
4 changes: 2 additions & 2 deletions src/debug/ee/wks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (WIN32)

set(ASM_FILE ${CORDBEE_DIR}/${ARCH_SOURCES_DIR}/dbghelpers.asm)

if(CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
if(CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARMV7D16 OR CLR_CMAKE_PLATFORM_ARCH_ARM64)

preprocess_compile_asm(ASM_FILES ${ASM_FILE} OUTPUT_OBJECTS ASM_OBJECTS)

Expand All @@ -29,7 +29,7 @@ if (WIN32)

else ()

if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARM64 OR CLR_CMAKE_PLATFORM_ARCH_I386)
if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARM64 OR CLR_CMAKE_PLATFORM_ARCH_I386 OR CLR_CMAKE_PLATFORM_ARCH_ARMV7D16)
add_library_clr(cordbee_wks ${CORDBEE_SOURCES_WKS} ../${ARCH_SOURCES_DIR}/dbghelpers.S)
else()
message(FATAL_ERROR "Unknown platform")
Expand Down
2 changes: 1 addition & 1 deletion src/dlls/mscordac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ else(WIN32)

set(REDEFINES_FILE_AWK_SCRIPT ${CMAKE_SOURCE_DIR}/generateredefinesfile.awk)

if (CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
if (CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARMV7D16 OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
set(JUMP_INSTRUCTION b)
else()
set(JUMP_INSTRUCTION jmp)
Expand Down
2 changes: 1 addition & 1 deletion src/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if(WIN32)
list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_AMD64)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM64)
list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_ARM64)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARMV7D16)
list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_ARM)
elseif (CLR_CMAKE_PLATFORM_ARCH_I386)
list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_X86)
Expand Down
2 changes: 1 addition & 1 deletion src/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ set( JIT_ARM64_SOURCES

if(CLR_CMAKE_TARGET_ARCH_AMD64)
set(JIT_ARCH_SOURCES ${JIT_AMD64_SOURCES})
elseif(CLR_CMAKE_TARGET_ARCH_ARM)
elseif(CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARMV7D16)
set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES})
elseif(CLR_CMAKE_TARGET_ARCH_I386)
set(JIT_ARCH_SOURCES ${JIT_I386_SOURCES})
Expand Down
12 changes: 8 additions & 4 deletions src/pal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)

add_subdirectory(libunwind)
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
if(PAL_CMAKE_PLATFORM_ARCH_ARM)
if(PAL_CMAKE_PLATFORM_ARCH_ARM OR PAL_CMAKE_PLATFORM_ARCH_ARMV7D16)
find_library(UNWIND_ARCH NAMES unwind-arm)
endif()

Expand Down Expand Up @@ -93,6 +93,10 @@ else()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
set(PAL_CMAKE_PLATFORM_ARCH_ARM 1)
add_definitions(-D_ARM_)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7d16)
set(PAL_CMAKE_PLATFORM_ARCH_ARMV7D16 1)
add_definitions(-D_ARM_)
add_definitions(-D_ARMV7D16_)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
set(PAL_CMAKE_PLATFORM_ARCH_ARM 1)
add_definitions(-D_ARM_)
Expand Down Expand Up @@ -131,7 +135,7 @@ add_definitions(-D_FILE_OFFSET_BITS=64)
if(PAL_CMAKE_PLATFORM_ARCH_AMD64)
add_definitions(-DBIT64)
set(PAL_ARCH_SOURCES_DIR amd64)
elseif(PAL_CMAKE_PLATFORM_ARCH_ARM)
elseif(PAL_CMAKE_PLATFORM_ARCH_ARM OR PAL_CMAKE_PLATFORM_ARCH_ARMV7D16)
add_definitions(-DBIT32)
set(PAL_ARCH_SOURCES_DIR arm)
elseif(PAL_CMAKE_PLATFORM_ARCH_ARM64)
Expand Down Expand Up @@ -172,11 +176,11 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
)
endif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)

if(PAL_CMAKE_PLATFORM_ARCH_ARM)
if(PAL_CMAKE_PLATFORM_ARCH_ARM OR PAL_CMAKE_PLATFORM_ARCH_ARMV7D16)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_source_files_properties(exception/seh.cpp PROPERTIES COMPILE_FLAGS -Wno-error=inline-asm)
endif()
endif(PAL_CMAKE_PLATFORM_ARCH_ARM)
endif(PAL_CMAKE_PLATFORM_ARCH_ARM OR PAL_CMAKE_PLATFORM_ARCH_ARMV7D16)

set(SOURCES
cruntime/file.cpp
Expand Down
11 changes: 11 additions & 0 deletions src/pal/src/arch/arm/context2.S
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ LEAF_ENTRY CONTEXT_CaptureContext, _TEXT

itttt ne
addne r0, CONTEXT_D0
#ifdef ARMV7D16
vstmiane r0!, {d0-d15}
addne r0, r0, #128
#else
vstmiane r0!, {d0-d15}
vstmiane r0!, {d16-d31}
#endif

subne r0, CONTEXT_D31

// Make sure sp is restored
Expand Down Expand Up @@ -129,8 +135,13 @@ LOCAL_LABEL(Restore_CONTEXT_FLOATING_POINT):

itttt ne
addne r0, CONTEXT_D0
#ifdef ARMV7D16
vldmiane r0!, {d0-d15}
nopne
#else
vldmiane r0!, {d0-d15}
vldmiane r0, {d16-d31}
#endif
subne r0, CONTEXT_D16

itt ne
Expand Down
Loading