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
67 lines
2.5 KiB
C
67 lines
2.5 KiB
C
// REQUIRES: riscv-registered-target
|
|
|
|
// RUN: %clang_cc1 -triple riscv32 -target-feature +v \
|
|
// RUN: -mvscale-min=2 -mvscale-max=2 -O2 -emit-llvm %s -o - \
|
|
// RUN: | FileCheck %s
|
|
// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
|
|
// RUN: -mvscale-min=2 -mvscale-max=2 -O2 -emit-llvm %s -o - \
|
|
// RUN: | FileCheck %s
|
|
|
|
// Test RISC-V V-extension fixed-length vector inline assembly constraints.
|
|
#include <riscv_vector.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef vbool1_t fixed_bool1_t __attribute__((riscv_rvv_vector_bits(__riscv_v_fixed_vlen)));
|
|
typedef vint32m1_t fixed_i32m1_t __attribute__((riscv_rvv_vector_bits(__riscv_v_fixed_vlen)));
|
|
typedef vint8mf2_t fixed_i8mf2_t __attribute__((riscv_rvv_vector_bits(__riscv_v_fixed_vlen / 2)));
|
|
|
|
typedef bool bx2 __attribute__((ext_vector_type(16)));
|
|
typedef int i32x2 __attribute__((ext_vector_type(2)));
|
|
typedef char i8x4 __attribute__((ext_vector_type(4)));
|
|
|
|
fixed_i32m1_t test_vr(fixed_i32m1_t a) {
|
|
// CHECK-LABEL: define{{.*}} @test_vr
|
|
// CHECK: %0 = tail call <4 x i32> asm sideeffect "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<4 x i32> %a, <4 x i32> %a)
|
|
fixed_i32m1_t ret;
|
|
asm volatile ("vadd.vv %0, %1, %2" : "=vr"(ret) : "vr"(a), "vr"(a));
|
|
return ret;
|
|
}
|
|
|
|
i32x2 test_vr2(i32x2 a) {
|
|
// CHECK-LABEL: define{{.*}} @test_vr2
|
|
// CHECK: %1 = tail call <2 x i32> asm sideeffect "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<2 x i32> %0, <2 x i32> %0)
|
|
i32x2 ret;
|
|
asm volatile ("vadd.vv %0, %1, %2" : "=vr"(ret) : "vr"(a), "vr"(a));
|
|
return ret;
|
|
}
|
|
|
|
fixed_i8mf2_t test_vd(fixed_i8mf2_t a) {
|
|
// CHECK-LABEL: define{{.*}} @test_vd
|
|
// CHECK: %0 = tail call <8 x i8> asm sideeffect "vadd.vv $0, $1, $2", "=^vd,^vr,^vr"(<8 x i8> %a, <8 x i8> %a)
|
|
fixed_i8mf2_t ret;
|
|
asm volatile ("vadd.vv %0, %1, %2" : "=vd"(ret) : "vr"(a), "vr"(a));
|
|
return ret;
|
|
}
|
|
|
|
i8x4 test_vd2(i8x4 a) {
|
|
// CHECK-LABEL: define{{.*}} @test_vd2
|
|
// CHECK: %1 = tail call <4 x i8> asm sideeffect "vadd.vv $0, $1, $2", "=^vd,^vr,^vr"(<4 x i8> %0, <4 x i8> %0)
|
|
i8x4 ret;
|
|
asm volatile ("vadd.vv %0, %1, %2" : "=vd"(ret) : "vr"(a), "vr"(a));
|
|
return ret;
|
|
}
|
|
|
|
fixed_bool1_t test_vm(fixed_bool1_t a) {
|
|
// CHECK-LABEL: define{{.*}} @test_vm
|
|
// CHECK: %1 = tail call <16 x i8> asm sideeffect "vmand.mm $0, $1, $2", "=^vm,^vm,^vm"(<16 x i8> %a, <16 x i8> %a)
|
|
fixed_bool1_t ret;
|
|
asm volatile ("vmand.mm %0, %1, %2" : "=vm"(ret) : "vm"(a), "vm"(a));
|
|
return ret;
|
|
}
|
|
|
|
void test_vm2(bx2 a) {
|
|
// CHECK-LABEL: define{{.*}} @test_vm2
|
|
// CHECK: tail call void asm sideeffect "dummy $0", "^vm"(<16 x i1> %a1)
|
|
asm volatile ("dummy %0" :: "vm"(a));
|
|
}
|