[compiler-rt][builtins] Support builtins for armv8m.base
authorFrank Dischner <fdischner@google.com>
Wed, 15 Mar 2023 00:20:54 +0000 (17:20 -0700)
committerFangrui Song <i@maskray.me>
Wed, 15 Mar 2023 00:20:54 +0000 (17:20 -0700)
commitef45c12f9e6ec687e6281f7dc7c5e38e711bda9c
tree3ca66febbbb447ebfd6156e2b79115e4fb4594e7
parent4e99891e7085ef6348012f23a8acc116a3c5b416
[compiler-rt][builtins] Support builtins for armv8m.base

This allows building the compiler builtins library for the Armv8-M
Baseline architecture. It can be built in the same way as other
baremetal targets using the appropriate '--target' flag
(e.g. --target=armv8m.base-eabi).

NOTE: As with the other Cortex-M targets, only the builtins library is
supported. There is no support for sanitizers, etc.

The armv8m.base architecture is a superset of armv6m, so adding it to
the cmake files using thumb1_SOURCES is almost enough for it to compile.
Minor changes are needed to divsi3 and udivsi3, because armv8m.base does
have support for div instructions but not mov with an immediate operand.

Reviewed By: MaskRay, peter.smith

Differential Revision: https://reviews.llvm.org/D143297
compiler-rt/cmake/builtin-config-ix.cmake
compiler-rt/lib/builtins/CMakeLists.txt
compiler-rt/lib/builtins/arm/divsi3.S
compiler-rt/lib/builtins/arm/udivsi3.S