================
@@ -0,0 +1,205 @@
+// REQUIRES: aarch64-registered-target
+
+// DEFINE: %{optimize} = opt -passes=mem2reg,instcombine,tailcallelim -S
+
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_sve                        
-fclangir -emit-cir -disable-O0-optnone -o - %s                       | 
FileCheck %s --check-prefixes=C,CIR %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_sve -DSVE_OVERLOADED_FORMS 
-fclangir -emit-cir -disable-O0-optnone -o - %s                       | 
FileCheck %s --check-prefixes=C,CIR %}
+
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_sve                        
-fclangir -emit-llvm -disable-O0-optnone -o - %s        | %{optimize} | 
FileCheck %s --check-prefixes=C,LLVM %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_sve -DSVE_OVERLOADED_FORMS 
-fclangir -emit-llvm -disable-O0-optnone -o - %s        | %{optimize} | 
FileCheck %s --check-prefixes=C,LLVM %}
+// RUN: %if cir-enabled %{%clang_cc1_cg_arm64_sve -DSVE_OVERLOADED_FORMS 
-fclangir -emit-llvm -disable-O0-optnone -o - -x c++ %s | %{optimize} | 
FileCheck %s --check-prefixes=CPP,LLVM %}
+
+// RUN:                   %clang_cc1_cg_arm64_sve                              
    -emit-llvm -disable-O0-optnone -o - %s        | %{optimize} | FileCheck %s 
--check-prefixes=C,LLVM
+// RUN:                   %clang_cc1_cg_arm64_sve -DSVE_OVERLOADED_FORMS       
    -emit-llvm -disable-O0-optnone -o - %s        | %{optimize} | FileCheck %s 
--check-prefixes=C,LLVM
+// RUN:                   %clang_cc1_cg_arm64_sve -DSVE_OVERLOADED_FORMS       
    -emit-llvm -disable-O0-optnone -o - -x c++ %s | %{optimize} | FileCheck %s 
--check-prefixes=CPP,LLVM
+
+//=============================================================================
+// NOTES
+//
+// Tests for SVE ADDV intrinsics
+//=============================================================================
+
+#include <arm_sve.h>
+
+#if defined __ARM_FEATURE_SME
+#define MODE_ATTR __arm_streaming
+#else
+#define MODE_ATTR
+#endif
+
+#ifdef SVE_OVERLOADED_FORMS
+// A simple used,unused... macro, long enough to represent any SVE builtin.
+#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
+#else
+#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
+#endif
+
+// C-LABEL: @test_svaddv_s8(
+// CPP-LABEL: @_Z14test_svaddv_s8u10__SVBool_tu10__SVInt8_t(
+int64_t test_svaddv_s8(svbool_t pg, svint8_t op) MODE_ATTR
+{
+// CIR:           %[[RES:.*]] = cir.call_llvm_intrinsic "aarch64.sve.saddv" 
%{{.*}}, %{{.*}} :
+// CIR-SAME:          -> !s64i
+
+// LLVM-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
+// LLVM:    [[TMP0:%.*]] = tail call i64 
@llvm.aarch64.sve.saddv.nxv16i8(<vscale x 16 x i1> [[PG]], <vscale x 16 x i8> 
[[OP]])
+// LLVM:    ret i64 [[TMP0]]
----------------
bruteforceboy wrote:

hmm, I am using 
[this](https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/AArch64/sve/dup.c)
 as a reference from the task description and it has checks for return values. 
Is it really unnecessary?

https://github.com/llvm/llvm-project/pull/225648
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to