123 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// REQUIRES: aarch64-registered-target3// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s4// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK5// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s6// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK7// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -o /dev/null %s8#include <arm_sve.h>9 10#ifdef SVE_OVERLOADED_FORMS11// A simple used,unused... macro, long enough to represent any SVE builtin.12#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A313#else14#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A415#endif16 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]]21//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]]26//27svint16_t test_svunpkhi_s16(svint8_t op)28{29 return SVE_ACLE_FUNC(svunpkhi,_s16,,)(op);30}31 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]]36//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]]41//42svint32_t test_svunpkhi_s32(svint16_t op)43{44 return SVE_ACLE_FUNC(svunpkhi,_s32,,)(op);45}46 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]]51//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]]56//57svint64_t test_svunpkhi_s64(svint32_t op)58{59 return SVE_ACLE_FUNC(svunpkhi,_s64,,)(op);60}61 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]]66//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]]71//72svuint16_t test_svunpkhi_u16(svuint8_t op)73{74 return SVE_ACLE_FUNC(svunpkhi,_u16,,)(op);75}76 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]]81//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]]86//87svuint32_t test_svunpkhi_u32(svuint16_t op)88{89 return SVE_ACLE_FUNC(svunpkhi,_u32,,)(op);90}91 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]]96//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]]101//102svuint64_t test_svunpkhi_u64(svuint32_t op)103{104 return SVE_ACLE_FUNC(svunpkhi,_u64,,)(op);105}106 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]]112//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]]118//119svbool_t test_svunpkhi_b(svbool_t op)120{121 return SVE_ACLE_FUNC(svunpkhi,_b,,)(op);122}123