[clang] f525820 - [SveEmitter] Add builtins for SVE2 Narrowing DSP operations
Sander de Smalen via cfe-commits
cfe-commits at lists.llvm.org
Thu May 7 08:12:48 PDT 2020
Author: Sander de Smalen
Date: 2020-05-07T16:09:31+01:00
New Revision: f525820755426ece485d5d01002527f6a20d8016
URL: https://github.com/llvm/llvm-project/commit/f525820755426ece485d5d01002527f6a20d8016
DIFF: https://github.com/llvm/llvm-project/commit/f525820755426ece485d5d01002527f6a20d8016.diff
LOG: [SveEmitter] Add builtins for SVE2 Narrowing DSP operations
This patch adds builtins for:
- svaddhnb
- svaddhnt
- svqrshrnb
- svqrshrnt
- svqrshrunb
- svqrshrunt
- svqshrnb
- svqshrnt
- svqshrunb
- svqshrunt
- svqxtnb
- svqxtnt
- svqxtunb
- svqxtunt
- svraddhnb
- svraddhnt
- svrshrnb
- svrshrnt
- svrsubhnb
- svrsubhnt
- svshrnb
- svshrnt
- svsubhnb
- svsubhnt
Added:
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_addhnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_addhnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrunb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrunt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrunb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrunt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtunb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtunt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_raddhnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_raddhnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rshrnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rshrnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rsubhnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rsubhnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_shrnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_subhnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_subhnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrunb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrunt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrunb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrunt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_rshrnb.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_rshrnt.c
clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_shrnt.c
Modified:
clang/include/clang/Basic/arm_sve.td
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/arm_sve.td b/clang/include/clang/Basic/arm_sve.td
index 027f16cd5afe..77d64a579056 100644
--- a/clang/include/clang/Basic/arm_sve.td
+++ b/clang/include/clang/Basic/arm_sve.td
@@ -805,12 +805,6 @@ def SVCMPHI_WIDE_N : SInst<"svcmpgt_wide[_n_{d}]", "PPdj", "UcUsUi", MergeNone,
def SVCMPLO_WIDE_N : SInst<"svcmplt_wide[_n_{d}]", "PPdj", "UcUsUi", MergeNone, "aarch64_sve_cmplo_wide">;
def SVCMPLS_WIDE_N : SInst<"svcmple_wide[_n_{d}]", "PPdj", "UcUsUi", MergeNone, "aarch64_sve_cmpls_wide">;
-////////////////////////////////////////////////////////////////////////////////
-// SVE2 - Narrowing DSP operations
-let ArchGuard = "defined(__ARM_FEATURE_SVE2)" in {
-def SVSHRNB : SInst<"svshrnb[_n_{d}]", "hdi", "silUsUiUl", MergeNone, "aarch64_sve_shrnb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
-}
-
////////////////////////////////////////////////////////////////////////////////
// While comparisons
@@ -1507,6 +1501,60 @@ def SVQDMULLB_LANE : SInst<"svqdmullb_lane[_{d}]", "dhhi", "il", MergeNone, "
def SVQDMULLT_LANE : SInst<"svqdmullt_lane[_{d}]", "dhhi", "il", MergeNone, "aarch64_sve_sqdmullt_lane", [], [ImmCheck<2, ImmCheckLaneIndex, 1>]>;
}
+////////////////////////////////////////////////////////////////////////////////
+// SVE2 - Narrowing DSP operations
+
+let ArchGuard = "defined(__ARM_FEATURE_SVE2)" in {
+def SVADDHNB : SInst<"svaddhnb[_{d}]", "hdd", "silUsUiUl", MergeNone, "aarch64_sve_addhnb">;
+def SVADDHNT : SInst<"svaddhnt[_{d}]", "hhdd", "silUsUiUl", MergeNone, "aarch64_sve_addhnt">;
+def SVRADDHNB : SInst<"svraddhnb[_{d}]", "hdd", "silUsUiUl", MergeNone, "aarch64_sve_raddhnb">;
+def SVRADDHNT : SInst<"svraddhnt[_{d}]", "hhdd", "silUsUiUl", MergeNone, "aarch64_sve_raddhnt">;
+def SVRSUBHNB : SInst<"svrsubhnb[_{d}]", "hdd", "silUsUiUl", MergeNone, "aarch64_sve_rsubhnb">;
+def SVRSUBHNT : SInst<"svrsubhnt[_{d}]", "hhdd", "silUsUiUl", MergeNone, "aarch64_sve_rsubhnt">;
+def SVSUBHNB : SInst<"svsubhnb[_{d}]", "hdd", "silUsUiUl", MergeNone, "aarch64_sve_subhnb">;
+def SVSUBHNT : SInst<"svsubhnt[_{d}]", "hhdd", "silUsUiUl", MergeNone, "aarch64_sve_subhnt">;
+
+def SVADDHNB_N : SInst<"svaddhnb[_n_{d}]", "hda", "silUsUiUl", MergeNone, "aarch64_sve_addhnb">;
+def SVADDHNT_N : SInst<"svaddhnt[_n_{d}]", "hhda", "silUsUiUl", MergeNone, "aarch64_sve_addhnt">;
+def SVRADDHNB_N : SInst<"svraddhnb[_n_{d}]", "hda", "silUsUiUl", MergeNone, "aarch64_sve_raddhnb">;
+def SVRADDHNT_N : SInst<"svraddhnt[_n_{d}]", "hhda", "silUsUiUl", MergeNone, "aarch64_sve_raddhnt">;
+def SVRSUBHNB_N : SInst<"svrsubhnb[_n_{d}]", "hda", "silUsUiUl", MergeNone, "aarch64_sve_rsubhnb">;
+def SVRSUBHNT_N : SInst<"svrsubhnt[_n_{d}]", "hhda", "silUsUiUl", MergeNone, "aarch64_sve_rsubhnt">;
+def SVSUBHNB_N : SInst<"svsubhnb[_n_{d}]", "hda", "silUsUiUl", MergeNone, "aarch64_sve_subhnb">;
+def SVSUBHNT_N : SInst<"svsubhnt[_n_{d}]", "hhda", "silUsUiUl", MergeNone, "aarch64_sve_subhnt">;
+
+def SVSHRNB : SInst<"svshrnb[_n_{d}]", "hdi", "silUsUiUl", MergeNone, "aarch64_sve_shrnb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
+def SVRSHRNB : SInst<"svrshrnb[_n_{d}]", "hdi", "silUsUiUl", MergeNone, "aarch64_sve_rshrnb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
+def SVQSHRUNB : SInst<"svqshrunb[_n_{d}]", "edi", "sil", MergeNone, "aarch64_sve_sqshrunb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
+def SVQRSHRUNB : SInst<"svqrshrunb[_n_{d}]", "edi", "sil", MergeNone, "aarch64_sve_sqrshrunb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
+def SVQSHRNB_S : SInst<"svqshrnb[_n_{d}]", "hdi", "sil", MergeNone, "aarch64_sve_sqshrnb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
+def SVQSHRNB_U : SInst<"svqshrnb[_n_{d}]", "hdi", "UsUiUl", MergeNone, "aarch64_sve_uqshrnb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
+def SVQRSHRNB_S : SInst<"svqrshrnb[_n_{d}]", "hdi", "sil", MergeNone, "aarch64_sve_sqrshrnb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
+def SVQRSHRNB_U : SInst<"svqrshrnb[_n_{d}]", "hdi", "UsUiUl", MergeNone, "aarch64_sve_uqrshrnb", [], [ImmCheck<1, ImmCheckShiftRightNarrow, 0>]>;
+
+def SVSHRNT : SInst<"svshrnt[_n_{d}]", "hhdi", "silUsUiUl", MergeNone, "aarch64_sve_shrnt", [], [ImmCheck<2, ImmCheckShiftRightNarrow, 1>]>;
+def SVRSHRNT : SInst<"svrshrnt[_n_{d}]", "hhdi", "silUsUiUl", MergeNone, "aarch64_sve_rshrnt", [], [ImmCheck<2, ImmCheckShiftRightNarrow, 1>]>;
+def SVQSHRUNT : SInst<"svqshrunt[_n_{d}]", "eedi", "sil", MergeNone, "aarch64_sve_sqshrunt", [], [ImmCheck<2, ImmCheckShiftRightNarrow, 1>]>;
+def SVQRSHRUNT : SInst<"svqrshrunt[_n_{d}]", "eedi", "sil", MergeNone, "aarch64_sve_sqrshrunt", [], [ImmCheck<2, ImmCheckShiftRightNarrow, 1>]>;
+def SVQSHRNT_S : SInst<"svqshrnt[_n_{d}]", "hhdi", "sil", MergeNone, "aarch64_sve_sqshrnt", [], [ImmCheck<2, ImmCheckShiftRightNarrow, 1>]>;
+def SVQSHRNT_U : SInst<"svqshrnt[_n_{d}]", "hhdi", "UsUiUl", MergeNone, "aarch64_sve_uqshrnt", [], [ImmCheck<2, ImmCheckShiftRightNarrow, 1>]>;
+def SVQRSHRNT_S : SInst<"svqrshrnt[_n_{d}]", "hhdi", "sil", MergeNone, "aarch64_sve_sqrshrnt", [], [ImmCheck<2, ImmCheckShiftRightNarrow, 1>]>;
+def SVQRSHRNT_U : SInst<"svqrshrnt[_n_{d}]", "hhdi", "UsUiUl", MergeNone, "aarch64_sve_uqrshrnt", [], [ImmCheck<2, ImmCheckShiftRightNarrow, 1>]>;
+}
+////////////////////////////////////////////////////////////////////////////////
+// SVE2 - Unary narrowing operations
+
+let ArchGuard = "defined(__ARM_FEATURE_SVE2)" in {
+def SVQXTNB_S : SInst<"svqxtnb[_{d}]", "hd", "sil", MergeNone, "aarch64_sve_sqxtnb">;
+def SVQXTNB_U : SInst<"svqxtnb[_{d}]", "hd", "UsUiUl", MergeNone, "aarch64_sve_uqxtnb">;
+def SVQXTUNB_S : SInst<"svqxtunb[_{d}]", "ed", "sil", MergeNone, "aarch64_sve_sqxtunb">;
+
+def SVQXTNT_S : SInst<"svqxtnt[_{d}]", "hhd", "sil", MergeNone, "aarch64_sve_sqxtnt">;
+def SVQXTNT_U : SInst<"svqxtnt[_{d}]", "hhd", "UsUiUl", MergeNone, "aarch64_sve_uqxtnt">;
+def SVQXTUNT_S : SInst<"svqxtunt[_{d}]", "eed", "sil", MergeNone, "aarch64_sve_sqxtunt">;
+}
+
+
////////////////////////////////////////////////////////////////////////////////
// SVE2 - Non-temporal gather/scatter
let ArchGuard = "defined(__ARM_FEATURE_SVE2)" in {
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_addhnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_addhnb.c
new file mode 100644
index 000000000000..27efc36efedc
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_addhnb.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svaddhnb_s16(svint16_t op1, svint16_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.addhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_s16'}}
+ return SVE_ACLE_FUNC(svaddhnb,_s16,,)(op1, op2);
+}
+
+svint16_t test_svaddhnb_s32(svint32_t op1, svint32_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.addhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_s32'}}
+ return SVE_ACLE_FUNC(svaddhnb,_s32,,)(op1, op2);
+}
+
+svint32_t test_svaddhnb_s64(svint64_t op1, svint64_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.addhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_s64'}}
+ return SVE_ACLE_FUNC(svaddhnb,_s64,,)(op1, op2);
+}
+
+svuint8_t test_svaddhnb_u16(svuint16_t op1, svuint16_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.addhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_u16'}}
+ return SVE_ACLE_FUNC(svaddhnb,_u16,,)(op1, op2);
+}
+
+svuint16_t test_svaddhnb_u32(svuint32_t op1, svuint32_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.addhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_u32'}}
+ return SVE_ACLE_FUNC(svaddhnb,_u32,,)(op1, op2);
+}
+
+svuint32_t test_svaddhnb_u64(svuint64_t op1, svuint64_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.addhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_u64'}}
+ return SVE_ACLE_FUNC(svaddhnb,_u64,,)(op1, op2);
+}
+
+svint8_t test_svaddhnb_n_s16(svint16_t op1, int16_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_n_s16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.addhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_n_s16'}}
+ return SVE_ACLE_FUNC(svaddhnb,_n_s16,,)(op1, op2);
+}
+
+svint16_t test_svaddhnb_n_s32(svint32_t op1, int32_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_n_s32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.addhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_n_s32'}}
+ return SVE_ACLE_FUNC(svaddhnb,_n_s32,,)(op1, op2);
+}
+
+svint32_t test_svaddhnb_n_s64(svint64_t op1, int64_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_n_s64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.addhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_n_s64'}}
+ return SVE_ACLE_FUNC(svaddhnb,_n_s64,,)(op1, op2);
+}
+
+svuint8_t test_svaddhnb_n_u16(svuint16_t op1, uint16_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_n_u16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.addhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_n_u16'}}
+ return SVE_ACLE_FUNC(svaddhnb,_n_u16,,)(op1, op2);
+}
+
+svuint16_t test_svaddhnb_n_u32(svuint32_t op1, uint32_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_n_u32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.addhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_n_u32'}}
+ return SVE_ACLE_FUNC(svaddhnb,_n_u32,,)(op1, op2);
+}
+
+svuint32_t test_svaddhnb_n_u64(svuint64_t op1, uint64_t op2)
+{
+ // CHECK-LABEL: test_svaddhnb_n_u64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.addhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnb_n_u64'}}
+ return SVE_ACLE_FUNC(svaddhnb,_n_u64,,)(op1, op2);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_addhnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_addhnt.c
new file mode 100644
index 000000000000..700c59d6b82a
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_addhnt.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svaddhnt_s16(svint8_t op1, svint16_t op2, svint16_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.addhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_s16'}}
+ return SVE_ACLE_FUNC(svaddhnt,_s16,,)(op1, op2, op3);
+}
+
+svint16_t test_svaddhnt_s32(svint16_t op1, svint32_t op2, svint32_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.addhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_s32'}}
+ return SVE_ACLE_FUNC(svaddhnt,_s32,,)(op1, op2, op3);
+}
+
+svint32_t test_svaddhnt_s64(svint32_t op1, svint64_t op2, svint64_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.addhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_s64'}}
+ return SVE_ACLE_FUNC(svaddhnt,_s64,,)(op1, op2, op3);
+}
+
+svuint8_t test_svaddhnt_u16(svuint8_t op1, svuint16_t op2, svuint16_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.addhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_u16'}}
+ return SVE_ACLE_FUNC(svaddhnt,_u16,,)(op1, op2, op3);
+}
+
+svuint16_t test_svaddhnt_u32(svuint16_t op1, svuint32_t op2, svuint32_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.addhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_u32'}}
+ return SVE_ACLE_FUNC(svaddhnt,_u32,,)(op1, op2, op3);
+}
+
+svuint32_t test_svaddhnt_u64(svuint32_t op1, svuint64_t op2, svuint64_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.addhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_u64'}}
+ return SVE_ACLE_FUNC(svaddhnt,_u64,,)(op1, op2, op3);
+}
+
+svint8_t test_svaddhnt_n_s16(svint8_t op1, svint16_t op2, int16_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_n_s16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.addhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_n_s16'}}
+ return SVE_ACLE_FUNC(svaddhnt,_n_s16,,)(op1, op2, op3);
+}
+
+svint16_t test_svaddhnt_n_s32(svint16_t op1, svint32_t op2, int32_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_n_s32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.addhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_n_s32'}}
+ return SVE_ACLE_FUNC(svaddhnt,_n_s32,,)(op1, op2, op3);
+}
+
+svint32_t test_svaddhnt_n_s64(svint32_t op1, svint64_t op2, int64_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_n_s64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.addhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_n_s64'}}
+ return SVE_ACLE_FUNC(svaddhnt,_n_s64,,)(op1, op2, op3);
+}
+
+svuint8_t test_svaddhnt_n_u16(svuint8_t op1, svuint16_t op2, uint16_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_n_u16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.addhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_n_u16'}}
+ return SVE_ACLE_FUNC(svaddhnt,_n_u16,,)(op1, op2, op3);
+}
+
+svuint16_t test_svaddhnt_n_u32(svuint16_t op1, svuint32_t op2, uint32_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_n_u32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.addhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_n_u32'}}
+ return SVE_ACLE_FUNC(svaddhnt,_n_u32,,)(op1, op2, op3);
+}
+
+svuint32_t test_svaddhnt_n_u64(svuint32_t op1, svuint64_t op2, uint64_t op3)
+{
+ // CHECK-LABEL: test_svaddhnt_n_u64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.addhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svaddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svaddhnt_n_u64'}}
+ return SVE_ACLE_FUNC(svaddhnt,_n_u64,,)(op1, op2, op3);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrnb.c
new file mode 100644
index 000000000000..991739d2ddc0
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrnb.c
@@ -0,0 +1,133 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svqrshrnb_n_s16(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqrshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_s16'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s16,,)(op1, 1);
+}
+
+svint8_t test_svqrshrnb_n_s16_1(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqrshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_s16'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s16,,)(op1, 8);
+}
+
+svint16_t test_svqrshrnb_n_s32(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqrshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_s32'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s32,,)(op1, 1);
+}
+
+svint16_t test_svqrshrnb_n_s32_1(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqrshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_s32'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s32,,)(op1, 16);
+}
+
+svint32_t test_svqrshrnb_n_s64(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqrshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_s64'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s64,,)(op1, 1);
+}
+
+svint32_t test_svqrshrnb_n_s64_1(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqrshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_s64'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s64,,)(op1, 32);
+}
+
+svuint8_t test_svqrshrnb_n_u16(svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqrshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_u16'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u16,,)(op1, 1);
+}
+
+svuint8_t test_svqrshrnb_n_u16_1(svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_u16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqrshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_u16'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u16,,)(op1, 8);
+}
+
+svuint16_t test_svqrshrnb_n_u32(svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqrshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_u32'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u32,,)(op1, 1);
+}
+
+svuint16_t test_svqrshrnb_n_u32_1(svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_u32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqrshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_u32'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u32,,)(op1, 16);
+}
+
+svuint32_t test_svqrshrnb_n_u64(svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqrshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_u64'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u64,,)(op1, 1);
+}
+
+svuint32_t test_svqrshrnb_n_u64_1(svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnb_n_u64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqrshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnb_n_u64'}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u64,,)(op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrnt.c
new file mode 100644
index 000000000000..33686277aa2f
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrnt.c
@@ -0,0 +1,133 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svqrshrnt_n_s16(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqrshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_s16'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s16,,)(op, op1, 1);
+}
+
+svint8_t test_svqrshrnt_n_s16_1(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqrshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_s16'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s16,,)(op, op1, 8);
+}
+
+svint16_t test_svqrshrnt_n_s32(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqrshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_s32'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s32,,)(op, op1, 1);
+}
+
+svint16_t test_svqrshrnt_n_s32_1(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqrshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_s32'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s32,,)(op, op1, 16);
+}
+
+svint32_t test_svqrshrnt_n_s64(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqrshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_s64'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s64,,)(op, op1, 1);
+}
+
+svint32_t test_svqrshrnt_n_s64_1(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqrshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_s64'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s64,,)(op, op1, 32);
+}
+
+svuint8_t test_svqrshrnt_n_u16(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqrshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_u16'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u16,,)(op, op1, 1);
+}
+
+svuint8_t test_svqrshrnt_n_u16_1(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_u16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqrshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_u16'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u16,,)(op, op1, 8);
+}
+
+svuint16_t test_svqrshrnt_n_u32(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqrshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_u32'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u32,,)(op, op1, 1);
+}
+
+svuint16_t test_svqrshrnt_n_u32_1(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_u32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqrshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_u32'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u32,,)(op, op1, 16);
+}
+
+svuint32_t test_svqrshrnt_n_u64(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqrshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_u64'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u64,,)(op, op1, 1);
+}
+
+svuint32_t test_svqrshrnt_n_u64_1(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrnt_n_u64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqrshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrnt_n_u64'}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u64,,)(op, op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrunb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrunb.c
new file mode 100644
index 000000000000..7e3777819e0e
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrunb.c
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svuint8_t test_svqrshrunb_n_s16(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunb_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqrshrunb.nxv8i16(<vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunb_n_s16'}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s16,,)(op1, 1);
+}
+
+svuint8_t test_svqrshrunb_n_s16_1(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunb_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqrshrunb.nxv8i16(<vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunb_n_s16'}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s16,,)(op1, 8);
+}
+
+svuint16_t test_svqrshrunb_n_s32(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunb_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqrshrunb.nxv4i32(<vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunb_n_s32'}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s32,,)(op1, 1);
+}
+
+svuint16_t test_svqrshrunb_n_s32_1(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunb_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqrshrunb.nxv4i32(<vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunb_n_s32'}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s32,,)(op1, 16);
+}
+
+svuint32_t test_svqrshrunb_n_s64(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunb_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqrshrunb.nxv2i64(<vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunb_n_s64'}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s64,,)(op1, 1);
+}
+
+svuint32_t test_svqrshrunb_n_s64_1(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunb_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqrshrunb.nxv2i64(<vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunb_n_s64'}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s64,,)(op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrunt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrunt.c
new file mode 100644
index 000000000000..5e96435b265b
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qrshrunt.c
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svuint8_t test_svqrshrunt_n_s16(svuint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunt_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqrshrunt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunt_n_s16'}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s16,,)(op, op1, 1);
+}
+
+svuint8_t test_svqrshrunt_n_s16_1(svuint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunt_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqrshrunt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunt_n_s16'}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s16,,)(op, op1, 8);
+}
+
+svuint16_t test_svqrshrunt_n_s32(svuint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunt_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqrshrunt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunt_n_s32'}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s32,,)(op, op1, 1);
+}
+
+svuint16_t test_svqrshrunt_n_s32_1(svuint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunt_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqrshrunt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunt_n_s32'}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s32,,)(op, op1, 16);
+}
+
+svuint32_t test_svqrshrunt_n_s64(svuint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunt_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqrshrunt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunt_n_s64'}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s64,,)(op, op1, 1);
+}
+
+svuint32_t test_svqrshrunt_n_s64_1(svuint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqrshrunt_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqrshrunt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqrshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqrshrunt_n_s64'}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s64,,)(op, op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrnb.c
new file mode 100644
index 000000000000..d4c1719bc036
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrnb.c
@@ -0,0 +1,133 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svqshrnb_n_s16(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_s16'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s16,,)(op1, 1);
+}
+
+svint8_t test_svqshrnb_n_s16_1(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_s16'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s16,,)(op1, 8);
+}
+
+svint16_t test_svqshrnb_n_s32(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_s32'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s32,,)(op1, 1);
+}
+
+svint16_t test_svqshrnb_n_s32_1(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_s32'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s32,,)(op1, 16);
+}
+
+svint32_t test_svqshrnb_n_s64(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_s64'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s64,,)(op1, 1);
+}
+
+svint32_t test_svqshrnb_n_s64_1(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_s64'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s64,,)(op1, 32);
+}
+
+svuint8_t test_svqshrnb_n_u16(svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_u16'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u16,,)(op1, 1);
+}
+
+svuint8_t test_svqshrnb_n_u16_1(svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_u16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_u16'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u16,,)(op1, 8);
+}
+
+svuint16_t test_svqshrnb_n_u32(svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_u32'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u32,,)(op1, 1);
+}
+
+svuint16_t test_svqshrnb_n_u32_1(svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_u32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_u32'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u32,,)(op1, 16);
+}
+
+svuint32_t test_svqshrnb_n_u64(svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_u64'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u64,,)(op1, 1);
+}
+
+svuint32_t test_svqshrnb_n_u64_1(svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrnb_n_u64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnb_n_u64'}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u64,,)(op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrnt.c
new file mode 100644
index 000000000000..5a68834978aa
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrnt.c
@@ -0,0 +1,133 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svqshrnt_n_s16(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_s16'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s16,,)(op, op1, 1);
+}
+
+svint8_t test_svqshrnt_n_s16_1(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_s16'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s16,,)(op, op1, 8);
+}
+
+svint16_t test_svqshrnt_n_s32(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_s32'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s32,,)(op, op1, 1);
+}
+
+svint16_t test_svqshrnt_n_s32_1(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_s32'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s32,,)(op, op1, 16);
+}
+
+svint32_t test_svqshrnt_n_s64(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_s64'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s64,,)(op, op1, 1);
+}
+
+svint32_t test_svqshrnt_n_s64_1(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_s64'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s64,,)(op, op1, 32);
+}
+
+svuint8_t test_svqshrnt_n_u16(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_u16'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u16,,)(op, op1, 1);
+}
+
+svuint8_t test_svqshrnt_n_u16_1(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_u16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_u16'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u16,,)(op, op1, 8);
+}
+
+svuint16_t test_svqshrnt_n_u32(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_u32'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u32,,)(op, op1, 1);
+}
+
+svuint16_t test_svqshrnt_n_u32_1(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_u32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_u32'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u32,,)(op, op1, 16);
+}
+
+svuint32_t test_svqshrnt_n_u64(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_u64'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u64,,)(op, op1, 1);
+}
+
+svuint32_t test_svqshrnt_n_u64_1(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrnt_n_u64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrnt_n_u64'}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u64,,)(op, op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrunb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrunb.c
new file mode 100644
index 000000000000..e012484e86c5
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrunb.c
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svuint8_t test_svqshrunb_n_s16(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrunb_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqshrunb.nxv8i16(<vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunb_n_s16'}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s16,,)(op1, 1);
+}
+
+svuint8_t test_svqshrunb_n_s16_1(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrunb_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqshrunb.nxv8i16(<vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunb_n_s16'}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s16,,)(op1, 8);
+}
+
+svuint16_t test_svqshrunb_n_s32(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrunb_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqshrunb.nxv4i32(<vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunb_n_s32'}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s32,,)(op1, 1);
+}
+
+svuint16_t test_svqshrunb_n_s32_1(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrunb_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqshrunb.nxv4i32(<vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunb_n_s32'}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s32,,)(op1, 16);
+}
+
+svuint32_t test_svqshrunb_n_s64(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrunb_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqshrunb.nxv2i64(<vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunb_n_s64'}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s64,,)(op1, 1);
+}
+
+svuint32_t test_svqshrunb_n_s64_1(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrunb_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqshrunb.nxv2i64(<vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunb_n_s64'}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s64,,)(op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrunt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrunt.c
new file mode 100644
index 000000000000..d6db3fb8d8f6
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qshrunt.c
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svuint8_t test_svqshrunt_n_s16(svuint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrunt_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqshrunt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunt_n_s16'}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s16,,)(op, op1, 1);
+}
+
+svuint8_t test_svqshrunt_n_s16_1(svuint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqshrunt_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqshrunt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunt_n_s16'}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s16,,)(op, op1, 8);
+}
+
+svuint16_t test_svqshrunt_n_s32(svuint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrunt_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqshrunt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunt_n_s32'}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s32,,)(op, op1, 1);
+}
+
+svuint16_t test_svqshrunt_n_s32_1(svuint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqshrunt_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqshrunt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunt_n_s32'}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s32,,)(op, op1, 16);
+}
+
+svuint32_t test_svqshrunt_n_s64(svuint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrunt_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqshrunt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunt_n_s64'}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s64,,)(op, op1, 1);
+}
+
+svuint32_t test_svqshrunt_n_s64_1(svuint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqshrunt_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqshrunt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqshrunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqshrunt_n_s64'}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s64,,)(op, op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtnb.c
new file mode 100644
index 000000000000..1586d22fb86e
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtnb.c
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svqxtnb_s16(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqxtnb_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqxtnb.nxv8i16(<vscale x 8 x i16> %op1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnb_s16'}}
+ return SVE_ACLE_FUNC(svqxtnb,_s16,,)(op1);
+}
+
+svint16_t test_svqxtnb_s32(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqxtnb_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqxtnb.nxv4i32(<vscale x 4 x i32> %op1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnb_s32'}}
+ return SVE_ACLE_FUNC(svqxtnb,_s32,,)(op1);
+}
+
+svint32_t test_svqxtnb_s64(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqxtnb_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqxtnb.nxv2i64(<vscale x 2 x i64> %op1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnb_s64'}}
+ return SVE_ACLE_FUNC(svqxtnb,_s64,,)(op1);
+}
+
+svuint8_t test_svqxtnb_u16(svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqxtnb_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqxtnb.nxv8i16(<vscale x 8 x i16> %op1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnb_u16'}}
+ return SVE_ACLE_FUNC(svqxtnb,_u16,,)(op1);
+}
+
+svuint16_t test_svqxtnb_u32(svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqxtnb_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqxtnb.nxv4i32(<vscale x 4 x i32> %op1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnb_u32'}}
+ return SVE_ACLE_FUNC(svqxtnb,_u32,,)(op1);
+}
+
+svuint32_t test_svqxtnb_u64(svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqxtnb_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqxtnb.nxv2i64(<vscale x 2 x i64> %op1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnb_u64'}}
+ return SVE_ACLE_FUNC(svqxtnb,_u64,,)(op1);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtnt.c
new file mode 100644
index 000000000000..68c99bcda1d4
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtnt.c
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svqxtnt_s16(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqxtnt_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqxtnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnt_s16'}}
+ return SVE_ACLE_FUNC(svqxtnt,_s16,,)(op, op1);
+}
+
+svint16_t test_svqxtnt_s32(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqxtnt_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqxtnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnt_s32'}}
+ return SVE_ACLE_FUNC(svqxtnt,_s32,,)(op, op1);
+}
+
+svint32_t test_svqxtnt_s64(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqxtnt_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqxtnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnt_s64'}}
+ return SVE_ACLE_FUNC(svqxtnt,_s64,,)(op, op1);
+}
+
+svuint8_t test_svqxtnt_u16(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svqxtnt_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.uqxtnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnt_u16'}}
+ return SVE_ACLE_FUNC(svqxtnt,_u16,,)(op, op1);
+}
+
+svuint16_t test_svqxtnt_u32(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svqxtnt_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.uqxtnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnt_u32'}}
+ return SVE_ACLE_FUNC(svqxtnt,_u32,,)(op, op1);
+}
+
+svuint32_t test_svqxtnt_u64(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svqxtnt_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.uqxtnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtnt_u64'}}
+ return SVE_ACLE_FUNC(svqxtnt,_u64,,)(op, op1);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtunb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtunb.c
new file mode 100644
index 000000000000..138fb51d85ba
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtunb.c
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svuint8_t test_svqxtunb_s16(svint16_t op1)
+{
+ // CHECK-LABEL: test_svqxtunb_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqxtunb.nxv8i16(<vscale x 8 x i16> %op1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtunb_s16'}}
+ return SVE_ACLE_FUNC(svqxtunb,_s16,,)(op1);
+}
+
+svuint16_t test_svqxtunb_s32(svint32_t op1)
+{
+ // CHECK-LABEL: test_svqxtunb_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqxtunb.nxv4i32(<vscale x 4 x i32> %op1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtunb_s32'}}
+ return SVE_ACLE_FUNC(svqxtunb,_s32,,)(op1);
+}
+
+svuint32_t test_svqxtunb_s64(svint64_t op1)
+{
+ // CHECK-LABEL: test_svqxtunb_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqxtunb.nxv2i64(<vscale x 2 x i64> %op1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtunb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtunb_s64'}}
+ return SVE_ACLE_FUNC(svqxtunb,_s64,,)(op1);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtunt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtunt.c
new file mode 100644
index 000000000000..6f7a96e3b243
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_qxtunt.c
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svuint8_t test_svqxtunt_u16(svuint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svqxtunt_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.sqxtunt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtunt_s16'}}
+ return SVE_ACLE_FUNC(svqxtunt,_s16,,)(op, op1);
+}
+
+svuint16_t test_svqxtunt_u32(svuint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svqxtunt_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.sqxtunt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtunt_s32'}}
+ return SVE_ACLE_FUNC(svqxtunt,_s32,,)(op, op1);
+}
+
+svuint32_t test_svqxtunt_u64(svuint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svqxtunt_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.sqxtunt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svqxtunt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svqxtunt_s64'}}
+ return SVE_ACLE_FUNC(svqxtunt,_s64,,)(op, op1);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_raddhnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_raddhnb.c
new file mode 100644
index 000000000000..b8504b794d48
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_raddhnb.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svraddhnb_s16(svint16_t op1, svint16_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.raddhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_s16'}}
+ return SVE_ACLE_FUNC(svraddhnb,_s16,,)(op1, op2);
+}
+
+svint16_t test_svraddhnb_s32(svint32_t op1, svint32_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.raddhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_s32'}}
+ return SVE_ACLE_FUNC(svraddhnb,_s32,,)(op1, op2);
+}
+
+svint32_t test_svraddhnb_s64(svint64_t op1, svint64_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.raddhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_s64'}}
+ return SVE_ACLE_FUNC(svraddhnb,_s64,,)(op1, op2);
+}
+
+svuint8_t test_svraddhnb_u16(svuint16_t op1, svuint16_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.raddhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_u16'}}
+ return SVE_ACLE_FUNC(svraddhnb,_u16,,)(op1, op2);
+}
+
+svuint16_t test_svraddhnb_u32(svuint32_t op1, svuint32_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.raddhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_u32'}}
+ return SVE_ACLE_FUNC(svraddhnb,_u32,,)(op1, op2);
+}
+
+svuint32_t test_svraddhnb_u64(svuint64_t op1, svuint64_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.raddhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_u64'}}
+ return SVE_ACLE_FUNC(svraddhnb,_u64,,)(op1, op2);
+}
+
+svint8_t test_svraddhnb_n_s16(svint16_t op1, int16_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_n_s16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.raddhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_n_s16'}}
+ return SVE_ACLE_FUNC(svraddhnb,_n_s16,,)(op1, op2);
+}
+
+svint16_t test_svraddhnb_n_s32(svint32_t op1, int32_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_n_s32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.raddhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_n_s32'}}
+ return SVE_ACLE_FUNC(svraddhnb,_n_s32,,)(op1, op2);
+}
+
+svint32_t test_svraddhnb_n_s64(svint64_t op1, int64_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_n_s64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.raddhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_n_s64'}}
+ return SVE_ACLE_FUNC(svraddhnb,_n_s64,,)(op1, op2);
+}
+
+svuint8_t test_svraddhnb_n_u16(svuint16_t op1, uint16_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_n_u16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.raddhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_n_u16'}}
+ return SVE_ACLE_FUNC(svraddhnb,_n_u16,,)(op1, op2);
+}
+
+svuint16_t test_svraddhnb_n_u32(svuint32_t op1, uint32_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_n_u32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.raddhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_n_u32'}}
+ return SVE_ACLE_FUNC(svraddhnb,_n_u32,,)(op1, op2);
+}
+
+svuint32_t test_svraddhnb_n_u64(svuint64_t op1, uint64_t op2)
+{
+ // CHECK-LABEL: test_svraddhnb_n_u64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.raddhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnb_n_u64'}}
+ return SVE_ACLE_FUNC(svraddhnb,_n_u64,,)(op1, op2);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_raddhnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_raddhnt.c
new file mode 100644
index 000000000000..fa313ef9cbab
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_raddhnt.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svraddhnt_s16(svint8_t op1, svint16_t op2, svint16_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.raddhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_s16'}}
+ return SVE_ACLE_FUNC(svraddhnt,_s16,,)(op1, op2, op3);
+}
+
+svint16_t test_svraddhnt_s32(svint16_t op1, svint32_t op2, svint32_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.raddhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_s32'}}
+ return SVE_ACLE_FUNC(svraddhnt,_s32,,)(op1, op2, op3);
+}
+
+svint32_t test_svraddhnt_s64(svint32_t op1, svint64_t op2, svint64_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.raddhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_s64'}}
+ return SVE_ACLE_FUNC(svraddhnt,_s64,,)(op1, op2, op3);
+}
+
+svuint8_t test_svraddhnt_u16(svuint8_t op1, svuint16_t op2, svuint16_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.raddhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_u16'}}
+ return SVE_ACLE_FUNC(svraddhnt,_u16,,)(op1, op2, op3);
+}
+
+svuint16_t test_svraddhnt_u32(svuint16_t op1, svuint32_t op2, svuint32_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.raddhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_u32'}}
+ return SVE_ACLE_FUNC(svraddhnt,_u32,,)(op1, op2, op3);
+}
+
+svuint32_t test_svraddhnt_u64(svuint32_t op1, svuint64_t op2, svuint64_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.raddhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_u64'}}
+ return SVE_ACLE_FUNC(svraddhnt,_u64,,)(op1, op2, op3);
+}
+
+svint8_t test_svraddhnt_n_s16(svint8_t op1, svint16_t op2, int16_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_n_s16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.raddhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_n_s16'}}
+ return SVE_ACLE_FUNC(svraddhnt,_n_s16,,)(op1, op2, op3);
+}
+
+svint16_t test_svraddhnt_n_s32(svint16_t op1, svint32_t op2, int32_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_n_s32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.raddhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_n_s32'}}
+ return SVE_ACLE_FUNC(svraddhnt,_n_s32,,)(op1, op2, op3);
+}
+
+svint32_t test_svraddhnt_n_s64(svint32_t op1, svint64_t op2, int64_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_n_s64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.raddhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_n_s64'}}
+ return SVE_ACLE_FUNC(svraddhnt,_n_s64,,)(op1, op2, op3);
+}
+
+svuint8_t test_svraddhnt_n_u16(svuint8_t op1, svuint16_t op2, uint16_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_n_u16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.raddhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_n_u16'}}
+ return SVE_ACLE_FUNC(svraddhnt,_n_u16,,)(op1, op2, op3);
+}
+
+svuint16_t test_svraddhnt_n_u32(svuint16_t op1, svuint32_t op2, uint32_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_n_u32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.raddhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_n_u32'}}
+ return SVE_ACLE_FUNC(svraddhnt,_n_u32,,)(op1, op2, op3);
+}
+
+svuint32_t test_svraddhnt_n_u64(svuint32_t op1, svuint64_t op2, uint64_t op3)
+{
+ // CHECK-LABEL: test_svraddhnt_n_u64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.raddhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svraddhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svraddhnt_n_u64'}}
+ return SVE_ACLE_FUNC(svraddhnt,_n_u64,,)(op1, op2, op3);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rshrnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rshrnb.c
new file mode 100644
index 000000000000..06cb1745d541
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rshrnb.c
@@ -0,0 +1,133 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svrshrnb_n_s16(svint16_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_s16'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s16,,)(op1, 1);
+}
+
+svint8_t test_svrshrnb_n_s16_1(svint16_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_s16'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s16,,)(op1, 8);
+}
+
+svint16_t test_svrshrnb_n_s32(svint32_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_s32'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s32,,)(op1, 1);
+}
+
+svint16_t test_svrshrnb_n_s32_1(svint32_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_s32'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s32,,)(op1, 16);
+}
+
+svint32_t test_svrshrnb_n_s64(svint64_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_s64'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s64,,)(op1, 1);
+}
+
+svint32_t test_svrshrnb_n_s64_1(svint64_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_s64'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s64,,)(op1, 32);
+}
+
+svuint8_t test_svrshrnb_n_u16(svuint16_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_u16'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u16,,)(op1, 1);
+}
+
+svuint8_t test_svrshrnb_n_u16_1(svuint16_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_u16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rshrnb.nxv8i16(<vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_u16'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u16,,)(op1, 8);
+}
+
+svuint16_t test_svrshrnb_n_u32(svuint32_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_u32'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u32,,)(op1, 1);
+}
+
+svuint16_t test_svrshrnb_n_u32_1(svuint32_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_u32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rshrnb.nxv4i32(<vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_u32'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u32,,)(op1, 16);
+}
+
+svuint32_t test_svrshrnb_n_u64(svuint64_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_u64'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u64,,)(op1, 1);
+}
+
+svuint32_t test_svrshrnb_n_u64_1(svuint64_t op1)
+{
+ // CHECK-LABEL: test_svrshrnb_n_u64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rshrnb.nxv2i64(<vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnb_n_u64'}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u64,,)(op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rshrnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rshrnt.c
new file mode 100644
index 000000000000..559d6c912c47
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rshrnt.c
@@ -0,0 +1,133 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svrshrnt_n_s16(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_s16'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s16,,)(op, op1, 1);
+}
+
+svint8_t test_svrshrnt_n_s16_1(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_s16'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s16,,)(op, op1, 8);
+}
+
+svint16_t test_svrshrnt_n_s32(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_s32'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s32,,)(op, op1, 1);
+}
+
+svint16_t test_svrshrnt_n_s32_1(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_s32'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s32,,)(op, op1, 16);
+}
+
+svint32_t test_svrshrnt_n_s64(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_s64'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s64,,)(op, op1, 1);
+}
+
+svint32_t test_svrshrnt_n_s64_1(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_s64'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s64,,)(op, op1, 32);
+}
+
+svuint8_t test_svrshrnt_n_u16(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_u16'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u16,,)(op, op1, 1);
+}
+
+svuint8_t test_svrshrnt_n_u16_1(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_u16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rshrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_u16'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u16,,)(op, op1, 8);
+}
+
+svuint16_t test_svrshrnt_n_u32(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_u32'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u32,,)(op, op1, 1);
+}
+
+svuint16_t test_svrshrnt_n_u32_1(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_u32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rshrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_u32'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u32,,)(op, op1, 16);
+}
+
+svuint32_t test_svrshrnt_n_u64(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_u64'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u64,,)(op, op1, 1);
+}
+
+svuint32_t test_svrshrnt_n_u64_1(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svrshrnt_n_u64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rshrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrshrnt_n_u64'}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u64,,)(op, op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rsubhnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rsubhnb.c
new file mode 100644
index 000000000000..e424bef58218
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rsubhnb.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svrsubhnb_s16(svint16_t op1, svint16_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rsubhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_s16'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_s16,,)(op1, op2);
+}
+
+svint16_t test_svrsubhnb_s32(svint32_t op1, svint32_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rsubhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_s32'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_s32,,)(op1, op2);
+}
+
+svint32_t test_svrsubhnb_s64(svint64_t op1, svint64_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rsubhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_s64'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_s64,,)(op1, op2);
+}
+
+svuint8_t test_svrsubhnb_u16(svuint16_t op1, svuint16_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rsubhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_u16'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_u16,,)(op1, op2);
+}
+
+svuint16_t test_svrsubhnb_u32(svuint32_t op1, svuint32_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rsubhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_u32'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_u32,,)(op1, op2);
+}
+
+svuint32_t test_svrsubhnb_u64(svuint64_t op1, svuint64_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rsubhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_u64'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_u64,,)(op1, op2);
+}
+
+svint8_t test_svrsubhnb_n_s16(svint16_t op1, int16_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_n_s16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rsubhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_n_s16'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_n_s16,,)(op1, op2);
+}
+
+svint16_t test_svrsubhnb_n_s32(svint32_t op1, int32_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_n_s32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rsubhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_n_s32'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_n_s32,,)(op1, op2);
+}
+
+svint32_t test_svrsubhnb_n_s64(svint64_t op1, int64_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_n_s64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rsubhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_n_s64'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_n_s64,,)(op1, op2);
+}
+
+svuint8_t test_svrsubhnb_n_u16(svuint16_t op1, uint16_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_n_u16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rsubhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_n_u16'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_n_u16,,)(op1, op2);
+}
+
+svuint16_t test_svrsubhnb_n_u32(svuint32_t op1, uint32_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_n_u32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rsubhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_n_u32'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_n_u32,,)(op1, op2);
+}
+
+svuint32_t test_svrsubhnb_n_u64(svuint64_t op1, uint64_t op2)
+{
+ // CHECK-LABEL: test_svrsubhnb_n_u64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rsubhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnb_n_u64'}}
+ return SVE_ACLE_FUNC(svrsubhnb,_n_u64,,)(op1, op2);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rsubhnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rsubhnt.c
new file mode 100644
index 000000000000..8a3fc54a4a9b
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_rsubhnt.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svrsubhnt_s16(svint8_t op1, svint16_t op2, svint16_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rsubhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_s16'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_s16,,)(op1, op2, op3);
+}
+
+svint16_t test_svrsubhnt_s32(svint16_t op1, svint32_t op2, svint32_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rsubhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_s32'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_s32,,)(op1, op2, op3);
+}
+
+svint32_t test_svrsubhnt_s64(svint32_t op1, svint64_t op2, svint64_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rsubhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_s64'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_s64,,)(op1, op2, op3);
+}
+
+svuint8_t test_svrsubhnt_u16(svuint8_t op1, svuint16_t op2, svuint16_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rsubhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_u16'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_u16,,)(op1, op2, op3);
+}
+
+svuint16_t test_svrsubhnt_u32(svuint16_t op1, svuint32_t op2, svuint32_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rsubhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_u32'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_u32,,)(op1, op2, op3);
+}
+
+svuint32_t test_svrsubhnt_u64(svuint32_t op1, svuint64_t op2, svuint64_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rsubhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_u64'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_u64,,)(op1, op2, op3);
+}
+
+svint8_t test_svrsubhnt_n_s16(svint8_t op1, svint16_t op2, int16_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_n_s16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rsubhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_n_s16'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_n_s16,,)(op1, op2, op3);
+}
+
+svint16_t test_svrsubhnt_n_s32(svint16_t op1, svint32_t op2, int32_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_n_s32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rsubhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_n_s32'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_n_s32,,)(op1, op2, op3);
+}
+
+svint32_t test_svrsubhnt_n_s64(svint32_t op1, svint64_t op2, int64_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_n_s64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rsubhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_n_s64'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_n_s64,,)(op1, op2, op3);
+}
+
+svuint8_t test_svrsubhnt_n_u16(svuint8_t op1, svuint16_t op2, uint16_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_n_u16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.rsubhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_n_u16'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_n_u16,,)(op1, op2, op3);
+}
+
+svuint16_t test_svrsubhnt_n_u32(svuint16_t op1, svuint32_t op2, uint32_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_n_u32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.rsubhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_n_u32'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_n_u32,,)(op1, op2, op3);
+}
+
+svuint32_t test_svrsubhnt_n_u64(svuint32_t op1, svuint64_t op2, uint64_t op3)
+{
+ // CHECK-LABEL: test_svrsubhnt_n_u64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.rsubhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svrsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svrsubhnt_n_u64'}}
+ return SVE_ACLE_FUNC(svrsubhnt,_n_u64,,)(op1, op2, op3);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_shrnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_shrnt.c
new file mode 100644
index 000000000000..35b0c23d26c8
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_shrnt.c
@@ -0,0 +1,133 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svshrnt_n_s16(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_s16'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s16,,)(op, op1, 1);
+}
+
+svint8_t test_svshrnt_n_s16_1(svint8_t op, svint16_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_s16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_s16'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s16,,)(op, op1, 8);
+}
+
+svint16_t test_svshrnt_n_s32(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_s32'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s32,,)(op, op1, 1);
+}
+
+svint16_t test_svshrnt_n_s32_1(svint16_t op, svint32_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_s32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_s32'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s32,,)(op, op1, 16);
+}
+
+svint32_t test_svshrnt_n_s64(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_s64'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s64,,)(op, op1, 1);
+}
+
+svint32_t test_svshrnt_n_s64_1(svint32_t op, svint64_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_s64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_s64'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s64,,)(op, op1, 32);
+}
+
+svuint8_t test_svshrnt_n_u16(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 1)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_u16'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u16,,)(op, op1, 1);
+}
+
+svuint8_t test_svshrnt_n_u16_1(svuint8_t op, svuint16_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_u16_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.shrnt.nxv8i16(<vscale x 16 x i8> %op, <vscale x 8 x i16> %op1, i32 8)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_u16'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u16,,)(op, op1, 8);
+}
+
+svuint16_t test_svshrnt_n_u32(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 1)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_u32'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u32,,)(op, op1, 1);
+}
+
+svuint16_t test_svshrnt_n_u32_1(svuint16_t op, svuint32_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_u32_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.shrnt.nxv4i32(<vscale x 8 x i16> %op, <vscale x 4 x i32> %op1, i32 16)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_u32'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u32,,)(op, op1, 16);
+}
+
+svuint32_t test_svshrnt_n_u64(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 1)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_u64'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u64,,)(op, op1, 1);
+}
+
+svuint32_t test_svshrnt_n_u64_1(svuint32_t op, svuint64_t op1)
+{
+ // CHECK-LABEL: test_svshrnt_n_u64_1
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.shrnt.nxv2i64(<vscale x 4 x i32> %op, <vscale x 2 x i64> %op1, i32 32)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svshrnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svshrnt_n_u64'}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u64,,)(op, op1, 32);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_subhnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_subhnb.c
new file mode 100644
index 000000000000..63bc103ce513
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_subhnb.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svsubhnb_s16(svint16_t op1, svint16_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.subhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_s16'}}
+ return SVE_ACLE_FUNC(svsubhnb,_s16,,)(op1, op2);
+}
+
+svint16_t test_svsubhnb_s32(svint32_t op1, svint32_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.subhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_s32'}}
+ return SVE_ACLE_FUNC(svsubhnb,_s32,,)(op1, op2);
+}
+
+svint32_t test_svsubhnb_s64(svint64_t op1, svint64_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.subhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_s64'}}
+ return SVE_ACLE_FUNC(svsubhnb,_s64,,)(op1, op2);
+}
+
+svuint8_t test_svsubhnb_u16(svuint16_t op1, svuint16_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.subhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %op2)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_u16'}}
+ return SVE_ACLE_FUNC(svsubhnb,_u16,,)(op1, op2);
+}
+
+svuint16_t test_svsubhnb_u32(svuint32_t op1, svuint32_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.subhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %op2)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_u32'}}
+ return SVE_ACLE_FUNC(svsubhnb,_u32,,)(op1, op2);
+}
+
+svuint32_t test_svsubhnb_u64(svuint64_t op1, svuint64_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.subhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %op2)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_u64'}}
+ return SVE_ACLE_FUNC(svsubhnb,_u64,,)(op1, op2);
+}
+
+svint8_t test_svsubhnb_n_s16(svint16_t op1, int16_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_n_s16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.subhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_n_s16'}}
+ return SVE_ACLE_FUNC(svsubhnb,_n_s16,,)(op1, op2);
+}
+
+svint16_t test_svsubhnb_n_s32(svint32_t op1, int32_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_n_s32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.subhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_n_s32'}}
+ return SVE_ACLE_FUNC(svsubhnb,_n_s32,,)(op1, op2);
+}
+
+svint32_t test_svsubhnb_n_s64(svint64_t op1, int64_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_n_s64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.subhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_n_s64'}}
+ return SVE_ACLE_FUNC(svsubhnb,_n_s64,,)(op1, op2);
+}
+
+svuint8_t test_svsubhnb_n_u16(svuint16_t op1, uint16_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_n_u16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.subhnb.nxv8i16(<vscale x 8 x i16> %op1, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_n_u16'}}
+ return SVE_ACLE_FUNC(svsubhnb,_n_u16,,)(op1, op2);
+}
+
+svuint16_t test_svsubhnb_n_u32(svuint32_t op1, uint32_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_n_u32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.subhnb.nxv4i32(<vscale x 4 x i32> %op1, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_n_u32'}}
+ return SVE_ACLE_FUNC(svsubhnb,_n_u32,,)(op1, op2);
+}
+
+svuint32_t test_svsubhnb_n_u64(svuint64_t op1, uint64_t op2)
+{
+ // CHECK-LABEL: test_svsubhnb_n_u64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op2)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.subhnb.nxv2i64(<vscale x 2 x i64> %op1, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnb'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnb_n_u64'}}
+ return SVE_ACLE_FUNC(svsubhnb,_n_u64,,)(op1, op2);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_subhnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_subhnt.c
new file mode 100644
index 000000000000..a2c8d1cd36a9
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_subhnt.c
@@ -0,0 +1,139 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify -verify-ignore-unexpected=error %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify=overload -verify-ignore-unexpected=error %s
+
+#include <arm_sve.h>
+
+#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
+
+svint8_t test_svsubhnt_s16(svint8_t op1, svint16_t op2, svint16_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_s16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.subhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_s16'}}
+ return SVE_ACLE_FUNC(svsubhnt,_s16,,)(op1, op2, op3);
+}
+
+svint16_t test_svsubhnt_s32(svint16_t op1, svint32_t op2, svint32_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_s32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.subhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_s32'}}
+ return SVE_ACLE_FUNC(svsubhnt,_s32,,)(op1, op2, op3);
+}
+
+svint32_t test_svsubhnt_s64(svint32_t op1, svint64_t op2, svint64_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_s64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.subhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_s64'}}
+ return SVE_ACLE_FUNC(svsubhnt,_s64,,)(op1, op2, op3);
+}
+
+svuint8_t test_svsubhnt_u16(svuint8_t op1, svuint16_t op2, svuint16_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_u16
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.subhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %op3)
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_u16'}}
+ return SVE_ACLE_FUNC(svsubhnt,_u16,,)(op1, op2, op3);
+}
+
+svuint16_t test_svsubhnt_u32(svuint16_t op1, svuint32_t op2, svuint32_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_u32
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.subhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %op3)
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_u32'}}
+ return SVE_ACLE_FUNC(svsubhnt,_u32,,)(op1, op2, op3);
+}
+
+svuint32_t test_svsubhnt_u64(svuint32_t op1, svuint64_t op2, svuint64_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_u64
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.subhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %op3)
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_u64'}}
+ return SVE_ACLE_FUNC(svsubhnt,_u64,,)(op1, op2, op3);
+}
+
+svint8_t test_svsubhnt_n_s16(svint8_t op1, svint16_t op2, int16_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_n_s16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.subhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_n_s16'}}
+ return SVE_ACLE_FUNC(svsubhnt,_n_s16,,)(op1, op2, op3);
+}
+
+svint16_t test_svsubhnt_n_s32(svint16_t op1, svint32_t op2, int32_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_n_s32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.subhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_n_s32'}}
+ return SVE_ACLE_FUNC(svsubhnt,_n_s32,,)(op1, op2, op3);
+}
+
+svint32_t test_svsubhnt_n_s64(svint32_t op1, svint64_t op2, int64_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_n_s64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.subhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_n_s64'}}
+ return SVE_ACLE_FUNC(svsubhnt,_n_s64,,)(op1, op2, op3);
+}
+
+svuint8_t test_svsubhnt_n_u16(svuint8_t op1, svuint16_t op2, uint16_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_n_u16
+ // CHECK: %[[DUP:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.subhnt.nxv8i16(<vscale x 16 x i8> %op1, <vscale x 8 x i16> %op2, <vscale x 8 x i16> %[[DUP]])
+ // CHECK: ret <vscale x 16 x i8> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_n_u16'}}
+ return SVE_ACLE_FUNC(svsubhnt,_n_u16,,)(op1, op2, op3);
+}
+
+svuint16_t test_svsubhnt_n_u32(svuint16_t op1, svuint32_t op2, uint32_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_n_u32
+ // CHECK: %[[DUP:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.dup.x.nxv4i32(i32 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 8 x i16> @llvm.aarch64.sve.subhnt.nxv4i32(<vscale x 8 x i16> %op1, <vscale x 4 x i32> %op2, <vscale x 4 x i32> %[[DUP]])
+ // CHECK: ret <vscale x 8 x i16> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_n_u32'}}
+ return SVE_ACLE_FUNC(svsubhnt,_n_u32,,)(op1, op2, op3);
+}
+
+svuint32_t test_svsubhnt_n_u64(svuint32_t op1, svuint64_t op2, uint64_t op3)
+{
+ // CHECK-LABEL: test_svsubhnt_n_u64
+ // CHECK: %[[DUP:.*]] = call <vscale x 2 x i64> @llvm.aarch64.sve.dup.x.nxv2i64(i64 %op3)
+ // CHECK: %[[INTRINSIC:.*]] = call <vscale x 4 x i32> @llvm.aarch64.sve.subhnt.nxv2i64(<vscale x 4 x i32> %op1, <vscale x 2 x i64> %op2, <vscale x 2 x i64> %[[DUP]])
+ // CHECK: ret <vscale x 4 x i32> %[[INTRINSIC]]
+ // overload-warning at +2 {{implicit declaration of function 'svsubhnt'}}
+ // expected-warning at +1 {{implicit declaration of function 'svsubhnt_n_u64'}}
+ return SVE_ACLE_FUNC(svsubhnt,_n_u64,,)(op1, op2, op3);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrnb.c
new file mode 100644
index 000000000000..bbbbfc418cc9
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrnb.c
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svint8_t test_svqrshrnb_n_s16(svint16_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s16,,)(op1, 0);
+}
+
+svint16_t test_svqrshrnb_n_s32(svint32_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s32,,)(op1, 0);
+}
+
+svint32_t test_svqrshrnb_n_s64(svint64_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_s64,,)(op1, 0);
+}
+
+svuint8_t test_svqrshrnb_n_u16(svuint16_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u16,,)(op1, 0);
+}
+
+svuint16_t test_svqrshrnb_n_u32(svuint32_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u32,,)(op1, 0);
+}
+
+svuint32_t test_svqrshrnb_n_u64(svuint64_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqrshrnb,_n_u64,,)(op1, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrnt.c
new file mode 100644
index 000000000000..4a323b56c1b3
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrnt.c
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svint8_t test_svqrshrnt_n_s16(svint8_t op1, svint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s16,,)(op1, op2, 0);
+}
+
+svint16_t test_svqrshrnt_n_s32(svint16_t op1, svint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s32,,)(op1, op2, 0);
+}
+
+svint32_t test_svqrshrnt_n_s64(svint32_t op1, svint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_s64,,)(op1, op2, 0);
+}
+
+svuint8_t test_svqrshrnt_n_u16(svuint8_t op1, svuint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u16,,)(op1, op2, 0);
+}
+
+svuint16_t test_svqrshrnt_n_u32(svuint16_t op1, svuint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u32,,)(op1, op2, 0);
+}
+
+svuint32_t test_svqrshrnt_n_u64(svuint32_t op1, svuint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqrshrnt,_n_u64,,)(op1, op2, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrunb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrunb.c
new file mode 100644
index 000000000000..ff45e95c5d52
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrunb.c
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svuint8_t test_svqrshrunb_n_s16(svint16_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s16,,)(op1, 0);
+}
+
+svuint16_t test_svqrshrunb_n_s32(svint32_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s32,,)(op1, 0);
+}
+
+svuint32_t test_svqrshrunb_n_s64(svint64_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqrshrunb,_n_s64,,)(op1, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrunt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrunt.c
new file mode 100644
index 000000000000..849500d3a4cb
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qrshrunt.c
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svuint8_t test_svqrshrunt_n_s16(svuint8_t op1, svint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s16,,)(op1, op2, 0);
+}
+
+svuint16_t test_svqrshrunt_n_s32(svuint16_t op1, svint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s32,,)(op1, op2, 0);
+}
+
+svuint32_t test_svqrshrunt_n_s64(svuint32_t op1, svint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqrshrunt,_n_s64,,)(op1, op2, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrnb.c
new file mode 100644
index 000000000000..dc7189583b8c
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrnb.c
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svint8_t test_svqshrnb_n_s16(svint16_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s16,,)(op1, 0);
+}
+
+svint16_t test_svqshrnb_n_s32(svint32_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s32,,)(op1, 0);
+}
+
+svint32_t test_svqshrnb_n_s64(svint64_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_s64,,)(op1, 0);
+}
+
+svuint8_t test_svqshrnb_n_u16(svuint16_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u16,,)(op1, 0);
+}
+
+svuint16_t test_svqshrnb_n_u32(svuint32_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u32,,)(op1, 0);
+}
+
+svuint32_t test_svqshrnb_n_u64(svuint64_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqshrnb,_n_u64,,)(op1, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrnt.c
new file mode 100644
index 000000000000..0e05ce509323
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrnt.c
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svint8_t test_svqshrnt_n_s16(svint8_t op1, svint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s16,,)(op1, op2, 0);
+}
+
+svint16_t test_svqshrnt_n_s32(svint16_t op1, svint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s32,,)(op1, op2, 0);
+}
+
+svint32_t test_svqshrnt_n_s64(svint32_t op1, svint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_s64,,)(op1, op2, 0);
+}
+
+svuint8_t test_svqshrnt_n_u16(svuint8_t op1, svuint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u16,,)(op1, op2, 0);
+}
+
+svuint16_t test_svqshrnt_n_u32(svuint16_t op1, svuint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u32,,)(op1, op2, 0);
+}
+
+svuint32_t test_svqshrnt_n_u64(svuint32_t op1, svuint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqshrnt,_n_u64,,)(op1, op2, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrunb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrunb.c
new file mode 100644
index 000000000000..e4da43cb607b
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrunb.c
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svuint8_t test_svqshrunb_n_s16(svint16_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s16,,)(op1, 0);
+}
+
+svuint16_t test_svqshrunb_n_s32(svint32_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s32,,)(op1, 0);
+}
+
+svuint32_t test_svqshrunb_n_s64(svint64_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqshrunb,_n_s64,,)(op1, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrunt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrunt.c
new file mode 100644
index 000000000000..4caf7bc3c6d2
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_qshrunt.c
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svuint8_t test_svqshrunt_n_s16(svuint8_t op1, svint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s16,,)(op1, op2, 0);
+}
+
+svuint16_t test_svqshrunt_n_s32(svuint16_t op1, svint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s32,,)(op1, op2, 0);
+}
+
+svuint32_t test_svqshrunt_n_s64(svuint32_t op1, svint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svqshrunt,_n_s64,,)(op1, op2, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_rshrnb.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_rshrnb.c
new file mode 100644
index 000000000000..4c9fd97eca03
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_rshrnb.c
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svint8_t test_svrshrnb_n_s16(svint16_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s16,,)(op1, 0);
+}
+
+svint16_t test_svrshrnb_n_s32(svint32_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s32,,)(op1, 0);
+}
+
+svint32_t test_svrshrnb_n_s64(svint64_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_s64,,)(op1, 0);
+}
+
+svuint8_t test_svrshrnb_n_u16(svuint16_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u16,,)(op1, 0);
+}
+
+svuint16_t test_svrshrnb_n_u32(svuint32_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u32,,)(op1, 0);
+}
+
+svuint32_t test_svrshrnb_n_u64(svuint64_t op1)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svrshrnb,_n_u64,,)(op1, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_rshrnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_rshrnt.c
new file mode 100644
index 000000000000..99c751fafbe6
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_rshrnt.c
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svint8_t test_svrshrnt_n_s16(svint8_t op1, svint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s16,,)(op1, op2, 0);
+}
+
+svint16_t test_svrshrnt_n_s32(svint16_t op1, svint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s32,,)(op1, op2, 0);
+}
+
+svint32_t test_svrshrnt_n_s64(svint32_t op1, svint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_s64,,)(op1, op2, 0);
+}
+
+svuint8_t test_svrshrnt_n_u16(svuint8_t op1, svuint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u16,,)(op1, op2, 0);
+}
+
+svuint16_t test_svrshrnt_n_u32(svuint16_t op1, svuint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u32,,)(op1, op2, 0);
+}
+
+svuint32_t test_svrshrnt_n_u64(svuint32_t op1, svuint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svrshrnt,_n_u64,,)(op1, op2, 0);
+}
diff --git a/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_shrnt.c b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_shrnt.c
new file mode 100644
index 000000000000..d6d0a23ae504
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-sve2-intrinsics/negative/acle_sve2_shrnt.c
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -D__ARM_FEATURE_SVE2 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -fallow-half-arguments-and-returns -fsyntax-only -verify %s
+
+#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
+
+#include <arm_sve.h>
+
+svint8_t test_svshrnt_n_s16(svint8_t op1, svint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s16,,)(op1, op2, 0);
+}
+
+svint16_t test_svshrnt_n_s32(svint16_t op1, svint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s32,,)(op1, op2, 0);
+}
+
+svint32_t test_svshrnt_n_s64(svint32_t op1, svint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svshrnt,_n_s64,,)(op1, op2, 0);
+}
+
+svuint8_t test_svshrnt_n_u16(svuint8_t op1, svuint16_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 8]}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u16,,)(op1, op2, 0);
+}
+
+svuint16_t test_svshrnt_n_u32(svuint16_t op1, svuint32_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u32,,)(op1, op2, 0);
+}
+
+svuint32_t test_svshrnt_n_u64(svuint32_t op1, svuint64_t op2)
+{
+ // expected-error-re at +1 {{argument value {{[0-9]+}} is outside the valid range [1, 32]}}
+ return SVE_ACLE_FUNC(svshrnt,_n_u64,,)(op1, op2, 0);
+}
More information about the cfe-commits
mailing list