-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Add Zvfhmin extension for clang
This patch adds the Zvfhmin extension for clang. Reviewed By: craig.topper, michaelmaitland Differential Revision: https://reviews.llvm.org/D150253
- Loading branch information
1 parent
7037331
commit 654fa9a
Showing
8 changed files
with
92 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
clang/test/CodeGen/RISCV/rvv-intrinsics-handcrafted/zvfhmin-error.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py | ||
// REQUIRES: riscv-registered-target | ||
// RUN: %clang_cc1 -triple riscv64 -target-feature +v \ | ||
// RUN: -target-feature +zvfh -disable-O0-optnone \ | ||
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ | ||
// RUN: FileCheck --check-prefix=CHECK-ZVF %s | ||
|
||
// RUN: not %clang_cc1 -triple riscv64 -target-feature +v \ | ||
// RUN: -target-feature +zvfhmin -emit-llvm-only %s 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefix=CHECK-ZVFHMIN-ERR | ||
|
||
#include <riscv_vector.h> | ||
|
||
// CHECK-ZVF-LABEL: @test_vfadd_vv_f16m1( | ||
// CHECK-ZVF-NEXT: entry: | ||
// 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:%.*]]) | ||
// CHECK-ZVF-NEXT: ret <vscale x 4 x half> [[TMP0]] | ||
// | ||
|
||
// CHECK-ZVFHMIN-ERR: no matching function for call to '__riscv_vfadd' | ||
|
||
vfloat16m1_t test_vfadd_vv_f16m1(vfloat16m1_t op1, vfloat16m1_t op2, size_t vl) { | ||
return __riscv_vfadd(op1, op2, vl); | ||
} |
27 changes: 27 additions & 0 deletions
27
clang/test/CodeGen/RISCV/rvv-intrinsics-handcrafted/zvfhmin.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py | ||
// REQUIRES: riscv-registered-target | ||
// RUN: %clang_cc1 -triple riscv64 -target-feature +v \ | ||
// RUN: -target-feature +zvfhmin -disable-O0-optnone \ | ||
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ | ||
// RUN: FileCheck --check-prefix=CHECK-ZVFHMIN %s | ||
|
||
#include <riscv_vector.h> | ||
|
||
// CHECK-ZVFHMIN-LABEL: @test_vfncvt_f_f_w_f16m1( | ||
// CHECK-ZVFHMIN-NEXT: entry: | ||
// CHECK-ZVFHMIN-NEXT: [[TMP0:%.*]] = call <vscale x 4 x half> @llvm.riscv.vfncvt.f.f.w.nxv4f16.nxv4f32.i64(<vscale x 4 x half> poison, <vscale x 4 x float> [[SRC:%.*]], i64 [[VL:%.*]]) | ||
// CHECK-ZVFHMIN-NEXT: ret <vscale x 4 x half> [[TMP0]] | ||
// | ||
vfloat16m1_t test_vfncvt_f_f_w_f16m1(vfloat32m2_t src, size_t vl) { | ||
return __riscv_vfncvt_f(src, vl); | ||
} | ||
|
||
|
||
// CHECK-ZVFHMIN-LABEL: @test_vfwcvt_f_f_v_f16m1( | ||
// CHECK-ZVFHMIN-NEXT: entry: | ||
// CHECK-ZVFHMIN-NEXT: [[TMP0:%.*]] = call <vscale x 4 x float> @llvm.riscv.vfwcvt.f.f.v.nxv4f32.nxv4f16.i64(<vscale x 4 x float> poison, <vscale x 4 x half> [[SRC:%.*]], i64 [[VL:%.*]]) | ||
// CHECK-ZVFHMIN-NEXT: ret <vscale x 4 x float> [[TMP0]] | ||
// | ||
vfloat32m2_t test_vfwcvt_f_f_v_f16m1(vfloat16m1_t src, size_t vl) { | ||
return __riscv_vfwcvt_f(src, vl); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters