[PATCH] D78565: [clang][doc] Clang ARM CPU command line argument reference

Sjoerd Meijer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 21 07:31:25 PDT 2020


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: psmith, ostannard, kristof.beyls, chill.
Herald added subscribers: danielkiss, arphaman.

Following the discussion about -mtune on the cfe dev list, I thought it would be good to make a start with documenting common command line arguments to target different ARM CPU and architecture combinations. This list is not yet complete, is work in progress, but I have just taken 2 recent M-cores as an example.


https://reviews.llvm.org/D78565

Files:
  clang/docs/ClangARMCPUsCLI.rst
  clang/docs/index.rst


Index: clang/docs/index.rst
===================================================================
--- clang/docs/index.rst
+++ clang/docs/index.rst
@@ -20,6 +20,7 @@
    Toolchain
    LanguageExtensions
    ClangCommandLineReference
+   ClangARMCPUsCLI
    AttributeReference
    DiagnosticsReference
    CrossCompilation
Index: clang/docs/ClangARMCPUsCLI.rst
===================================================================
--- /dev/null
+++ clang/docs/ClangARMCPUsCLI.rst
@@ -0,0 +1,77 @@
+=============================================
+Clang ARM CPU command line argument reference
+=============================================
+
+This page lists common command line arguments to target different ARM CPU
+and architecture combinations. This list is not yet complete, and is work in
+progress.
+
+Cortex-M33
+==========
+
+Architecture: Armv8-M
+
+Technical Reference Manual:
+`http://infocenter.arm.com/help/topic/com.arm.doc.100230_0002_00_en/cortex_m33_trm_100230_0002_00_en.pdf`
+
+Optional architecture extensions:
+- single precision floating-point (FP),
+- DSP,
+- ARMv8-M Security Extension (CMSE),
+- Custom Datapath Extension (CDE).
+
+Example architecture configurations and corresponding CLI options:
+
+All extensions enabled, except CMSE and CDE, with DSP implied by -mcpu=cortex-m33:
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fp-armv8-sp-d16 -mfloat-abi=hard -mthumb
+
+All extensions enabled:
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=fp-armv8-sp-d16 -mfloat-abi=hard -mthumb -mcmse
+
+Without single precision float support:
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m33 -mfpu=none -mthumb
+
+Without single precision float and DSP support:
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m33+nodsp -mfpu=none -mthumb
+
+Cortex-M55
+==========
+
+Architecture: Armv8.1-M Main
+
+Technical Reference Manual: not yet available.
+
+Optional architecture extensions:
+- M-Profile Vector Extension (MVE), integer-only, or also floating-point.
+- Scalar half, single, and double precision floating-point,
+- ARMv8-M Security Extension (CMSE),
+- Custom Datapath Extension (CDE).
+
+Mandatory architecture extensions (thus implied in the examples below):
+- DSP
+
+Example architecture configurations and corresponding CLI options:
+
+Integer and float MVE (INT, F16, F32), and float support (F16, F32, F64):
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m55 -mfloat-abi=hard -mthumb
+
+Integer-only MVE, with float support (F16, F32, F64):
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m55+nomve.fp -mfloat-abi=hard -mthumb
+
+Integer-only MVE, no float support:
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m55+nofp -mfloat-abi=hard -mthumb
+
+No MVE, only float support (F16, F32, F64):
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m55+nomve -mfloat-abi=hard -mthumb
+
+Basic Armv8.1-M Main support, no extensions:
+
+.. option:: --target=arm-arm-none-eabi -mcpu=cortex-m55+nofp+nomve


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78565.258995.patch
Type: text/x-patch
Size: 3007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200421/5edf5937/attachment.bin>


More information about the cfe-commits mailing list