Files
TheRock/compiler/amd-llvm/clang/test/CIR/CodeGenBuiltins/RISCV/riscv-zbkb.c
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

51 lines
2.2 KiB
C

// RUN: %clang_cc1 -triple riscv32 -target-feature +zbkb -fclangir -emit-cir %s -o - | FileCheck %s --check-prefixes=CIR,CIR32
// RUN: %clang_cc1 -triple riscv64 -target-feature +zbkb -fclangir -emit-cir %s -o - | FileCheck %s --check-prefixes=CIR,CIR64
// RUN: %clang_cc1 -triple riscv32 -target-feature +zbkb -fclangir -emit-llvm %s -o - | FileCheck %s --check-prefixes=LLVM,LLVM32
// RUN: %clang_cc1 -triple riscv64 -target-feature +zbkb -fclangir -emit-llvm %s -o - | FileCheck %s --check-prefixes=LLVM,LLVM64
// RUN: %clang_cc1 -triple riscv32 -target-feature +zbkb -emit-llvm %s -o - | FileCheck %s --check-prefixes=LLVM,LLVM32
// RUN: %clang_cc1 -triple riscv64 -target-feature +zbkb -emit-llvm %s -o - | FileCheck %s --check-prefixes=LLVM,LLVM64
// CIR-LABEL: cir.func{{.*}} @test_builtin_brev8_32(
// CIR: {{%.*}} = cir.call_llvm_intrinsic "riscv.brev8" {{%.*}} : (!u32i) -> !u32i
// CIR: cir.return
// LLVM-LABEL: @test_builtin_brev8_32(
// LLVM: call i32 @llvm.riscv.brev8.i32(i32 {{%.*}})
// LLVM: ret i32
unsigned int test_builtin_brev8_32(unsigned int a) {
return __builtin_riscv_brev8_32(a);
}
#if __riscv_xlen == 32
// CIR32-LABEL: cir.func{{.*}} @test_builtin_zip_32(
// CIR32: {{%.*}} = cir.call_llvm_intrinsic "riscv.zip" {{%.*}} : (!u32i) -> !u32i
// CIR32: cir.return
// LLVM32-LABEL: @test_builtin_zip_32(
// LLVM32: call i32 @llvm.riscv.zip.i32(i32 {{%.*}})
// LLVM32: ret i32
unsigned int test_builtin_zip_32(unsigned int a) {
return __builtin_riscv_zip_32(a);
}
// CIR32-LABEL: cir.func{{.*}} @test_builtin_unzip_32(
// CIR32: {{%.*}} = cir.call_llvm_intrinsic "riscv.unzip" {{%.*}} : (!u32i) -> !u32i
// CIR32: cir.return
// LLVM32-LABEL: @test_builtin_unzip_32(
// LLVM32: call i32 @llvm.riscv.unzip.i32(i32 {{%.*}})
// LLVM32: ret i32
unsigned int test_builtin_unzip_32(unsigned int a) {
return __builtin_riscv_unzip_32(a);
}
#endif
#if __riscv_xlen == 64
// CIR64-LABEL: cir.func{{.*}} @test_builtin_brev8_64(
// CIR64: {{%.*}} = cir.call_llvm_intrinsic "riscv.brev8" {{%.*}} : (!u64i) -> !u64i
// CIR64: cir.return
// LLVM64-LABEL: @test_builtin_brev8_64(
// LLVM64: call i64 @llvm.riscv.brev8.i64(i64 {{%.*}})
// LLVM64: ret i64
unsigned long long test_builtin_brev8_64(unsigned long long a) {
return __builtin_riscv_brev8_64(a);
}
#endif