diff options
author | Farzon Lotfi <1802579+farzonl@users.noreply.github.com> | 2024-06-22 20:17:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-22 17:17:34 -0700 |
commit | f73ac218a666e2017565f2210b47332ddcf55f00 (patch) | |
tree | eea6bcf40a4736a0111a44e1bf2f6faf35cf8d8e /clang/test/Sema/riscv-rvv-vector-trig-ops.c | |
parent | f3005d5b86ca947977f6056552b2a4648b9f0460 (diff) | |
download | llvm-f73ac218a666e2017565f2210b47332ddcf55f00.zip llvm-f73ac218a666e2017565f2210b47332ddcf55f00.tar.gz llvm-f73ac218a666e2017565f2210b47332ddcf55f00.tar.bz2 |
[HLSL][clang] Add elementwise builtins for trig intrinsics (#95999)
This change is part of this proposal:
https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294
This is part 3 of 4 PRs. It sets the ground work for using the
intrinsics in HLSL.
Add HLSL frontend apis for `acos`, `asin`, `atan`, `cosh`, `sinh`, and
`tanh`
https://github.com/llvm/llvm-project/issues/70079
https://github.com/llvm/llvm-project/issues/70080
https://github.com/llvm/llvm-project/issues/70081
https://github.com/llvm/llvm-project/issues/70083
https://github.com/llvm/llvm-project/issues/70084
https://github.com/llvm/llvm-project/issues/95966
Diffstat (limited to 'clang/test/Sema/riscv-rvv-vector-trig-ops.c')
-rw-r--r-- | clang/test/Sema/riscv-rvv-vector-trig-ops.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/clang/test/Sema/riscv-rvv-vector-trig-ops.c b/clang/test/Sema/riscv-rvv-vector-trig-ops.c index 459582f..f0cd5ca 100644 --- a/clang/test/Sema/riscv-rvv-vector-trig-ops.c +++ b/clang/test/Sema/riscv-rvv-vector-trig-ops.c @@ -5,6 +5,23 @@ #include <riscv_vector.h>
+vfloat32mf2_t test_asin_vv_i8mf8(vfloat32mf2_t v) {
+
+ return __builtin_elementwise_asin(v);
+ // expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
+ }
+
+ vfloat32mf2_t test_acos_vv_i8mf8(vfloat32mf2_t v) {
+
+ return __builtin_elementwise_acos(v);
+ // expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
+ }
+
+ vfloat32mf2_t test_atan_vv_i8mf8(vfloat32mf2_t v) {
+
+ return __builtin_elementwise_atan(v);
+ // expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
+ }
vfloat32mf2_t test_sin_vv_i8mf8(vfloat32mf2_t v) {
@@ -23,3 +40,22 @@ vfloat32mf2_t test_tan_vv_i8mf8(vfloat32mf2_t v) { return __builtin_elementwise_tan(v);
// expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
}
+
+vfloat32mf2_t test_sinh_vv_i8mf8(vfloat32mf2_t v) {
+
+ return __builtin_elementwise_sinh(v);
+ // expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
+ }
+
+ vfloat32mf2_t test_cosh_vv_i8mf8(vfloat32mf2_t v) {
+
+ return __builtin_elementwise_cosh(v);
+ // expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
+ }
+
+ vfloat32mf2_t test_tanh_vv_i8mf8(vfloat32mf2_t v) {
+
+ return __builtin_elementwise_tanh(v);
+ // expected-error@-1 {{1st argument must be a vector, integer or floating point type}}
+ }
+
\ No newline at end of file |