// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 // REQUIRES: aarch64-registered-target // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 \ // RUN: -Werror -emit-llvm -disable-O0-optnone -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -target-feature +sme2p1 \ // RUN: -Werror -emit-llvm -disable-O0-optnone -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme -target-feature +sve2p1 \ // RUN: -Werror -emit-llvm -disable-O0-optnone -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme -target-feature +sme2p1 \ // RUN: -Werror -emit-llvm -disable-O0-optnone -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 \ // RUN: -Werror -emit-llvm -disable-O0-optnone -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 \ // RUN: -Werror -emit-llvm -disable-O0-optnone -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 \ // RUN: -Werror -emit-llvm -disable-O0-optnone -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sve2 -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s #include #ifdef SVE_OVERLOADED_FORMS // A simple used,unused... macro, long enough to represent any SVE builtin. #define SVE_ACLE_FUNC(A1, A2_UNUSED) A1 #else #define SVE_ACLE_FUNC(A1, A2) A1##A2 #endif #if defined(__ARM_FEATURE_SME) && defined(__ARM_FEATURE_SVE) #define ATTR __arm_streaming_compatible #elif defined(__ARM_FEATURE_SME) #define ATTR __arm_streaming #else #define ATTR #endif // CHECK-LABEL: define dso_local @test_svdup_laneq_s8 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0:[0-9]+]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv16i8( [[ZN]], i32 0) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z19test_svdup_laneq_s8u10__SVInt8_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0:[0-9]+]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv16i8( [[ZN]], i32 0) // CPP-CHECK-NEXT: ret [[TMP0]] // svint8_t test_svdup_laneq_s8(svint8_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _s8)(zn, 0); } // CHECK-LABEL: define dso_local @test_svdup_laneq_u8 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv16i8( [[ZN]], i32 15) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z19test_svdup_laneq_u8u11__SVUint8_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv16i8( [[ZN]], i32 15) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint8_t test_svdup_laneq_u8(svuint8_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _u8)(zn, 15); } // CHECK-LABEL: define dso_local @test_svdup_laneq_s16 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv8i16( [[ZN]], i32 1) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_s16u11__SVInt16_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv8i16( [[ZN]], i32 1) // CPP-CHECK-NEXT: ret [[TMP0]] // svint16_t test_svdup_laneq_s16(svint16_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _s16)(zn, 1); } // CHECK-LABEL: define dso_local @test_svdup_laneq_u16 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv8i16( [[ZN]], i32 7) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_u16u12__SVUint16_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv8i16( [[ZN]], i32 7) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint16_t test_svdup_laneq_u16(svuint16_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _u16)(zn, 7); } // CHECK-LABEL: define dso_local @test_svdup_laneq_s32 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv4i32( [[ZN]], i32 2) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_s32u11__SVInt32_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv4i32( [[ZN]], i32 2) // CPP-CHECK-NEXT: ret [[TMP0]] // svint32_t test_svdup_laneq_s32(svint32_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _s32)(zn, 2); } // CHECK-LABEL: define dso_local @test_svdup_laneq_u32 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv4i32( [[ZN]], i32 3) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_u32u12__SVUint32_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv4i32( [[ZN]], i32 3) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint32_t test_svdup_laneq_u32(svuint32_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _u32)(zn, 3); } // CHECK-LABEL: define dso_local @test_svdup_laneq_s64 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv2i64( [[ZN]], i32 0) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_s64u11__SVInt64_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv2i64( [[ZN]], i32 0) // CPP-CHECK-NEXT: ret [[TMP0]] // svint64_t test_svdup_laneq_s64(svint64_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _s64)(zn, 0); } // CHECK-LABEL: define dso_local @test_svdup_laneq_u64 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv2i64( [[ZN]], i32 1) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_u64u12__SVUint64_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv2i64( [[ZN]], i32 1) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint64_t test_svdup_laneq_u64(svuint64_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _u64)(zn, 1); } // CHECK-LABEL: define dso_local @test_svdup_laneq_f16 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv8f16( [[ZN]], i32 4) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_f16u13__SVFloat16_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv8f16( [[ZN]], i32 4) // CPP-CHECK-NEXT: ret [[TMP0]] // svfloat16_t test_svdup_laneq_f16(svfloat16_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _f16)(zn, 4); } // CHECK-LABEL: define dso_local @test_svdup_laneq_f32 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv4f32( [[ZN]], i32 1) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_f32u13__SVFloat32_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv4f32( [[ZN]], i32 1) // CPP-CHECK-NEXT: ret [[TMP0]] // svfloat32_t test_svdup_laneq_f32(svfloat32_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _f32)(zn, 1); } // CHECK-LABEL: define dso_local @test_svdup_laneq_f64 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv2f64( [[ZN]], i32 1) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_f64u13__SVFloat64_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv2f64( [[ZN]], i32 1) // CPP-CHECK-NEXT: ret [[TMP0]] // svfloat64_t test_svdup_laneq_f64(svfloat64_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _f64)(zn, 1); } // CHECK-LABEL: define dso_local @test_svdup_laneq_bf16 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv8bf16( [[ZN]], i32 3) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z21test_svdup_laneq_bf16u14__SVBfloat16_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv8bf16( [[ZN]], i32 3) // CPP-CHECK-NEXT: ret [[TMP0]] // svbfloat16_t test_svdup_laneq_bf16(svbfloat16_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _bf16)(zn, 3); } // CHECK-LABEL: define dso_local @test_svdup_laneq_mf8 // CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv16i8( [[ZN]], i32 1) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: define dso_local @_Z20test_svdup_laneq_mf8u13__SVMfloat8_t // CPP-CHECK-SAME: ( [[ZN:%.*]]) #[[ATTR0]] { // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.dup.laneq.nxv16i8( [[ZN]], i32 1) // CPP-CHECK-NEXT: ret [[TMP0]] // svmfloat8_t test_svdup_laneq_mf8(svmfloat8_t zn) ATTR { return SVE_ACLE_FUNC(svdup_laneq, _mf8)(zn, 1); }