// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py // REQUIRES: aarch64-registered-target // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sme -target-feature +sme2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sme -target-feature +sme2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2 -target-feature +sme-f64f64 -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,A3,A4_UNUSED,A5) A1##A3##A5 #else #define SVE_ACLE_FUNC(A1,A2,A3,A4,A5) A1##A2##A3##A4##A5 #endif // SVQRSHR // CHECK-LABEL: @test_svsqrshr_u16_u32_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshr.x2.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], i32 16) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z24test_svsqrshr_u16_u32_x412svuint32x2_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshr.x2.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], i32 16) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint16_t test_svsqrshr_u16_u32_x4(svuint32x2_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshr,_n,_u16,_u32_x2,)(zn, 16); } // CHECK-LABEL: @test_svsqrshr_s16_s32_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshr.x2.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], i32 16) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z24test_svsqrshr_s16_s32_x411svint32x2_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshr.x2.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], i32 16) // CPP-CHECK-NEXT: ret [[TMP0]] // svint16_t test_svsqrshr_s16_s32_x4(svint32x2_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshr,_n,_s16,_s32_x2,)(zn, 16); } // CHECK-LABEL: @test_svsqrshr_u8_u32_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshr.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z23test_svsqrshr_u8_u32_x412svuint32x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshr.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint8_t test_svsqrshr_u8_u32_x4(svuint32x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshr,_n,_u8,_u32_x4,)(zn, 8); } // CHECK-LABEL: @test_svsqrshr_s8_s32_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshr.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z23test_svsqrshr_s8_s32_x411svint32x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshr.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CPP-CHECK-NEXT: ret [[TMP0]] // svint8_t test_svsqrshr_s8_s32_x4(svint32x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshr,_n,_s8,_s32_x4,)(zn, 8); } // CHECK-LABEL: @test_svsqrshr_u16_u64_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshr.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z24test_svsqrshr_u16_u64_x412svuint64x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshr.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint16_t test_svsqrshr_u16_u64_x4(svuint64x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshr,_n,_u16,_u64_x4,)(zn, 16); } // CHECK-LABEL: @test_svsqrshr_s16_s64_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshr.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z24test_svsqrshr_s16_s64_x411svint64x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshr.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CPP-CHECK-NEXT: ret [[TMP0]] // svint16_t test_svsqrshr_s16_s64_x4(svint64x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshr,_n,_s16,_s64_x4,)(zn, 16); } // SVQRSHRN // CHECK-LABEL: @test_svsqrshrn_u8_u32_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshrn.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z24test_svsqrshrn_u8_u32_x412svuint32x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshrn.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint8_t test_svsqrshrn_u8_u32_x4(svuint32x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshrn,_n,_u8,_u32_x4,)(zn, 8); } // CHECK-LABEL: @test_svsqrshrn_s8_s32_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshrn.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z24test_svsqrshrn_s8_s32_x411svint32x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshrn.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CPP-CHECK-NEXT: ret [[TMP0]] // svint8_t test_svsqrshrn_s8_s32_x4(svint32x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshrn,_n,_s8,_s32_x4,)(zn, 8); } // CHECK-LABEL: @test_svsqrshrn_u16_u64_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshrn.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z25test_svsqrshrn_u16_u64_x412svuint64x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.uqrshrn.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint16_t test_svsqrshrn_u16_u64_x4(svuint64x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshrn,_n,_u16,_u64_x4,)(zn, 16); } // CHECK-LABEL: @test_svsqrshrn_s16_s64_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshrn.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z25test_svsqrshrn_s16_s64_x411svint64x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshrn.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CPP-CHECK-NEXT: ret [[TMP0]] // svint16_t test_svsqrshrn_s16_s64_x4(svint64x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshrn,_n,_s16,_s64_x4,)(zn, 16); } // SVSQRSHRU // CHECK-LABEL: @test_svsvqrshru_u16_s32_x2( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshru.x2.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], i32 16) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z26test_svsvqrshru_u16_s32_x211svint32x2_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshru.x2.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], i32 16) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint16_t test_svsvqrshru_u16_s32_x2(svint32x2_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshru,_n,_u16,_s32_x2,)(zn, 16); } // CHECK-LABEL: @test_svsqrshru_u8_s32_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshru.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z24test_svsqrshru_u8_s32_x411svint32x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshru.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 8) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint8_t test_svsqrshru_u8_s32_x4(svint32x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshru,_n,_u8,_s32_x4,)(zn, 8); } // CHECK-LABEL: @test_svsqrshru_u16_s64_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshru.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z25test_svsqrshru_u16_s64_x411svint64x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshru.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 16) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint16_t test_svsqrshru_u16_s64_x4(svint64x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshru,_n,_u16,_s64_x4,)(zn, 16); } // SQRSHRUN x 4 // CHECK-LABEL: @test_svsqrshrun_u8_s32_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshrun.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 32) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z25test_svsqrshrun_u8_s32_x411svint32x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshrun.x4.nxv4i32( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 32) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint8_t test_svsqrshrun_u8_s32_x4(svint32x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshrun,_n,_u8,_s32_x4,)(zn, 32); } // CHECK-LABEL: @test_svsqrshrun_u16_s64_x4( // CHECK-NEXT: entry: // CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshrun.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 64) // CHECK-NEXT: ret [[TMP0]] // // CPP-CHECK-LABEL: @_Z26test_svsqrshrun_u16_s64_x411svint64x4_t( // CPP-CHECK-NEXT: entry: // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.sqrshrun.x4.nxv2i64( [[ZN_COERCE0:%.*]], [[ZN_COERCE1:%.*]], [[ZN_COERCE2:%.*]], [[ZN_COERCE3:%.*]], i32 64) // CPP-CHECK-NEXT: ret [[TMP0]] // svuint16_t test_svsqrshrun_u16_s64_x4(svint64x4_t zn) __arm_streaming { return SVE_ACLE_FUNC(svqrshrun,_n,_u16,_s64_x4,)(zn, 64); }