1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
6 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
7 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
10 #ifdef SVE_OVERLOADED_FORMS
11 // A simple used,unused... macro, long enough to represent any SVE builtin.
12 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3) A1##A3
14 #define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3
17 // CHECK-LABEL: @test_svdot_s32_x2(
19 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sdot.x2.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]], <vscale x 8 x i16> [[OP3:%.*]])
20 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
22 // CPP-CHECK-LABEL: @_Z17test_svdot_s32_x2u11__SVInt32_tu11__SVInt16_tS0_(
23 // CPP-CHECK-NEXT: entry:
24 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sdot.x2.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]], <vscale x 8 x i16> [[OP3:%.*]])
25 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
27 svint32_t
test_svdot_s32_x2(svint32_t op1
, svint16_t op2
, svint16_t op3
)
29 return SVE_ACLE_FUNC(svdot
,_s32_s16_s16
,)(op1
, op2
, op3
);
32 // CHECK-LABEL: @test_svdot_u32_x2(
34 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.udot.x2.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]], <vscale x 8 x i16> [[OP3:%.*]])
35 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
37 // CPP-CHECK-LABEL: @_Z17test_svdot_u32_x2u12__SVUint32_tu12__SVUint16_tS0_(
38 // CPP-CHECK-NEXT: entry:
39 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.udot.x2.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]], <vscale x 8 x i16> [[OP3:%.*]])
40 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
42 svuint32_t
test_svdot_u32_x2(svuint32_t op1
, svuint16_t op2
, svuint16_t op3
)
44 return SVE_ACLE_FUNC(svdot
,_u32_u16_u16
,)(op1
, op2
, op3
);
47 // CHECK-LABEL: @test_svdot_f32_x2(
49 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.fdot.x2.nxv4f32(<vscale x 4 x float> [[OP1:%.*]], <vscale x 8 x half> [[OP2:%.*]], <vscale x 8 x half> [[OP3:%.*]])
50 // CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
52 // CPP-CHECK-LABEL: @_Z17test_svdot_f32_x2u13__SVFloat32_tu13__SVFloat16_tS0_(
53 // CPP-CHECK-NEXT: entry:
54 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.fdot.x2.nxv4f32(<vscale x 4 x float> [[OP1:%.*]], <vscale x 8 x half> [[OP2:%.*]], <vscale x 8 x half> [[OP3:%.*]])
55 // CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
57 svfloat32_t
test_svdot_f32_x2(svfloat32_t op1
, svfloat16_t op2
, svfloat16_t op3
)
59 return SVE_ACLE_FUNC(svdot
,_f32_f16_f16
,)(op1
, op2
, op3
);
64 // CHECK-LABEL: @test_svdot_lane_s32_x2(
66 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sdot.lane.x2.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]], <vscale x 8 x i16> [[OP3:%.*]], i32 3)
67 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
69 // CPP-CHECK-LABEL: @_Z22test_svdot_lane_s32_x2u11__SVInt32_tu11__SVInt16_tS0_(
70 // CPP-CHECK-NEXT: entry:
71 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sdot.lane.x2.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]], <vscale x 8 x i16> [[OP3:%.*]], i32 3)
72 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
74 svint32_t
test_svdot_lane_s32_x2(svint32_t op1
, svint16_t op2
, svint16_t op3
)
76 return SVE_ACLE_FUNC(svdot_lane
,_s32_s16_s16
,)(op1
, op2
, op3
, 3);
79 // CHECK-LABEL: @test_svdot_lane_u32_x2(
81 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.udot.lane.x2.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]], <vscale x 8 x i16> [[OP3:%.*]], i32 3)
82 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
84 // CPP-CHECK-LABEL: @_Z22test_svdot_lane_u32_x2u12__SVUint32_tu12__SVUint16_tS0_(
85 // CPP-CHECK-NEXT: entry:
86 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.udot.lane.x2.nxv4i32(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]], <vscale x 8 x i16> [[OP3:%.*]], i32 3)
87 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
89 svuint32_t
test_svdot_lane_u32_x2(svuint32_t op1
, svuint16_t op2
, svuint16_t op3
)
91 return SVE_ACLE_FUNC(svdot_lane
,_u32_u16_u16
,)(op1
, op2
, op3
, 3);
94 // CHECK-LABEL: @test_svdot_lane_f32_x2(
96 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.fdot.lane.x2.nxv4f32(<vscale x 4 x float> [[OP1:%.*]], <vscale x 8 x half> [[OP2:%.*]], <vscale x 8 x half> [[OP3:%.*]], i32 3)
97 // CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
99 // CPP-CHECK-LABEL: @_Z22test_svdot_lane_f32_x2u13__SVFloat32_tu13__SVFloat16_tS0_(
100 // CPP-CHECK-NEXT: entry:
101 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.fdot.lane.x2.nxv4f32(<vscale x 4 x float> [[OP1:%.*]], <vscale x 8 x half> [[OP2:%.*]], <vscale x 8 x half> [[OP3:%.*]], i32 3)
102 // CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
104 svfloat32_t
test_svdot_lane_f32_x2(svfloat32_t op1
, svfloat16_t op2
, svfloat16_t op3
)
106 return SVE_ACLE_FUNC(svdot_lane
,_f32_f16_f16
,)(op1
, op2
, op3
, 3);