================
@@ -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]]
----------------
E00N777 wrote:
@banach-space
Should we keep the argument and return value checks in the LLVM tests? I'm
asking because the two existing test files don't seem to follow a consistent
style.
https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/AArch64/sve/len.c
&&
https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/AArch64/sve/dup.c
https://github.com/llvm/llvm-project/pull/225648
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits