CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
77 lines
2.7 KiB
C
77 lines
2.7 KiB
C
// RUN: %clang_cc1 -triple riscv32 -target-feature +zbb -fclangir -emit-cir %s -o - | FileCheck %s --check-prefix=CIR
|
|
// RUN: %clang_cc1 -triple riscv64 -target-feature +zbb -fclangir -emit-cir %s -o - | FileCheck %s --check-prefixes=CIR,CIR64
|
|
// RUN: %clang_cc1 -triple riscv32 -target-feature +zbb -fclangir -emit-llvm %s -o - | FileCheck %s --check-prefix=LLVM
|
|
// RUN: %clang_cc1 -triple riscv64 -target-feature +zbb -fclangir -emit-llvm %s -o - | FileCheck %s --check-prefixes=LLVM,LLVM64
|
|
// RUN: %clang_cc1 -triple riscv32 -target-feature +zbb -emit-llvm %s -o - | FileCheck %s --check-prefix=LLVM
|
|
// RUN: %clang_cc1 -triple riscv64 -target-feature +zbb -emit-llvm %s -o - | FileCheck %s --check-prefixes=LLVM,LLVM64
|
|
|
|
|
|
// CIR-LABEL: cir.func{{.*}} @test_builtin_orc_b_32(
|
|
// CIR: {{%.*}} = cir.call_llvm_intrinsic "riscv.orc.b" {{%.*}} : (!u32i) -> !u32i
|
|
// CIR: cir.return
|
|
|
|
// LLVM-LABEL: @test_builtin_orc_b_32(
|
|
// LLVM: call i32 @llvm.riscv.orc.b.i32(i32 {{%.*}})
|
|
// LLVM: ret i32
|
|
unsigned int test_builtin_orc_b_32(unsigned int a) {
|
|
return __builtin_riscv_orc_b_32(a);
|
|
}
|
|
|
|
// CIR-LABEL: cir.func{{.*}} @test_builtin_clz_32(
|
|
// CIR: {{%.*}} = cir.clz {{%.*}} : !u32i
|
|
// CIR: cir.return
|
|
|
|
// LLVM-LABEL: @test_builtin_clz_32(
|
|
// LLVM: call i32 @llvm.ctlz.i32(i32 {{%.*}}, i1 false)
|
|
// LLVM: ret i32
|
|
unsigned int test_builtin_clz_32(unsigned int a) {
|
|
return __builtin_riscv_clz_32(a);
|
|
}
|
|
|
|
// CIR-LABEL: cir.func{{.*}} @test_builtin_ctz_32(
|
|
// CIR: {{%.*}} = cir.ctz {{%.*}} : !u32i
|
|
// CIR: cir.return
|
|
|
|
// LLVM-LABEL: @test_builtin_ctz_32(
|
|
// LLVM: call i32 @llvm.cttz.i32(i32 {{%.*}}, i1 false)
|
|
// LLVM: ret i32
|
|
unsigned int test_builtin_ctz_32(unsigned int a) {
|
|
return __builtin_riscv_ctz_32(a);
|
|
}
|
|
|
|
#if __riscv_xlen == 64
|
|
// CIR64-LABEL: cir.func{{.*}} @test_builtin_orc_b_64(
|
|
// CIR64: {{%.*}} = cir.call_llvm_intrinsic "riscv.orc.b" {{%.*}} : (!u64i) -> !u64i
|
|
// CIR64: cir.return
|
|
|
|
// LLVM64-LABEL: @test_builtin_orc_b_64(
|
|
// LLVM64: call i64 @llvm.riscv.orc.b.i64(i64 {{%.*}})
|
|
// LLVM64: ret i64
|
|
|
|
unsigned long long test_builtin_orc_b_64(unsigned long long a) {
|
|
return __builtin_riscv_orc_b_64(a);
|
|
}
|
|
|
|
// CIR64-LABEL: cir.func{{.*}} @test_builtin_clz_64(
|
|
// CIR64: {{%.*}} = cir.clz {{%.*}} : !u64i
|
|
// CIR64: cir.return
|
|
|
|
// LLVM64-LABEL: @test_builtin_clz_64(
|
|
// LLVM64: call i64 @llvm.ctlz.i64(i64 {{%.*}}, i1 false)
|
|
// LLVM64: ret i64
|
|
unsigned long long test_builtin_clz_64(unsigned long long a) {
|
|
return __builtin_riscv_clz_64(a);
|
|
}
|
|
|
|
// CIR64-LABEL: cir.func{{.*}} @test_builtin_ctz_64(
|
|
// CIR64: {{%.*}} = cir.ctz {{%.*}} : !u64i
|
|
// CIR64: cir.return
|
|
|
|
// LLVM64-LABEL: @test_builtin_ctz_64(
|
|
// LLVM64: call i64 @llvm.cttz.i64(i64 {{%.*}}, i1 false)
|
|
// LLVM64: ret i64
|
|
unsigned long long test_builtin_ctz_64(unsigned long long a) {
|
|
return __builtin_riscv_ctz_64(a);
|
|
}
|
|
#endif
|