Skip to content

Commit

Permalink
scripts: llvm: Add RV32E multi-lib alternate mappings
Browse files Browse the repository at this point in the history
This commit adds the alternate RV32E multi-lib mappings, based on the
list of the GCC RV32E multi-lib mappings (gcc/config/riscv/t-zephyr).

Signed-off-by: Stephanos Ioannidis <[email protected]>
  • Loading branch information
stephanosio committed Nov 26, 2024
1 parent 3f2c64e commit d3aff2d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/llvm/cmake/multilib.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,29 @@ Mappings:
- Match: -march=rv32i([0-9]+p[0-9]+)_a([0-9]+p[0-9]+)_f([0-9]+p[0-9]+)_c([0-9]+p[0-9]+)_zicsr([0-9]+p[0-9]+)_zifencei([0-9]+p[0-9]+)
Flags:
- -march=rv32i2p1_f2p2_zicsr2p0_zifencei2p0

# RV32E alternate mappings
## march.rv32e_zicsr_zifencei/mabi.ilp32e=march.rv32ea_zicsr_zifencei/mabi.ilp32e
- Match: -march=rv32e([0-9]+p[0-9]+)_a([0-9]+p[0-9]+)_zicsr([0-9]+p[0-9]+)_zifencei([0-9]+p[0-9]+)
Flags:
- -march=rv32e2p0_zicsr2p0_zifencei2p0
## march.rv32e_zicsr_zifencei/mabi.ilp32e=march.rv32eac_zicsr_zifencei/mabi.ilp32e
- Match: -march=rv32e([0-9]+p[0-9]+)_a([0-9]+p[0-9]+)_c([0-9]+p[0-9]+)_zicsr([0-9]+p[0-9]+)_zifencei([0-9]+p[0-9]+)
Flags:
- -march=rv32e2p0_zicsr2p0_zifencei2p0
## march.rv32e_zicsr_zifencei/mabi.ilp32e=march.rv32ec_zicsr_zifencei/mabi.ilp32e
- Match: -march=rv32e([0-9]+p[0-9]+)_c([0-9]+p[0-9]+)_zicsr([0-9]+p[0-9]+)_zifencei([0-9]+p[0-9]+)
Flags:
- -march=rv32e2p0_zicsr2p0_zifencei2p0
## march.rv32em_zicsr_zifencei/mabi.ilp32e=march.rv32ema_zicsr_zifencei/mabi.ilp32e
- Match: -march=rv32e([0-9]+p[0-9]+)_m([0-9]+p[0-9]+)_a([0-9]+p[0-9]+)_zicsr([0-9]+p[0-9]+)_zifencei([0-9]+p[0-9]+)_zmmul([0-9]+p[0-9]+)
Flags:
- -march=rv32e2p0_m2p0_zicsr2p0_zifencei2p0_zmmul1p0
## march.rv32emc_zicsr_zifencei/mabi.ilp32e=march.rv32emac_zicsr_zifencei/mabi.ilp32e
- Match: -march=rv32e([0-9]+p[0-9]+)_m([0-9]+p[0-9]+)_a([0-9]+p[0-9]+)_c([0-9]+p[0-9]+)_zicsr([0-9]+p[0-9]+)_zifencei([0-9]+p[0-9]+)_zmmul([0-9]+p[0-9]+)
Flags:
- -march=rv32e2p0_m2p0_c2p0_zicsr2p0_zifencei2p0_zmmul1p0
## march.rv32emc_zicsr_zifencei_zba_zbb_zbc_zbs/mabi.ilp32e=march.rv32emac_zicsr_zifencei_zba_zbb_zbc_zbs/mabi.ilp32e
- Match: -march=rv32e([0-9]+p[0-9]+)_m([0-9]+p[0-9]+)_a([0-9]+p[0-9]+)_c([0-9]+p[0-9]+)_zicsr([0-9]+p[0-9]+)_zifencei([0-9]+p[0-9]+)_zmmul([0-9]+p[0-9]+)_zba([0-9]+p[0-9]+)_zbb([0-9]+p[0-9]+)_zbc([0-9]+p[0-9]+)_zbs([0-9]+p[0-9]+)
Flags:
- -march=rv32e2p0_m2p0_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zba1p0_zbb1p0_zbc1p0_zbs1p0
6 changes: 6 additions & 0 deletions scripts/llvm/test/multilib/rv32e.test
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32e_zicsr_zifencei -mabi=ilp32e | FileCheck %s --check-prefix=RV32E_ZICSR_ZIFENCEI_ILP32E
# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32ea_zicsr_zifencei -mabi=ilp32e | FileCheck %s --check-prefix=RV32E_ZICSR_ZIFENCEI_ILP32E
# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32eac_zicsr_zifencei -mabi=ilp32e | FileCheck %s --check-prefix=RV32E_ZICSR_ZIFENCEI_ILP32E
# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32ec_zicsr_zifencei -mabi=ilp32e | FileCheck %s --check-prefix=RV32E_ZICSR_ZIFENCEI_ILP32E
# RV32E_ZICSR_ZIFENCEI_ILP32E: riscv32-none-elf/rv32e_zicsr_zifencei_ilp32e_exn_rtti{{$}}
# RV32E_ZICSR_ZIFENCEI_ILP32E-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32em_zicsr_zifencei -mabi=ilp32e | FileCheck %s --check-prefix=RV32EM_ZICSR_ZIFENCEI_ILP32E
# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32ema_zicsr_zifencei -mabi=ilp32e | FileCheck %s --check-prefix=RV32EM_ZICSR_ZIFENCEI_ILP32E
# RV32EM_ZICSR_ZIFENCEI_ILP32E: riscv32-none-elf/rv32em_zicsr_zifencei_ilp32e_exn_rtti{{$}}
# RV32EM_ZICSR_ZIFENCEI_ILP32E-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32emc_zicsr_zifencei -mabi=ilp32e | FileCheck %s --check-prefix=RV32EMC_ZICSR_ZIFENCEI_ILP32E
# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32emac_zicsr_zifencei -mabi=ilp32e | FileCheck %s --check-prefix=RV32EMC_ZICSR_ZIFENCEI_ILP32E
# RV32EMC_ZICSR_ZIFENCEI_ILP32E: riscv32-none-elf/rv32emc_zicsr_zifencei_ilp32e_exn_rtti{{$}}
# RV32EMC_ZICSR_ZIFENCEI_ILP32E-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32emc_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=ilp32e | FileCheck %s --check-prefix=RV32EMC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_ILP32E
# RUN: %clang -print-multi-directory --target=riscv32-none-elf -march=rv32emac_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=ilp32e | FileCheck %s --check-prefix=RV32EMC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_ILP32E
# RV32EMC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_ILP32E: riscv32-none-elf/rv32emc_zicsr_zifencei_zba_zbb_zbc_zbs_ilp32e_exn_rtti{{$}}
# RV32EMC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_ILP32E-EMPTY:

Expand Down

0 comments on commit d3aff2d

Please sign in to comment.