| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 |
// REQUIRES: riscv-registered-target |
| 3 |
// RUN: %clang_cc1 -triple riscv64 -target-feature +v \ |
| 4 |
// RUN: -target-feature +zvfh -disable-O0-optnone \ |
| 5 |
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ |
| 6 |
// RUN: FileCheck --check-prefix=CHECK-ZVF %s |
| 7 |
|
| 8 |
// RUN: not %clang_cc1 -triple riscv64 -target-feature +v \ |
| 9 |
// RUN: -target-feature +zvfhmin -emit-llvm-only %s 2>&1 | \ |
| 10 |
// RUN: FileCheck %s --check-prefix=CHECK-ZVFHMIN-ERR |
| 11 |
|
| 12 |
#include <riscv_vector.h> |
| 13 |
|
| 14 |
// CHECK-ZVF-LABEL: @test_vfadd_vv_f16m1( |
| 15 |
// CHECK-ZVF-NEXT: entry: |
| 16 |
// CHECK-ZVF-NEXT: [[TMP0:%.*]] = call <vscale x 4 x half> @llvm.riscv.vfadd.nxv4f16.nxv4f16.i64(<vscale x 4 x half> poison, <vscale x 4 x half> [[OP1:%.*]], <vscale x 4 x half> [[OP2:%.*]], i64 [[VL:%.*]]) |
| 17 |
// CHECK-ZVF-NEXT: ret <vscale x 4 x half> [[TMP0]] |
| 18 |
// |
| 19 |
|
| 20 |
// CHECK-ZVFHMIN-ERR: builtin requires at least one of the following extensions: zvfh |
| 21 |
|
| 22 |
vfloat16m1_t test_vfadd_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { |
| 23 |
return __riscv_vfadd(op1, op2, vl); |
| 24 |
} |