Skip to content

Commit

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

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
  • Loading branch information
stephanosio committed Nov 26, 2024
1 parent d3aff2d commit 29ab797
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/llvm/cmake/multilib.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,33 @@ Mappings:
- 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

# RV64I alternate mappings
## march.rv64i_zicsr_zifencei/mabi.lp64/mcmodel.medany=march.rv64ia_zicsr_zifencei/mabi.lp64/mcmodel.medany
- Match: -march=rv64i([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=rv64i2p1_zicsr2p0_zifencei2p0
## march.rv64i_zicsr_zifencei/mabi.lp64/mcmodel.medany=march.rv64iac_zicsr_zifencei/mabi.lp64/mcmodel.medany
- Match: -march=rv64i([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=rv64i2p1_zicsr2p0_zifencei2p0
## march.rv64i_zicsr_zifencei/mabi.lp64/mcmodel.medany=march.rv64ic_zicsr_zifencei/mabi.lp64/mcmodel.medany
- Match: -march=rv64i([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=rv64i2p1_zicsr2p0_zifencei2p0
## march.rv64im_zicsr_zifencei/mabi.lp64/mcmodel.medany=march.rv64ima_zicsr_zifencei/mabi.lp64/mcmodel.medany
- Match: -march=rv64i([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=rv64i2p1_m2p0_zicsr2p0_zifencei2p0_zmmul1p0
## march.rv64im_zicsr_zifencei/mabi.lp64/mcmodel.medany=march.rv64imc_zicsr_zifencei/mabi.lp64/mcmodel.medany
- Match: -march=rv64i([0-9]+p[0-9]+)_m([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=rv64i2p1_m2p0_zicsr2p0_zifencei2p0_zmmul1p0
## march.rv64im_zicsr_zifencei_zba_zbb_zbc_zbs/mabi.lp64/mcmodel.medany=march.rv64ima_zicsr_zifencei_zba_zbb_zbc_zbs/mabi.lp64/mcmodel.medany
- Match: -march=rv64i([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]+)_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=rv64i2p1_m2p0_zicsr2p0_zifencei2p0_zmmul1p0_zba1p0_zbb1p0_zbc1p0_zbs1p0
## march.rv64im_zicsr_zifencei_zba_zbb_zbc_zbs/mabi.lp64/mcmodel.medany=march.rv64imc_zicsr_zifencei_zba_zbb_zbc_zbs/mabi.lp64/mcmodel.medany
- Match: -march=rv64i([0-9]+p[0-9]+)_m([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=rv64i2p1_m2p0_zicsr2p0_zifencei2p0_zmmul1p0_zba1p0_zbb1p0_zbc1p0_zbs1p0
9 changes: 9 additions & 0 deletions scripts/llvm/test/multilib/rv64i.test
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64i_zicsr_zifencei -mabi=lp64 | FileCheck %s --check-prefix=RV64I_ZICSR_ZIFENCEI_LP64
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64ia_zicsr_zifencei -mabi=lp64 | FileCheck %s --check-prefix=RV64I_ZICSR_ZIFENCEI_LP64
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64iac_zicsr_zifencei -mabi=lp64 | FileCheck %s --check-prefix=RV64I_ZICSR_ZIFENCEI_LP64
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64ic_zicsr_zifencei -mabi=lp64 | FileCheck %s --check-prefix=RV64I_ZICSR_ZIFENCEI_LP64
# RV64I_ZICSR_ZIFENCEI_LP64: riscv64-none-elf/rv64i_zicsr_zifencei_lp64_exn_rtti{{$}}
# RV64I_ZICSR_ZIFENCEI_LP64-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64im_zicsr_zifencei -mabi=lp64 | FileCheck %s --check-prefix=RV64IM_ZICSR_ZIFENCEI_LP64
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64ima_zicsr_zifencei -mabi=lp64 | FileCheck %s --check-prefix=RV64IM_ZICSR_ZIFENCEI_LP64
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64imc_zicsr_zifencei -mabi=lp64 | FileCheck %s --check-prefix=RV64IM_ZICSR_ZIFENCEI_LP64
# RV64IM_ZICSR_ZIFENCEI_LP64: riscv64-none-elf/rv64im_zicsr_zifencei_lp64_exn_rtti{{$}}
# RV64IM_ZICSR_ZIFENCEI_LP64-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64im_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=lp64 | FileCheck %s --check-prefix=RV64IM_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64ima_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=lp64 | FileCheck %s --check-prefix=RV64IM_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64imc_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=lp64 | FileCheck %s --check-prefix=RV64IM_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64
# RV64IM_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64: riscv64-none-elf/rv64im_zicsr_zifencei_zba_zbb_zbc_zbs_lp64_exn_rtti{{$}}
# RV64IM_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64-EMPTY:

Expand All @@ -19,10 +26,12 @@
# RV64IMAC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64imafdc_zicsr_zifencei -mabi=lp64d | FileCheck %s --check-prefix=RV64IMAFDC_ZICSR_ZIFENCEI_LP64D
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64gc -mabi=lp64d | FileCheck %s --check-prefix=RV64IMAFDC_ZICSR_ZIFENCEI_LP64D
# RV64IMAFDC_ZICSR_ZIFENCEI_LP64D: riscv64-none-elf/rv64imafdc_zicsr_zifencei_lp64d_exn_rtti{{$}}
# RV64IMAFDC_ZICSR_ZIFENCEI_LP64D-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64imafd_zicsr_zifencei -mabi=lp64d | FileCheck %s --check-prefix=RV64IMAFD_ZICSR_ZIFENCEI_LP64D
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64g -mabi=lp64d | FileCheck %s --check-prefix=RV64IMAFD_ZICSR_ZIFENCEI_LP64D
# RV64IMAFD_ZICSR_ZIFENCEI_LP64D: riscv64-none-elf/rv64imafd_zicsr_zifencei_lp64d_exn_rtti{{$}}
# RV64IMAFD_ZICSR_ZIFENCEI_LP64D-EMPTY:

Expand Down

0 comments on commit 29ab797

Please sign in to comment.