1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
5 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2 -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
6 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
7 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2 -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
11 #ifdef SVE_OVERLOADED_FORMS
12 // A simple used,unused... macro, long enough to represent any SVE builtin.
13 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
15 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
18 // CHECK-LABEL: @test_svsubltb_s16(
20 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.ssubltb.nxv8i16(<vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]])
21 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
23 // CPP-CHECK-LABEL: @_Z17test_svsubltb_s16u10__SVInt8_tS_(
24 // CPP-CHECK-NEXT: entry:
25 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.ssubltb.nxv8i16(<vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]])
26 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
28 svint16_t
test_svsubltb_s16(svint8_t op1
, svint8_t op2
)
30 return SVE_ACLE_FUNC(svsubltb
,_s16
,,)(op1
, op2
);
33 // CHECK-LABEL: @test_svsubltb_s32(
35 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.ssubltb.nxv4i32(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]])
36 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
38 // CPP-CHECK-LABEL: @_Z17test_svsubltb_s32u11__SVInt16_tS_(
39 // CPP-CHECK-NEXT: entry:
40 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.ssubltb.nxv4i32(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[OP2:%.*]])
41 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
43 svint32_t
test_svsubltb_s32(svint16_t op1
, svint16_t op2
)
45 return SVE_ACLE_FUNC(svsubltb
,_s32
,,)(op1
, op2
);
48 // CHECK-LABEL: @test_svsubltb_s64(
50 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.ssubltb.nxv2i64(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 4 x i32> [[OP2:%.*]])
51 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
53 // CPP-CHECK-LABEL: @_Z17test_svsubltb_s64u11__SVInt32_tS_(
54 // CPP-CHECK-NEXT: entry:
55 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.ssubltb.nxv2i64(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 4 x i32> [[OP2:%.*]])
56 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
58 svint64_t
test_svsubltb_s64(svint32_t op1
, svint32_t op2
)
60 return SVE_ACLE_FUNC(svsubltb
,_s64
,,)(op1
, op2
);
63 // CHECK-LABEL: @test_svsubltb_n_s16(
65 // CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP2:%.*]], i64 0
66 // CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
67 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.ssubltb.nxv8i16(<vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[DOTSPLAT]])
68 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
70 // CPP-CHECK-LABEL: @_Z19test_svsubltb_n_s16u10__SVInt8_ta(
71 // CPP-CHECK-NEXT: entry:
72 // CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP2:%.*]], i64 0
73 // CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
74 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.ssubltb.nxv8i16(<vscale x 16 x i8> [[OP1:%.*]], <vscale x 16 x i8> [[DOTSPLAT]])
75 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
77 svint16_t
test_svsubltb_n_s16(svint8_t op1
, int8_t op2
)
79 return SVE_ACLE_FUNC(svsubltb
,_n_s16
,,)(op1
, op2
);
82 // CHECK-LABEL: @test_svsubltb_n_s32(
84 // CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[OP2:%.*]], i64 0
85 // CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[DOTSPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
86 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.ssubltb.nxv4i32(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[DOTSPLAT]])
87 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
89 // CPP-CHECK-LABEL: @_Z19test_svsubltb_n_s32u11__SVInt16_ts(
90 // CPP-CHECK-NEXT: entry:
91 // CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 8 x i16> poison, i16 [[OP2:%.*]], i64 0
92 // CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 8 x i16> [[DOTSPLATINSERT]], <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
93 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.ssubltb.nxv4i32(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 8 x i16> [[DOTSPLAT]])
94 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
96 svint32_t
test_svsubltb_n_s32(svint16_t op1
, int16_t op2
)
98 return SVE_ACLE_FUNC(svsubltb
,_n_s32
,,)(op1
, op2
);
101 // CHECK-LABEL: @test_svsubltb_n_s64(
102 // CHECK-NEXT: entry:
103 // CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[OP2:%.*]], i64 0
104 // CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
105 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.ssubltb.nxv2i64(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 4 x i32> [[DOTSPLAT]])
106 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
108 // CPP-CHECK-LABEL: @_Z19test_svsubltb_n_s64u11__SVInt32_ti(
109 // CPP-CHECK-NEXT: entry:
110 // CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[OP2:%.*]], i64 0
111 // CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
112 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.ssubltb.nxv2i64(<vscale x 4 x i32> [[OP1:%.*]], <vscale x 4 x i32> [[DOTSPLAT]])
113 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
115 svint64_t
test_svsubltb_n_s64(svint32_t op1
, int32_t op2
)
117 return SVE_ACLE_FUNC(svsubltb
,_n_s64
,,)(op1
, op2
);