Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / aarch64-sve-intrinsics / acle_sve_unpkhi.c
blob6d4e1adcf9ae5c371d2e96cdcfa6d61cdea09874
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 +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
6 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
7 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -o /dev/null %s
8 #include <arm_sve.h>
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,A4_UNUSED) A1##A3
13 #else
14 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
15 #endif
17 // CHECK-LABEL: @test_svunpkhi_s16(
18 // CHECK-NEXT: entry:
19 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sunpkhi.nxv8i16(<vscale x 16 x i8> [[OP:%.*]])
20 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
22 // CPP-CHECK-LABEL: @_Z17test_svunpkhi_s16u10__SVInt8_t(
23 // CPP-CHECK-NEXT: entry:
24 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sunpkhi.nxv8i16(<vscale x 16 x i8> [[OP:%.*]])
25 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
27 svint16_t test_svunpkhi_s16(svint8_t op)
29 return SVE_ACLE_FUNC(svunpkhi,_s16,,)(op);
32 // CHECK-LABEL: @test_svunpkhi_s32(
33 // CHECK-NEXT: entry:
34 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sunpkhi.nxv4i32(<vscale x 8 x i16> [[OP:%.*]])
35 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
37 // CPP-CHECK-LABEL: @_Z17test_svunpkhi_s32u11__SVInt16_t(
38 // CPP-CHECK-NEXT: entry:
39 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.sunpkhi.nxv4i32(<vscale x 8 x i16> [[OP:%.*]])
40 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
42 svint32_t test_svunpkhi_s32(svint16_t op)
44 return SVE_ACLE_FUNC(svunpkhi,_s32,,)(op);
47 // CHECK-LABEL: @test_svunpkhi_s64(
48 // CHECK-NEXT: entry:
49 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.sunpkhi.nxv2i64(<vscale x 4 x i32> [[OP:%.*]])
50 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
52 // CPP-CHECK-LABEL: @_Z17test_svunpkhi_s64u11__SVInt32_t(
53 // CPP-CHECK-NEXT: entry:
54 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.sunpkhi.nxv2i64(<vscale x 4 x i32> [[OP:%.*]])
55 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
57 svint64_t test_svunpkhi_s64(svint32_t op)
59 return SVE_ACLE_FUNC(svunpkhi,_s64,,)(op);
62 // CHECK-LABEL: @test_svunpkhi_u16(
63 // CHECK-NEXT: entry:
64 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uunpkhi.nxv8i16(<vscale x 16 x i8> [[OP:%.*]])
65 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
67 // CPP-CHECK-LABEL: @_Z17test_svunpkhi_u16u11__SVUint8_t(
68 // CPP-CHECK-NEXT: entry:
69 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.uunpkhi.nxv8i16(<vscale x 16 x i8> [[OP:%.*]])
70 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]]
72 svuint16_t test_svunpkhi_u16(svuint8_t op)
74 return SVE_ACLE_FUNC(svunpkhi,_u16,,)(op);
77 // CHECK-LABEL: @test_svunpkhi_u32(
78 // CHECK-NEXT: entry:
79 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uunpkhi.nxv4i32(<vscale x 8 x i16> [[OP:%.*]])
80 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
82 // CPP-CHECK-LABEL: @_Z17test_svunpkhi_u32u12__SVUint16_t(
83 // CPP-CHECK-NEXT: entry:
84 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.uunpkhi.nxv4i32(<vscale x 8 x i16> [[OP:%.*]])
85 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP0]]
87 svuint32_t test_svunpkhi_u32(svuint16_t op)
89 return SVE_ACLE_FUNC(svunpkhi,_u32,,)(op);
92 // CHECK-LABEL: @test_svunpkhi_u64(
93 // CHECK-NEXT: entry:
94 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.uunpkhi.nxv2i64(<vscale x 4 x i32> [[OP:%.*]])
95 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
97 // CPP-CHECK-LABEL: @_Z17test_svunpkhi_u64u12__SVUint32_t(
98 // CPP-CHECK-NEXT: entry:
99 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.uunpkhi.nxv2i64(<vscale x 4 x i32> [[OP:%.*]])
100 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP0]]
102 svuint64_t test_svunpkhi_u64(svuint32_t op)
104 return SVE_ACLE_FUNC(svunpkhi,_u64,,)(op);
107 // CHECK-LABEL: @test_svunpkhi_b(
108 // CHECK-NEXT: entry:
109 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.punpkhi.nxv16i1(<vscale x 16 x i1> [[OP:%.*]])
110 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
111 // CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
113 // CPP-CHECK-LABEL: @_Z15test_svunpkhi_bu10__SVBool_t(
114 // CPP-CHECK-NEXT: entry:
115 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.punpkhi.nxv16i1(<vscale x 16 x i1> [[OP:%.*]])
116 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> [[TMP0]])
117 // CPP-CHECK-NEXT: ret <vscale x 16 x i1> [[TMP1]]
119 svbool_t test_svunpkhi_b(svbool_t op)
121 return SVE_ACLE_FUNC(svunpkhi,_b,,)(op);