| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 |
| 2 |
// REQUIRES: riscv-registered-target |
| 3 |
// RUN: %clang_cc1 -triple riscv64 -target-feature +v -target-feature +zfh \ |
| 4 |
// RUN: -target-feature +zvfhmin -disable-O0-optnone \ |
| 5 |
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ |
| 6 |
// RUN: FileCheck --check-prefix=CHECK-RV64 %s |
| 7 |
|
| 8 |
#include <riscv_vector.h> |
| 9 |
|
| 10 |
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x i64> @test_vget_v_u64m4x2_u64m4 |
| 11 |
// CHECK-RV64-SAME: (target("riscv.vector.tuple", <vscale x 32 x i8>, 2) [[SRC:%.*]]) #[[ATTR0:[0-9]+]] { |
| 12 |
// CHECK-RV64-NEXT: entry: |
| 13 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i64> @llvm.riscv.tuple.extract.nxv4i64.triscv.vector.tuple_nxv32i8_2t(target("riscv.vector.tuple", <vscale x 32 x i8>, 2) [[SRC]], i32 1) |
| 14 |
// CHECK-RV64-NEXT: ret <vscale x 4 x i64> [[TMP0]] |
| 15 |
// |
| 16 |
vuint64m4_t test_vget_v_u64m4x2_u64m4(vuint64m4x2_t src) { |
| 17 |
return __riscv_vget_v_u64m4x2_u64m4(src, 1); |
| 18 |
} |
| 19 |
|
| 20 |
// CHECK-RV64-LABEL: define dso_local target("riscv.vector.tuple", <vscale x 32 x i8>, 2) @test_vset_v_u64m4_u64m4x2 |
| 21 |
// CHECK-RV64-SAME: (target("riscv.vector.tuple", <vscale x 32 x i8>, 2) [[DEST:%.*]], <vscale x 4 x i64> [[VAL:%.*]]) #[[ATTR0]] { |
| 22 |
// CHECK-RV64-NEXT: entry: |
| 23 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call target("riscv.vector.tuple", <vscale x 32 x i8>, 2) @llvm.riscv.tuple.insert.triscv.vector.tuple_nxv32i8_2t.nxv4i64(target("riscv.vector.tuple", <vscale x 32 x i8>, 2) [[DEST]], <vscale x 4 x i64> [[VAL]], i32 1) |
| 24 |
// CHECK-RV64-NEXT: ret target("riscv.vector.tuple", <vscale x 32 x i8>, 2) [[TMP0]] |
| 25 |
// |
| 26 |
vuint64m4x2_t test_vset_v_u64m4_u64m4x2(vuint64m4x2_t dest, vuint64m4_t val) { |
| 27 |
return __riscv_vset_v_u64m4_u64m4x2(dest, 1, val); |
| 28 |
} |