-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Add missing Xsfvcp extension check in clang sema
Differential Revision: https://reviews.llvm.org/D157474
- Loading branch information
Showing
3 changed files
with
47 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// REQUIRES: riscv-registered-target | ||
// RUN: %clang_cc1 -triple riscv32 -target-feature +v %s -fsyntax-only -verify | ||
|
||
#include <riscv_vector.h> | ||
#include <sifive_vector.h> | ||
|
||
vint8m1_t test_vloxei64_v_i8m1(const int8_t *base, vuint64m8_t bindex, size_t vl) { | ||
return __riscv_vloxei64(base, bindex, vl); // expected-error {{call to undeclared function '__riscv_vloxei64'}} expected-error {{returning 'int' from a function with incompatible result type 'vint8m1_t'}} | ||
} | ||
|
||
void test_vsoxei64_v_i8m1(int8_t *base, vuint64m8_t bindex, vint8m1_t value, size_t vl) { | ||
__riscv_vsoxei64(base, bindex, value, vl); // expected-error {{call to undeclared function '__riscv_vsoxei64'}} | ||
} | ||
|
||
void test_xsfvcp_sf_vc_x_se_u64m1(uint64_t rs1, size_t vl) { | ||
__riscv_sf_vc_x_se_u64m1(1, 1, 1, rs1, vl); // expected-error {{call to undeclared function '__riscv_sf_vc_x_se_u64m1'}} | ||
} |
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,19 @@ | ||
// REQUIRES: riscv-registered-target | ||
// RUN: %clang_cc1 -triple riscv64 -target-feature +v -target-feature +xsfvcp %s -fsyntax-only -verify | ||
|
||
// expected-no-diagnostics | ||
|
||
#include <riscv_vector.h> | ||
#include <sifive_vector.h> | ||
|
||
vint8m1_t test_vloxei64_v_i8m1(const int8_t *base, vuint64m8_t bindex, size_t vl) { | ||
return __riscv_vloxei64(base, bindex, vl); | ||
} | ||
|
||
void test_vsoxei64_v_i8m1(int8_t *base, vuint64m8_t bindex, vint8m1_t value, size_t vl) { | ||
__riscv_vsoxei64(base, bindex, value, vl); | ||
} | ||
|
||
void test_sf_vc_x_se_u64m1(uint64_t rs1, size_t vl) { | ||
__riscv_sf_vc_x_se_u64m1(1, 1, 1, rs1, vl); | ||
} |