Skip to content

Commit

Permalink
multilib: separate the extension flags (#381)
Browse files Browse the repository at this point in the history
The extension flags in -march option were separated, to make them more
flexible.
The matching expression was improved, so that it does not accidentally
catch longer extenstion names, eg. +mve.fp is not matched by +mve.
  • Loading branch information
domin144 authored Feb 2, 2024
1 parent f7b8ab9 commit 234d2b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,7 @@ add_library_variant(
armv8.1m.main
SUFFIX hard_nofp_mve
COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve -mfpu=none"
MULTILIB_FLAGS "--target=thumbv8.1m.main-none-unknown-eabihf -march=thumbv8.1m.main+dsp+mve -mfpu=none"
MULTILIB_FLAGS "--target=thumbv8.1m.main-none-unknown-eabihf -march=thumbv8.1m.main+mve -mfpu=none"
QEMU_MACHINE "mps3-an547"
QEMU_CPU "cortex-m55"
BOOT_FLASH_ADDRESS 0x00000000
Expand All @@ -1848,7 +1848,7 @@ add_library_variant(
armv8.1m.main
SUFFIX hard_nofp_mve_exceptions_rtti
COMPILE_FLAGS "-mfloat-abi=hard -march=armv8.1m.main+mve -mfpu=none"
MULTILIB_FLAGS "--target=thumbv8.1m.main-none-unknown-eabihf -march=thumbv8.1m.main+dsp+mve -mfpu=none"
MULTILIB_FLAGS "--target=thumbv8.1m.main-none-unknown-eabihf -march=thumbv8.1m.main+mve -mfpu=none"
QEMU_MACHINE "mps3-an547"
QEMU_CPU "cortex-m55"
BOOT_FLASH_ADDRESS 0x00000000
Expand Down
13 changes: 8 additions & 5 deletions cmake/multilib.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,18 @@ Mappings:
- --target=armv8a-none-unknown-eabi

# -march extensions
- Match: -march=thumbv8\.[1-9]m\.main.*\+fp16.*
- Match: -march=thumbv8\.[1-9]m\.main(\+[^\+]+)*\+fp16(\+[^\+]+)*
Flags:
- -march=thumbv8.1m.main+fp16
- Match: -march=thumbv8\.[1-9]m\.main.*\+dsp.*\+mve.*
- Match: -march=thumbv8\.[1-9]m\.main(\+[^\+]+)*\+mve(\+[^\+]+)*
Flags:
- -march=thumbv8.1m.main+dsp+mve
- Match: -march=thumbv8\.[1-9]m\.main.*\+mve\.fp.*\+fp16.*\+lob.*
- -march=thumbv8.1m.main+mve
- Match: -march=thumbv8\.[1-9]m\.main(\+[^\+]+)*\+mve\.fp(\+[^\+]+)*
Flags:
- -march=thumbv8.1m.main+fp16+lob+mve.fp
- -march=thumbv8.1m.main+mve.fp
- Match: -march=thumbv8\.[1-9]m\.main(\+[^\+]+)*\+lob(\+[^\+]+)*
Flags:
- -march=thumbv8.1m.main+lob

# -mfloat-abi settings
- Match: -mfloat-abi=softfp
Expand Down
4 changes: 3 additions & 1 deletion test/multilib/armv8.1m.main.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
# MVE-EMPTY:

# RUN: %clang -print-multi-flags-experimental --target=arm-none-eabihf -mcpu=cortex-m55 | FileCheck --check-prefix=CORTEXM55 %s
# CORTEXM55: -march=thumbv8.1m.main+fp16+lob+mve.fp
# CORTEXM55: -march=thumbv8.1m.main+fp16
# CORTEXM55: -march=thumbv8.1m.main+lob
# CORTEXM55: -march=thumbv8.1m.main+mve.fp

0 comments on commit 234d2b1

Please sign in to comment.