iar: Fix v8.1m arch check

IAR has a different architecture defines than GCC and Armclang.
CMSIS headers have these definitions, but you always have to
include the cmsis_compilers.h file to activate it, but nothing forces it.
To have these definitions in all cases, I've added the global
defines for every supported architectures.

The CMSIS patch is upstreamed to the CMSIS6 repo as a PR.

Signed-off-by: Dávid Házi <david.hazi@arm.com>
Change-Id: Iaaee265f77f23507168df9b46884d0b7d3818bea
diff --git a/toolchain_IARARM.cmake b/toolchain_IARARM.cmake
index ba14c16..d8daffd 100644
--- a/toolchain_IARARM.cmake
+++ b/toolchain_IARARM.cmake
@@ -142,6 +142,15 @@
         )
         set(LINKER_CP_OPTION --fpu=none)
     endif()
+
+    add_compile_definitions(
+        $<$<STREQUAL:${TFM_SYSTEM_ARCHITECTURE},armv6-m>:__ARM_ARCH_6M__=1>
+        $<$<STREQUAL:${TFM_SYSTEM_ARCHITECTURE},armv7-m>:__ARM_ARCH_7M__=1>
+        $<$<AND:$<STREQUAL:${TFM_SYSTEM_ARCHITECTURE},armv7-m>,$<BOOL:__ARM_FEATURE_DSP>>:__ARM_ARCH_7EM__=1>
+        $<$<STREQUAL:${TFM_SYSTEM_ARCHITECTURE},armv8-m.base>:__ARM_ARCH_8M_BASE__=1>
+        $<$<STREQUAL:${TFM_SYSTEM_ARCHITECTURE},armv8-m.main>:__ARM_ARCH_8M_MAIN__=1>
+        $<$<STREQUAL:${TFM_SYSTEM_ARCHITECTURE},armv8.1-m.main>:__ARM_ARCH_8_1M_MAIN__=1>
+    )
 endmacro()
 
 # Configure environment for the compiler setup run by cmake at the first