Skip to content

Commit

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

rv64i_zicsr_zifencei/lp64
rv64im_zicsr_zifencei/lp64
rv64im_zicsr_zifencei_zba_zbb_zbc_zbs/lp64
rv64imac_zicsr_zifencei/lp64
rv64imac_zicsr_zifencei_zba_zbb_zbc_zbs/lp64
rv64imafdc_zicsr_zifencei/lp64d
rv64imafd_zicsr_zifencei/lp64d
rv64imfc_zicsr_zifencei/lp64f
rv64imfc_zicsr_zifencei_zba_zbb_zbc_zbs/lp64f

Signed-off-by: Stephanos Ioannidis <[email protected]>
  • Loading branch information
stephanosio committed Nov 25, 2024
1 parent 697426e commit b12b628
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 2 deletions.
132 changes: 130 additions & 2 deletions scripts/llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1995,9 +1995,137 @@ add_library_variants_for_cpu(
)
## RV64I
add_library_variants_for_cpu(
rv64i_zicsr_zifencei
rv64i_zicsr_zifencei_lp64
COMPILE_FLAGS "-march=rv64i_zicsr_zifencei -mabi=lp64 -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_zicsr2p0_zifencei2p0 -mabi=lp64"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
QEMU_PARAMS "-m 1G"
BOOT_FLASH_ADDRESS 0x00000000
BOOT_FLASH_SIZE 0x1000
FLASH_ADDRESS 0x20000000
FLASH_SIZE 0x1000000
RAM_ADDRESS 0x21000000
RAM_SIZE 0x1000000
STACK_SIZE 4K
)
add_library_variants_for_cpu(
rv64im_zicsr_zifencei_lp64
COMPILE_FLAGS "-march=rv64im_zicsr_zifencei -mabi=lp64 -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_m2p0_zicsr2p0_zifencei2p0_zmmul1p0 -mabi=lp64"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
QEMU_PARAMS "-m 1G"
BOOT_FLASH_ADDRESS 0x00000000
BOOT_FLASH_SIZE 0x1000
FLASH_ADDRESS 0x20000000
FLASH_SIZE 0x1000000
RAM_ADDRESS 0x21000000
RAM_SIZE 0x1000000
STACK_SIZE 4K
)
add_library_variants_for_cpu(
rv64im_zicsr_zifencei_zba_zbb_zbc_zbs_lp64
COMPILE_FLAGS "-march=rv64im_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=lp64 -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_m2p0_zicsr2p0_zifencei2p0_zmmul1p0_zba1p0_zbb1p0_zbc1p0_zbs1p0 -mabi=lp64"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
QEMU_PARAMS "-m 1G"
BOOT_FLASH_ADDRESS 0x00000000
BOOT_FLASH_SIZE 0x1000
FLASH_ADDRESS 0x20000000
FLASH_SIZE 0x1000000
RAM_ADDRESS 0x21000000
RAM_SIZE 0x1000000
STACK_SIZE 4K
)
add_library_variants_for_cpu(
rv64imac_zicsr_zifencei_lp64
COMPILE_FLAGS "-march=rv64imac_zicsr_zifencei -mabi=lp64 -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_m2p0_a2p1_c2p0_zicsr2p0_zifencei2p0_zmmul1p0 -mabi=lp64"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
QEMU_PARAMS "-m 1G"
BOOT_FLASH_ADDRESS 0x00000000
BOOT_FLASH_SIZE 0x1000
FLASH_ADDRESS 0x20000000
FLASH_SIZE 0x1000000
RAM_ADDRESS 0x21000000
RAM_SIZE 0x1000000
STACK_SIZE 4K
)
add_library_variants_for_cpu(
rv64imac_zicsr_zifencei_zba_zbb_zbc_zbs_lp64
COMPILE_FLAGS "-march=rv64imac_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=lp64 -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_m2p0_a2p1_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zba1p0_zbb1p0_zbc1p0_zbs1p0 -mabi=lp64"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
QEMU_PARAMS "-m 1G"
BOOT_FLASH_ADDRESS 0x00000000
BOOT_FLASH_SIZE 0x1000
FLASH_ADDRESS 0x20000000
FLASH_SIZE 0x1000000
RAM_ADDRESS 0x21000000
RAM_SIZE 0x1000000
STACK_SIZE 4K
)
add_library_variants_for_cpu(
rv64imafdc_zicsr_zifencei_lp64d
COMPILE_FLAGS "-march=rv64imafdc_zicsr_zifencei -mabi=lp64d -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0 -mabi=lp64d"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
QEMU_PARAMS "-m 1G"
BOOT_FLASH_ADDRESS 0x00000000
BOOT_FLASH_SIZE 0x1000
FLASH_ADDRESS 0x20000000
FLASH_SIZE 0x1000000
RAM_ADDRESS 0x21000000
RAM_SIZE 0x1000000
STACK_SIZE 4K
)
add_library_variants_for_cpu(
rv64imafd_zicsr_zifencei_lp64d
COMPILE_FLAGS "-march=rv64imafd_zicsr_zifencei -mabi=lp64d -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_m2p0_a2p1_f2p2_d2p2_zicsr2p0_zifencei2p0_zmmul1p0 -mabi=lp64d"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
QEMU_PARAMS "-m 1G"
BOOT_FLASH_ADDRESS 0x00000000
BOOT_FLASH_SIZE 0x1000
FLASH_ADDRESS 0x20000000
FLASH_SIZE 0x1000000
RAM_ADDRESS 0x21000000
RAM_SIZE 0x1000000
STACK_SIZE 4K
)
add_library_variants_for_cpu(
rv64imfc_zicsr_zifencei_lp64f
COMPILE_FLAGS "-march=rv64imfc_zicsr_zifencei -mabi=lp64f -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_m2p0_f2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0 -mabi=lp64f"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
QEMU_PARAMS "-m 1G"
BOOT_FLASH_ADDRESS 0x00000000
BOOT_FLASH_SIZE 0x1000
FLASH_ADDRESS 0x20000000
FLASH_SIZE 0x1000000
RAM_ADDRESS 0x21000000
RAM_SIZE 0x1000000
STACK_SIZE 4K
)
add_library_variants_for_cpu(
rv64imfc_zicsr_zifencei_zba_zbb_zbc_zbs_lp64f
COMPILE_FLAGS "-march=rv64imfc_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=lp64f -mcmodel=medany"
MULTILIB_FLAGS "--target=riscv64-unknown-none-elf -march=rv64i2p1_m2p0_f2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zba1p0_zbb1p0_zbc1p0_zbs1p0 -mabi=lp64f"
PICOLIBC_BUILD_TYPE "release"
QEMU_MACHINE "none"
QEMU_CPU "rv64"
Expand Down
35 changes: 35 additions & 0 deletions scripts/llvm/test/multilib/rv64i.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64i_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
# 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
# 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:

# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64imac_zicsr_zifencei -mabi=lp64 | FileCheck %s --check-prefix=RV64IMAC_ZICSR_ZIFENCEI_LP64
# RV64IMAC_ZICSR_ZIFENCEI_LP64: riscv64-none-elf/rv64imac_zicsr_zifencei_lp64_exn_rtti{{$}}
# RV64IMAC_ZICSR_ZIFENCEI_LP64-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64imac_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=lp64 | FileCheck %s --check-prefix=RV64IMAC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64
# RV64IMAC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64: riscv64-none-elf/rv64imac_zicsr_zifencei_zba_zbb_zbc_zbs_lp64_exn_rtti{{$}}
# 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
# 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
# RV64IMAFD_ZICSR_ZIFENCEI_LP64D: riscv64-none-elf/rv64imafd_zicsr_zifencei_lp64d_exn_rtti{{$}}
# RV64IMAFD_ZICSR_ZIFENCEI_LP64D-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64imfc_zicsr_zifencei -mabi=lp64f | FileCheck %s --check-prefix=RV64IMFC_ZICSR_ZIFENCEI_LP64F
# RV64IMFC_ZICSR_ZIFENCEI_LP64F: riscv64-none-elf/rv64imfc_zicsr_zifencei_lp64f_exn_rtti{{$}}
# RV64IMFC_ZICSR_ZIFENCEI_LP64F-EMPTY:

# RUN: %clang -print-multi-directory --target=riscv64-none-elf -march=rv64imfc_zicsr_zifencei_zba_zbb_zbc_zbs -mabi=lp64f | FileCheck %s --check-prefix=RV64IMFC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64F
# RV64IMFC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64F: riscv64-none-elf/rv64imfc_zicsr_zifencei_zba_zbb_zbc_zbs_lp64f_exn_rtti{{$}}
# RV64IMFC_ZICSR_ZIFENCEI_ZBA_ZBB_ZBC_ZBS_LP64F-EMPTY:

0 comments on commit b12b628

Please sign in to comment.