diff --git a/clang/include/clang/Basic/arm_sve.td b/clang/include/clang/Basic/arm_sve.td index bcdddd6b0874f..a1ac926ab9577 100644 --- a/clang/include/clang/Basic/arm_sve.td +++ b/clang/include/clang/Basic/arm_sve.td @@ -2039,7 +2039,23 @@ def SVCNTP_COUNT : SInst<"svcntp_{d}", "n}i", "QcQsQiQl", MergeNone, "aarch64_sv defm SVREVD : SInstZPZ<"svrevd", "csilUcUsUiUl", "aarch64_sve_revd">; } -//////////////////////////////////////////////////////////////////////////////// + +let TargetGuard = "sve2p1,b16b16" in { +defm SVMUL_BF : SInstZPZZ<"svmul", "b", "aarch64_sve_fmul", "aarch64_sve_fmul_u">; +defm SVADD_BF : SInstZPZZ<"svadd", "b", "aarch64_sve_fadd", "aarch64_sve_fadd_u">; +defm SVSUB_BF : SInstZPZZ<"svsub", "b", "aarch64_sve_fsub", "aarch64_sve_fsub_u">; +defm SVMAXNM_BF : SInstZPZZ<"svmaxnm","b", "aarch64_sve_fmaxnm", "aarch64_sve_fmaxnm_u">; +defm SVMINNM_BF : SInstZPZZ<"svminnm","b", "aarch64_sve_fminnm", "aarch64_sve_fminnm_u">; +defm SVMAX_BF : SInstZPZZ<"svmax", "b", "aarch64_sve_fmax", "aarch64_sve_fmax_u">; +defm SVMIN_BF : SInstZPZZ<"svmin", "b", "aarch64_sve_fmin", "aarch64_sve_fmin_u">; +defm SVMLA_BF : SInstZPZZZ<"svmla", "b", "aarch64_sve_fmla", "aarch64_sve_fmla_u", []>; +defm SVMLS_BF : SInstZPZZZ<"svmls", "b", "aarch64_sve_fmls", "aarch64_sve_fmls_u", []>; +def SVMLA_LANE_BF : SInst<"svmla_lane[_{d}]", "ddddi", "b", MergeNone, "aarch64_sve_fmla_lane", [], [ImmCheck<3, ImmCheckLaneIndex, 2>]>; +def SVMLS_LANE_BF : SInst<"svmls_lane[_{d}]", "ddddi", "b", MergeNone, "aarch64_sve_fmls_lane", [], [ImmCheck<3, ImmCheckLaneIndex, 2>]>; +def SVMUL_LANE_BF : SInst<"svmul_lane[_{d}]", "dddi", "b", MergeNone, "aarch64_sve_fmul_lane", [], [ImmCheck<2, ImmCheckLaneIndex, 1>]>; +def SVFCLAMP_BF : SInst<"svclamp[_{d}]", "dddd", "b", MergeNone, "aarch64_sve_fclamp", [], []>; +} //sve2p1,b16b16 + // SME2 // SME intrinsics which operate only on vectors and do not require ZA should be added here, diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfadd.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfadd.c new file mode 100644 index 0000000000000..327c4f078872b --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfadd.c @@ -0,0 +1,133 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svadd_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fadd.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svadd_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fadd.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svadd_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svadd, _bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svadd_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fadd.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z17test_svadd_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fadd.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svadd_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svadd, _bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svadd_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fadd.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svadd_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fadd.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svadd_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svadd, _bf16, _x)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svadd_bf16_n_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fadd.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svadd_bf16_n_mu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fadd.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svadd_bf16_n_m(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svadd, _n_bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svadd_bf16_n_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fadd.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svadd_bf16_n_zu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fadd.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svadd_bf16_n_z(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svadd, _n_bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svadd_bf16_n_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fadd.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svadd_bf16_n_xu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fadd.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svadd_bf16_n_x(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svadd, _n_bf16, _x)(pg, op1, op2); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfclamp.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfclamp.c new file mode 100644 index 0000000000000..ddb279147bd1b --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfclamp.c @@ -0,0 +1,31 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svclamp_bf16( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fclamp.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z17test_svclamp_bf16u14__SVBfloat16_tS_S_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fclamp.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svclamp_bf16(svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svclamp, _bf16,)(op1, op2, op3); +} + diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmax.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmax.c new file mode 100644 index 0000000000000..0553b993622bd --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmax.c @@ -0,0 +1,134 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmax_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmax.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmax_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmax.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmax_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmax, _bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmax_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmax.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z17test_svmax_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmax.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmax_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmax, _bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmax_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmax.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmax_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmax.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmax_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmax, _bf16, _x)(pg, op1, op2); +} + + +// CHECK-LABEL: @test_svmax_bf16_n_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmax.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmax_bf16_n_mu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmax.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmax_bf16_n_m(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmax, _n_bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmax_bf16_n_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmax.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svmax_bf16_n_zu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmax.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmax_bf16_n_z(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmax, _n_bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmax_bf16_n_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmax.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmax_bf16_n_xu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmax.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmax_bf16_n_x(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmax, _n_bf16, _x)(pg, op1, op2); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmaxnm.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmaxnm.c new file mode 100644 index 0000000000000..fbbafde686edb --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmaxnm.c @@ -0,0 +1,134 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmaxnm_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmaxnm_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmaxnm_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmaxnm, _bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmaxnm_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svmaxnm_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmaxnm_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmaxnm, _bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmaxnm_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmaxnm_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmaxnm_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmaxnm, _bf16, _x)(pg, op1, op2); +} + + +// CHECK-LABEL: @test_svmaxnm_bf16_n_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z21test_svmaxnm_bf16_n_mu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmaxnm_bf16_n_m(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmaxnm, _n_bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmaxnm_bf16_n_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z21test_svmaxnm_bf16_n_zu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmaxnm_bf16_n_z(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmaxnm, _n_bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmaxnm_bf16_n_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z21test_svmaxnm_bf16_n_xu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmaxnm.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmaxnm_bf16_n_x(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmaxnm, _n_bf16, _x)(pg, op1, op2); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmin.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmin.c new file mode 100644 index 0000000000000..bf774ee0cef66 --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmin.c @@ -0,0 +1,134 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmin_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmin.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmin_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmin.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmin_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmin, _bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmin_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmin.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z17test_svmin_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmin.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmin_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmin, _bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmin_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmin.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmin_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmin.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmin_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmin, _bf16, _x)(pg, op1, op2); +} + + +// CHECK-LABEL: @test_svmin_bf16_n_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmin.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmin_bf16_n_mu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmin.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmin_bf16_n_m(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmin, _n_bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmin_bf16_n_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmin.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svmin_bf16_n_zu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmin.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmin_bf16_n_z(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmin, _n_bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmin_bf16_n_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmin.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmin_bf16_n_xu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmin.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmin_bf16_n_x(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmin, _n_bf16, _x)(pg, op1, op2); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfminnm.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfminnm.c new file mode 100644 index 0000000000000..cf00f0d504522 --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfminnm.c @@ -0,0 +1,134 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svminnm_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fminnm.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svminnm_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fminnm.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svminnm_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svminnm, _bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svminnm_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fminnm.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svminnm_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fminnm.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svminnm_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svminnm, _bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svminnm_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fminnm.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svminnm_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fminnm.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svminnm_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svminnm, _bf16, _x)(pg, op1, op2); +} + + +// CHECK-LABEL: @test_svminnm_bf16_n_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fminnm.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z21test_svminnm_bf16_n_mu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fminnm.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svminnm_bf16_n_m(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svminnm, _n_bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svminnm_bf16_n_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fminnm.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z21test_svminnm_bf16_n_zu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fminnm.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svminnm_bf16_n_z(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svminnm, _n_bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svminnm_bf16_n_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fminnm.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z21test_svminnm_bf16_n_xu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fminnm.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svminnm_bf16_n_x(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svminnm, _n_bf16, _x)(pg, op1, op2); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmla.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmla.c new file mode 100644 index 0000000000000..0e1532563f8bb --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmla.c @@ -0,0 +1,133 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmla_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmla.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmla_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_S0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmla.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmla_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla, _bf16, _m)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmla_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmla.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]], [[OP3:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z17test_svmla_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_S0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmla.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]], [[OP3:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmla_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla, _bf16, _z)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmla_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmla.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmla_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_S0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmla.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmla_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla, _bf16, _x)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmla_n_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmla.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmla_n_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_u6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmla.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmla_n_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, bfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla, _n_bf16, _m)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmla_n_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmla.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svmla_n_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_u6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmla.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmla_n_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, bfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla, _n_bf16, _z)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmla_n_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmla.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmla_n_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_u6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmla.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmla_n_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, bfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla, _n_bf16, _x)(pg, op1, op2, op3); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmla_lane.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmla_lane.c new file mode 100644 index 0000000000000..e408c20e325b5 --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmla_lane.c @@ -0,0 +1,60 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmla_lane_bf16_idx1( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmla.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 1) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmla_lane_bf16_idx1u14__SVBfloat16_tS_S_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmla.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 1) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmla_lane_bf16_idx1(svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla_lane, _bf16,)(op1, op2, op3, 1); +} + +// CHECK-LABEL: @test_svmla_lane_bf16_idx3( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmla.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 3) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmla_lane_bf16_idx3u14__SVBfloat16_tS_S_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmla.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 3) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmla_lane_bf16_idx3(svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla_lane ,_bf16,)(op1, op2, op3, 3); +} + +// CHECK-LABEL: @test_svmla_lane_bf16_idx7( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmla.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 7) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmla_lane_bf16_idx7u14__SVBfloat16_tS_S_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmla.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 7) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmla_lane_bf16_idx7(svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmla_lane, _bf16,)(op1, op2, op3, 7); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmls.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmls.c new file mode 100644 index 0000000000000..b7d576ea01df6 --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmls.c @@ -0,0 +1,133 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmls_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmls.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmls_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_S0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmls.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmls_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls, _bf16, _m)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmls_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmls.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]], [[OP3:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z17test_svmls_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_S0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmls.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]], [[OP3:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmls_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls, _bf16, _z)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmls_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmls.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmls_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_S0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmls.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmls_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls, _bf16, _x)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmls_n_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmls.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmls_n_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_u6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmls.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmls_n_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, bfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls, _n_bf16, _m)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmls_n_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmls.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svmls_n_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_u6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmls.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmls_n_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, bfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls, _n_bf16, _z)(pg, op1, op2, op3); +} + +// CHECK-LABEL: @test_svmls_n_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmls.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmls_n_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_u6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP3:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmls.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmls_n_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2, bfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls, _n_bf16, _x)(pg, op1, op2, op3); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmls_lane.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmls_lane.c new file mode 100644 index 0000000000000..f4d3f9e9bd60a --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmls_lane.c @@ -0,0 +1,60 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmls_lane_bf16_idx1( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmls.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 1) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmls_lane_bf16_idx1u14__SVBfloat16_tS_S_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmls.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 1) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmls_lane_bf16_idx1(svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls_lane, _bf16,)(op1, op2, op3, 1); +} + +// CHECK-LABEL: @test_svmls_lane_bf16_idx3( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmls.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 3) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmls_lane_bf16_idx3u14__SVBfloat16_tS_S_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmls.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 3) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmls_lane_bf16_idx3(svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls_lane, _bf16,)(op1, op2, op3, 3); +} + +// CHECK-LABEL: @test_svmls_lane_bf16_idx7( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmls.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 7) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmls_lane_bf16_idx7u14__SVBfloat16_tS_S_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmls.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], [[OP3:%.*]], i32 7) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmls_lane_bf16_idx7(svbfloat16_t op1, svbfloat16_t op2, svbfloat16_t op3) +{ + return SVE_ACLE_FUNC(svmls_lane, _bf16,)(op1, op2, op3, 7); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmul.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmul.c new file mode 100644 index 0000000000000..8b0de974f2473 --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmul.c @@ -0,0 +1,134 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmul_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmul.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmul_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmul.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmul_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul, _bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmul_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmul.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z17test_svmul_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmul.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmul_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul, _bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmul_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmul.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svmul_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmul.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmul_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul, _bf16, _x)(pg, op1, op2); +} + + +// CHECK-LABEL: @test_svmul_bf16_n_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmul.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmul_bf16_n_mu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmul.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmul_bf16_n_m(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul, _n_bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmul_bf16_n_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmul.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svmul_bf16_n_zu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fmul.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svmul_bf16_n_z(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul, _n_bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svmul_bf16_n_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmul.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svmul_bf16_n_xu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fmul.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svmul_bf16_n_x(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul, _n_bf16, _x)(pg, op1, op2); +} diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmul_lane.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmul_lane.c new file mode 100644 index 0000000000000..44cdf49c57bb8 --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmul_lane.c @@ -0,0 +1,61 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -target-feature +sve -target-feature -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svmul_lane_bf16_idx1( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmul.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], i32 1) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmul_lane_bf16_idx1u14__SVBfloat16_tS_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmul.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], i32 1) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmul_lane_bf16_idx1(svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul_lane, _bf16, )(op1, op2, 1); +} + +// CHECK-LABEL: @test_svmul_lane_bf16_idx3( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmul.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], i32 3) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmul_lane_bf16_idx3u14__SVBfloat16_tS_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmul.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], i32 3) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmul_lane_bf16_idx3(svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul_lane, _bf16, )(op1, op2, 3); +} + +// CHECK-LABEL: @test_svmul_lane_bf16_idx7( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmul.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], i32 7) +// CHECK-NEXT: ret [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z25test_svmul_lane_bf16_idx7u14__SVBfloat16_tS_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.fmul.lane.nxv8bf16( [[OP1:%.*]], [[OP2:%.*]], i32 7) +// CPP-CHECK-NEXT: ret [[TMP0]] +// +svbfloat16_t test_svmul_lane_bf16_idx7(svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svmul_lane, _bf16, )(op1, op2, 7); +} + diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfsub.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfsub.c new file mode 100644 index 0000000000000..c5cdf7efa445b --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfsub.c @@ -0,0 +1,134 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +b16b16 -S -disable-O0-optnone -Werror -Wall -emit-llvm -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 +sve2p1 -target-feature +b16b16 -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) A1##A3 +#else +#define SVE_ACLE_FUNC(A1,A2,A3) A1##A2##A3 +#endif + +// CHECK-LABEL: @test_svsub_bf16_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fsub.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svsub_bf16_mu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fsub.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svsub_bf16_m(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svsub, _bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svsub_bf16_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fsub.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z17test_svsub_bf16_zu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fsub.nxv8bf16( [[TMP0]], [[TMP1]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svsub_bf16_z(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svsub, _bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svsub_bf16_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fsub.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z17test_svsub_bf16_xu10__SVBool_tu14__SVBfloat16_tS0_( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fsub.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[OP2:%.*]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svsub_bf16_x(svbool_t pg, svbfloat16_t op1, svbfloat16_t op2) +{ + return SVE_ACLE_FUNC(svsub, _bf16, _x)(pg, op1, op2); +} + + +// CHECK-LABEL: @test_svsub_bf16_n_m( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fsub.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svsub_bf16_n_mu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fsub.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svsub_bf16_n_m(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svsub, _n_bf16, _m)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svsub_bf16_n_z( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fsub.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP2]] +// +// CPP-CHECK-LABEL: @_Z19test_svsub_bf16_n_zu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = select [[TMP0]], [[OP1:%.*]], zeroinitializer +// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call @llvm.aarch64.sve.fsub.nxv8bf16( [[TMP0]], [[TMP1]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP2]] +// +svbfloat16_t test_svsub_bf16_n_z(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svsub, _n_bf16, _z)(pg, op1, op2); +} + +// CHECK-LABEL: @test_svsub_bf16_n_x( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fsub.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CHECK-NEXT: ret [[TMP1]] +// +// CPP-CHECK-LABEL: @_Z19test_svsub_bf16_n_xu10__SVBool_tu14__SVBfloat16_tu6__bf16( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call @llvm.aarch64.sve.convert.from.svbool.nxv8i1( [[PG:%.*]]) +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement poison, bfloat [[OP2:%.*]], i64 0 +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector [[DOTSPLATINSERT]], poison, zeroinitializer +// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call @llvm.aarch64.sve.fsub.u.nxv8bf16( [[TMP0]], [[OP1:%.*]], [[DOTSPLAT]]) +// CPP-CHECK-NEXT: ret [[TMP1]] +// +svbfloat16_t test_svsub_bf16_n_x(svbool_t pg, svbfloat16_t op1, bfloat16_t op2) +{ + return SVE_ACLE_FUNC(svsub, _n_bf16, _x)(pg, op1, op2); +} diff --git a/clang/test/Sema/aarch64-sve2p1-intrinsics/acle_sve2p1_imm.cpp b/clang/test/Sema/aarch64-sve2p1-intrinsics/acle_sve2p1_imm.cpp index 84fdba432c244..35bf99bfcf4c5 100644 --- a/clang/test/Sema/aarch64-sve2p1-intrinsics/acle_sve2p1_imm.cpp +++ b/clang/test/Sema/aarch64-sve2p1-intrinsics/acle_sve2p1_imm.cpp @@ -117,6 +117,23 @@ void test_svdot_lane_2way(svint32_t s32, svuint32_t u32, svint16_t s16, svuint16 svdot_lane_f32_f16_f16(f32, f16, f16, 4); // expected-error {{argument value 4 is outside the valid range [0, 3]}} } + +__attribute__((target("+sve2p1+b16b16"))) +void test_svbfml_lane(svbfloat16_t zda, svbfloat16_t zn, svbfloat16_t zm, uint64_t idx){ + svmla_lane_bf16(zda, zn, zm, -1); // expected-error {{argument value 18446744073709551615 is outside the valid range [0, 7]}} + svmla_lane_bf16(zda, zn, zm, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}} + svmls_lane_bf16(zda, zn, zm, -1); // expected-error {{argument value 18446744073709551615 is outside the valid range [0, 7]}} + svmls_lane_bf16(zda, zn, zm, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}} + svmla_lane_bf16(zda, zn, zm, idx); // expected-errcor {{argument to 'svmla_lane_bf16' must be a constant integer}} + svmls_lane_bf16(zda, zn, zm, idx); // expected-error {{argument to 'svmla_lane_bf16' must be a constant integer}} +} + +__attribute__((target("+sve2p1+b16b16"))) +void test_svbfmul_lane(svbfloat16_t zn, svbfloat16_t zm, uint64_t idx){ + svmul_lane_bf16(zn, zm, -1); // expected-error {{argument value 18446744073709551615 is outside the valid range [0, 7]}} + svmul_lane_bf16(zn, zm, 8); // expected-error {{argument value 8 is outside the valid range [0, 7]}} + svmul_lane_bf16(zn, zm, idx); // expected-error {{argument to 'svmul_lane_bf16' must be a constant integer}} + __attribute__((target("+sve2p1"))) void test_svextq_lane(svint16_t zn_i16, svint16_t zm_i16, svfloat16_t zn_f16, svfloat16_t zm_f16){ svextq_lane_s16(zn_i16, zm_i16, -1); // expected-error {{argument value -1 is outside the valid range [0, 15]}} diff --git a/llvm/lib/Target/AArch64/AArch64.td b/llvm/lib/Target/AArch64/AArch64.td index 7176139ec1b73..914ad0b68a624 100644 --- a/llvm/lib/Target/AArch64/AArch64.td +++ b/llvm/lib/Target/AArch64/AArch64.td @@ -154,6 +154,9 @@ def FeatureExperimentalZeroingPseudos def FeatureUseScalarIncVL : SubtargetFeature<"use-scalar-inc-vl", "UseScalarIncVL", "true", "Prefer inc/dec over add+cnt">; +def FeatureBF16 : SubtargetFeature<"bf16", "HasBF16", + "true", "Enable BFloat16 Extension (FEAT_BF16)" >; + def FeatureNoSVEFPLD1R : SubtargetFeature<"no-sve-fp-ld1r", "NoSVEFPLD1R", "true", "Avoid using LD1RX instructions for FP">; @@ -178,7 +181,7 @@ def FeatureSVE2p1: SubtargetFeature<"sve2p1", "HasSVE2p1", "true", "Enable Scalable Vector Extension 2.1 instructions", [FeatureSVE2]>; def FeatureB16B16 : SubtargetFeature<"b16b16", "HasB16B16", "true", - "Enable SVE2.1 or SME2.1 non-widening BFloat16 to BFloat16 instructions (FEAT_B16B16)", []>; + "Enable SVE2.1 or SME2.1 non-widening BFloat16 to BFloat16 instructions (FEAT_B16B16)", [FeatureBF16]>; def FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true", "Has zero-cycle register moves">; @@ -447,9 +450,6 @@ def FeatureTaggedGlobals : SubtargetFeature<"tagged-globals", "true", "Use an instruction sequence for taking the address of a global " "that allows a memory tag in the upper address bits">; -def FeatureBF16 : SubtargetFeature<"bf16", "HasBF16", - "true", "Enable BFloat16 Extension (FEAT_BF16)" >; - def FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8", "true", "Enable Matrix Multiply Int8 Extension (FEAT_I8MM)">; diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/llvm/lib/Target/AArch64/AArch64InstrInfo.td index fb0ed425b1098..0a8abfae5051d 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.td +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.td @@ -137,7 +137,7 @@ def HasSVE : Predicate<"Subtarget->hasSVE()">, def HasSVE2 : Predicate<"Subtarget->hasSVE2()">, AssemblerPredicateWithAll<(all_of FeatureSVE2), "sve2">; def HasSVE2p1 : Predicate<"Subtarget->hasSVE2p1()">, - AssemblerPredicate<(any_of FeatureSVE2p1), "sve2p1">; + AssemblerPredicateWithAll<(all_of FeatureSVE2p1), "sve2p1">; def HasSVE2AES : Predicate<"Subtarget->hasSVE2AES()">, AssemblerPredicateWithAll<(all_of FeatureSVE2AES), "sve2-aes">; def HasSVE2SM4 : Predicate<"Subtarget->hasSVE2SM4()">, diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td index 9b17f884083a7..21cafe9b6c445 100644 --- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -4006,28 +4006,56 @@ def : InstAlias<"pfalse\t$Pd", (PFALSE PNRasPPR8:$Pd), 0>; // SVE2.1 non-widening BFloat16 to BFloat16 instructions //===----------------------------------------------------------------------===// -let Predicates = [HasSVE2p1_or_HasSME2p1, HasB16B16] in { -def BFADD_ZZZ : sve_fp_3op_u_zd<0b00, 0b000, "bfadd", ZPR16>; -def BFSUB_ZZZ : sve_fp_3op_u_zd<0b00, 0b001, "bfsub", ZPR16>; -def BFMUL_ZZZ : sve_fp_3op_u_zd<0b00, 0b010, "bfmul", ZPR16>; +let Predicates = [HasSVE2p1, HasB16B16, UseExperimentalZeroingPseudos] in { +defm BFADD_ZPZZ : sve2p1_bf_2op_p_zds_zeroing; +defm BFSUB_ZPZZ : sve2p1_bf_2op_p_zds_zeroing; +defm BFMUL_ZPZZ : sve2p1_bf_2op_p_zds_zeroing; +defm BFMAXNM_ZPZZ : sve2p1_bf_2op_p_zds_zeroing; +defm BFMINNM_ZPZZ : sve2p1_bf_2op_p_zds_zeroing; +defm BFMIN_ZPZZ : sve2p1_bf_2op_p_zds_zeroing; +defm BFMAX_ZPZZ : sve2p1_bf_2op_p_zds_zeroing; +} //HasSVE2p1_or_HasSME2p1, HasB16B16, UseExperimentalZeroingPseudos -def BFMLA_ZPmZZ : sve_fp_3op_p_zds_a<0b00, 0b00, "bfmla", ZPR16>; -def BFMLS_ZPmZZ : sve_fp_3op_p_zds_a<0b00, 0b01, "bfmls", ZPR16>; +let Predicates = [HasSVE2p1, HasB16B16] in { -def BFADD_ZPZmZ : sve_fp_2op_p_zds<0b00, 0b0000, "bfadd", ZPR16>; -def BFSUB_ZPZmZ : sve_fp_2op_p_zds<0b00, 0b0001, "bfsub", ZPR16>; -def BFMUL_ZPZmZ : sve_fp_2op_p_zds<0b00, 0b0010, "bfmul", ZPR16>; -def BFMAXNM_ZPZmZ : sve_fp_2op_p_zds<0b00, 0b0100, "bfmaxnm", ZPR16>; -def BFMINNM_ZPZmZ : sve_fp_2op_p_zds<0b00, 0b0101, "bfminnm", ZPR16>; -def BFMAX_ZPZmZ : sve_fp_2op_p_zds<0b00, 0b0110, "bfmax", ZPR16>; -def BFMIN_ZPZmZ : sve_fp_2op_p_zds<0b00, 0b0111, "bfmin", ZPR16>; +defm BFMLA_ZPmZZ : sve_fp_3op_p_zds_a_bf<0b00, "bfmla", "BFMLA_ZPZZZ", AArch64fmla_m1>; +defm BFMLS_ZPmZZ : sve_fp_3op_p_zds_a_bf<0b01, "bfmls", "BFMLS_ZPZZZ", AArch64fmls_m1>; -defm BFMLA_ZZZI : sve2p1_fp_bfma_by_indexed_elem<"bfmla", 0b10>; -defm BFMLS_ZZZI : sve2p1_fp_bfma_by_indexed_elem<"bfmls", 0b11>; +defm BFMLA_ZPZZZ : sve_fp_3op_pred_bf; +defm BFMLS_ZPZZZ : sve_fp_3op_pred_bf; -defm BFMUL_ZZZI : sve2p1_fp_bfmul_by_indexed_elem<"bfmul">; +defm BFMLA_ZZZI : sve2p1_fp_bfma_by_indexed_elem<"bfmla", 0b10, int_aarch64_sve_fmla_lane>; +defm BFMLS_ZZZI : sve2p1_fp_bfma_by_indexed_elem<"bfmls", 0b11, int_aarch64_sve_fmls_lane>; -def BFCLAMP_ZZZ : sve2p1_fclamp<"bfclamp", 0b00, ZPR16>; +defm BFADD_ZPmZZ : sve2p1_bf_2op_p_zds<0b0000, "bfadd", "BFADD_ZPZZ", AArch64fadd_m1, DestructiveBinaryComm>; +defm BFSUB_ZPmZZ : sve2p1_bf_2op_p_zds<0b0001, "bfsub", "BFSUB_ZPZZ", AArch64fsub_m1, DestructiveBinaryComm>; +defm BFMUL_ZPmZZ : sve2p1_bf_2op_p_zds<0b0010, "bfmul", "BFMUL_ZPZZ", AArch64fmul_m1, DestructiveBinaryComm>; + +defm BFADD_ZZZ : sve2p1_bf_3op_u_zd<0b000, "bfadd", fadd, AArch64fadd_p>; +defm BFSUB_ZZZ : sve2p1_bf_3op_u_zd<0b001, "bfsub", fsub, AArch64fsub_p>; +defm BFMUL_ZZZ : sve2p1_bf_3op_u_zd<0b010, "bfmul", fmul, AArch64fmul_p>; + +defm BFADD_ZPZZ : sve2p1_bf_bin_pred_zds; +defm BFSUB_ZPZZ : sve2p1_bf_bin_pred_zds; +defm BFMUL_ZPZZ : sve2p1_bf_bin_pred_zds; + + +defm BFMAX_ZPmZZ : sve2p1_bf_2op_p_zds<0b0110, "bfmax", "BFMAX_ZPZZ", int_aarch64_sve_fmax, DestructiveBinaryComm>; +defm BFMIN_ZPmZZ : sve2p1_bf_2op_p_zds<0b0111, "bfmin", "BFMIN_ZPZZ", int_aarch64_sve_fmin, DestructiveBinaryComm>; + +defm BFMAX_ZPZZ : sve2p1_bf_bin_pred_zds; +defm BFMIN_ZPZZ : sve2p1_bf_bin_pred_zds; + + +defm BFMAXNM_ZPmZZ : sve2p1_bf_2op_p_zds<0b0100, "bfmaxnm", "BFMAXNM_ZPZZ", int_aarch64_sve_fmaxnm, DestructiveBinaryComm>; +defm BFMINNM_ZPmZZ : sve2p1_bf_2op_p_zds<0b0101, "bfminnm", "BFMINNM_ZPZZ", int_aarch64_sve_fminnm, DestructiveBinaryComm>; + +defm BFMAXNM_ZPZZ : sve2p1_bf_bin_pred_zds; +defm BFMINNM_ZPZZ : sve2p1_bf_bin_pred_zds; + +defm BFMUL_ZZZI : sve2p1_fp_bfmul_by_indexed_elem<"bfmul", int_aarch64_sve_fmul_lane>; + +defm BFCLAMP_ZZZ : sve2p1_bfclamp<"bfclamp", int_aarch64_sve_fclamp>; } // End HasSVE2p1_or_HasSME2p1, HasB16B16 diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td index 952ef280f2769..e765926d8a635 100644 --- a/llvm/lib/Target/AArch64/SVEInstrFormats.td +++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td @@ -2118,6 +2118,29 @@ class sve_fp_2op_p_zds sz, bits<4> opc, string asm, let mayRaiseFPException = 1; } +multiclass sve2p1_bf_2op_p_zds opc, string asm, string Ps, + SDPatternOperator op, DestructiveInstTypeEnum flags, + string revname="", bit isReverseInstr=0> { +let DestructiveInstType = flags in { + def NAME : sve_fp_2op_p_zds<0b00, opc, asm, ZPR16>, + SVEPseudo2Instr, SVEInstr2Rev; + } + + def : SVE_3_Op_Pat(NAME)>; +} + +multiclass sve2p1_bf_bin_pred_zds { + def _UNDEF : PredTwoOpPseudo; + + def : SVE_3_Op_Pat(NAME # _UNDEF)>; +} + +multiclass sve2p1_bf_2op_p_zds_zeroing { + def _ZERO : PredTwoOpPseudo; + + def : SVE_3_Op_Pat_SelZero(NAME # _ZERO)>; +} + multiclass sve_fp_2op_p_zds opc, string asm, string Ps, SDPatternOperator op, DestructiveInstTypeEnum flags, string revname="", bit isReverseInstr=0> { @@ -2266,6 +2289,14 @@ multiclass sve_fp_3op_u_zd opc, string asm, SDPatternOperator op, def : SVE_2_Op_Pred_All_Active(NAME # _D)>; } +multiclass sve2p1_bf_3op_u_zd opc1, string asm, SDPatternOperator op, + SDPatternOperator predicated_op = null_frag> { + def NAME : sve_fp_3op_u_zd<0b00, opc1, asm, ZPR16>; + def : SVE_2_Op_Pat(NAME)>; + + def : SVE_2_Op_Pred_All_Active(NAME)>; +} + multiclass sve_fp_3op_u_zd_ftsmul opc, string asm, SDPatternOperator op> { def _H : sve_fp_3op_u_zd<0b01, opc, asm, ZPR16>; def _S : sve_fp_3op_u_zd<0b10, opc, asm, ZPR32>; @@ -2324,6 +2355,14 @@ multiclass sve_fp_3op_p_zds_a opc, string asm, string Ps, def : SVE_4_Op_Pat(NAME # _D)>; } +multiclass sve_fp_3op_p_zds_a_bf opc, string asm, string Ps, + SDPatternOperator op> { + def NAME : sve_fp_3op_p_zds_a<0b00, opc, asm, ZPR16>, + SVEPseudo2Instr, SVEInstr2Rev; + + def : SVE_4_Op_Pat(NAME)>; +} + class sve_fp_3op_p_zds_b sz, bits<2> opc, string asm, ZPRRegOp zprty> : I<(outs zprty:$Zdn), (ins PPR3bAny:$Pg, zprty:$_Zdn, zprty:$Zm, zprty:$Za), @@ -2391,7 +2430,7 @@ class sve_fp_fma_by_indexed_elem sz, bits<2> opc, string asm, let mayRaiseFPException = 1; } -multiclass sve2p1_fp_bfma_by_indexed_elem opc> { +multiclass sve2p1_fp_bfma_by_indexed_elem opc, SDPatternOperator op> { def NAME : sve_fp_fma_by_indexed_elem<{0, ?}, opc, asm, ZPR16, ZPR3b16, VectorIndexH32b> { bits<3> Zm; @@ -2400,6 +2439,8 @@ multiclass sve2p1_fp_bfma_by_indexed_elem opc> { let Inst{20-19} = iop{1-0}; let Inst{18-16} = Zm; } + def : Pat<(nxv8bf16 (op nxv8bf16:$op1, nxv8bf16:$op2, nxv8bf16:$op3, (i32 VectorIndexH32b_timm:$idx))), + (!cast(NAME) $op1, $op2, $op3, VectorIndexH32b_timm:$idx)>; } multiclass sve_fp_fma_by_indexed_elem opc, string asm, @@ -2456,7 +2497,7 @@ class sve_fp_fmul_by_indexed_elem sz, bit o2, string asm, ZPRRegOp zprty let mayRaiseFPException = 1; } -multiclass sve2p1_fp_bfmul_by_indexed_elem { +multiclass sve2p1_fp_bfmul_by_indexed_elem { def NAME : sve_fp_fmul_by_indexed_elem<{0, ?}, 0b1, asm, ZPR16, ZPR3b16, VectorIndexH32b> { bits<3> Zm; bits<3> iop; @@ -2464,6 +2505,8 @@ multiclass sve2p1_fp_bfmul_by_indexed_elem { let Inst{20-19} = iop{1-0}; let Inst{18-16} = Zm; } + def : Pat <(nxv8bf16 (ir_intrinsic nxv8bf16:$Op1, nxv8bf16:$Op2, (i32 VectorIndexH32b_timm:$idx))), + (!cast(NAME) $Op1, $Op2, VectorIndexH32b_timm:$idx)>; } multiclass sve_fp_fmul_by_indexed_elem { @@ -9100,6 +9143,12 @@ multiclass sve_fp_3op_pred_hfd { def : SVE_4_Op_Pat(NAME # _D_UNDEF)>; } +multiclass sve_fp_3op_pred_bf { + def _UNDEF : PredThreeOpPseudo; + + def : SVE_4_Op_Pat(NAME # _UNDEF)>; +} + // Predicated pseudo integer two operand instructions. multiclass sve_int_bin_pred_bhsd { def _B_UNDEF : PredTwoOpPseudo; @@ -9185,6 +9234,11 @@ multiclass sve2p1_fclamp { def : SVE_3_Op_Pat(NAME # _D)>; } +multiclass sve2p1_bfclamp { + def NAME : sve2p1_fclamp; + def : SVE_3_Op_Pat(NAME)>; +} + // SVE two-way dot product class sve2p1_two_way_dot_vv : I<(outs ZPR32:$Zda), (ins ZPR32:$_Zda, ZPR16:$Zn, ZPR16:$Zm), diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfadd.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfadd.ll new file mode 100644 index 0000000000000..221bb3b6045fb --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfadd.ll @@ -0,0 +1,62 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -mattr=+use-experimental-zeroing-pseudos -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define @bfadd_pred( %pg, %a, %b){ +; CHECK-LABEL: bfadd_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfadd z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fadd.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfadd_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfadd_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: movprfx z0.h, p0/z, z0.h +; CHECK-NEXT: bfadd z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fadd.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +define @bfadd_u( %pg, %a, %b){ +; CHECK-LABEL: bfadd_u: +; CHECK: // %bb.0: +; CHECK-NEXT: bfadd z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fadd.u.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfadd_u_ptrue( %a, %b){ +; CHECK-LABEL: bfadd_u_ptrue: +; CHECK: // %bb.0: +; CHECK-NEXT: bfadd z0.h, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fadd.u.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfadd_u_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfadd_u_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: mov z2.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z2.h +; CHECK-NEXT: bfadd z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fadd.u.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +declare @llvm.aarch64.sve.fadd.nxv8bf16(, , ) +declare @llvm.aarch64.sve.fadd.u.nxv8bf16(, , ) +declare @llvm.aarch64.sve.ptrue.nxv8i1(i32 immarg) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfclamp.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfclamp.ll new file mode 100644 index 0000000000000..61b67755a3544 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfclamp.ll @@ -0,0 +1,13 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -verify-machineinstrs < %s | FileCheck %s + +define @bfclamp( %a, %b, %c){ +; CHECK-LABEL: bfclamp: +; CHECK: // %bb.0: +; CHECK-NEXT: bfclamp z0.h, z1.h, z2.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fclamp.nxv8bf16( %a, %b, %c) + ret %res +} + +declare @llvm.aarch64.sve.fclamp.nxv8bf16(, , ) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmax.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmax.ll new file mode 100644 index 0000000000000..24c4fedb34266 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmax.ll @@ -0,0 +1,74 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -mattr=+use-experimental-zeroing-pseudos -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define @bfmax_pred( %pg, %a, %b){ +; CHECK-LABEL: bfmax_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmax z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmax.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfmax( %a, %b){ +; CHECK-LABEL: bfmax: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.h +; CHECK-NEXT: bfmax z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fmax.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfmax_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfmax_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: movprfx z0.h, p0/z, z0.h +; CHECK-NEXT: bfmax z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fmax.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +define @bfmax_u_pred( %pg, %a, %b){ +; CHECK-LABEL: bfmax_u_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmax z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmax.u.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfmax_u( %a, %b){ +; CHECK-LABEL: bfmax_u: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.h +; CHECK-NEXT: bfmax z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fmax.u.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfmax_u_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfmax_u_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: mov z2.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z2.h +; CHECK-NEXT: bfmax z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fmax.u.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +declare @llvm.aarch64.sve.fmax.nxv8bf16(, , ) +declare @llvm.aarch64.sve.fmax.u.nxv8bf16(, , ) +declare @llvm.aarch64.sve.ptrue.nxv8i1(i32 immarg) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmaxnm.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmaxnm.ll new file mode 100644 index 0000000000000..25fe9cf7243a4 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmaxnm.ll @@ -0,0 +1,74 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -mattr=+use-experimental-zeroing-pseudos -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define @bfmaxnm_pred( %pg, %a, %b){ +; CHECK-LABEL: bfmaxnm_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmaxnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmaxnm.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfmaxnm( %a, %b){ +; CHECK-LABEL: bfmaxnm: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.h +; CHECK-NEXT: bfmaxnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fmaxnm.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfmaxnm_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfmaxnm_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: movprfx z0.h, p0/z, z0.h +; CHECK-NEXT: bfmaxnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fmaxnm.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +define @bfmaxnm_u_pred( %pg, %a, %b){ +; CHECK-LABEL: bfmaxnm_u_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmaxnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmaxnm.u.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfmaxnm_u( %a, %b){ +; CHECK-LABEL: bfmaxnm_u: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.h +; CHECK-NEXT: bfmaxnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fmaxnm.u.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfmaxnm_u_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfmaxnm_u_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: mov z2.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z2.h +; CHECK-NEXT: bfmaxnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fmaxnm.u.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +declare @llvm.aarch64.sve.fmaxnm.nxv8bf16(, , ) +declare @llvm.aarch64.sve.fmaxnm.u.nxv8bf16(, , ) +declare @llvm.aarch64.sve.ptrue.nxv8i1(i32 immarg) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmin.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmin.ll new file mode 100644 index 0000000000000..d5b0b8be8b85e --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmin.ll @@ -0,0 +1,74 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -mattr=+use-experimental-zeroing-pseudos -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define @bfmin_pred( %pg, %a, %b){ +; CHECK-LABEL: bfmin_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmin z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmin.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfmin( %a, %b){ +; CHECK-LABEL: bfmin: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.h +; CHECK-NEXT: bfmin z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fmin.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfmin_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfmin_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: movprfx z0.h, p0/z, z0.h +; CHECK-NEXT: bfmin z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fmin.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +define @bfmin_u_pred( %pg, %a, %b){ +; CHECK-LABEL: bfmin_u_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmin z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmin.u.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfmin_u( %a, %b){ +; CHECK-LABEL: bfmin_u: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.h +; CHECK-NEXT: bfmin z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fmin.u.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfmin_u_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfmin_u_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: mov z2.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z2.h +; CHECK-NEXT: bfmin z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fmin.u.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +declare @llvm.aarch64.sve.fmin.nxv8bf16(, , ) +declare @llvm.aarch64.sve.fmin.u.nxv8bf16(, , ) +declare @llvm.aarch64.sve.ptrue.nxv8i1(i32 immarg) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfminnm.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfminnm.ll new file mode 100644 index 0000000000000..c019dc7cbe291 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfminnm.ll @@ -0,0 +1,74 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -mattr=+use-experimental-zeroing-pseudos -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define @bfminnm_pred( %pg, %a, %b){ +; CHECK-LABEL: bfminnm_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfminnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fminnm.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfminnm( %a, %b){ +; CHECK-LABEL: bfminnm: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.h +; CHECK-NEXT: bfminnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fminnm.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfminnm_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfminnm_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: movprfx z0.h, p0/z, z0.h +; CHECK-NEXT: bfminnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fminnm.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +define @bfminnm_u_pred( %pg, %a, %b){ +; CHECK-LABEL: bfminnm_u_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfminnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fminnm.u.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfminnm_u( %a, %b){ +; CHECK-LABEL: bfminnm_u: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.h +; CHECK-NEXT: bfminnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fminnm.u.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfminnm_u_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfminnm_u_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: mov z2.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z2.h +; CHECK-NEXT: bfminnm z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fminnm.u.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +declare @llvm.aarch64.sve.fminnm.nxv8bf16(, , ) +declare @llvm.aarch64.sve.fminnm.u.nxv8bf16(, , ) +declare @llvm.aarch64.sve.ptrue.nxv8i1(i32 immarg) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmla.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmla.ll new file mode 100644 index 0000000000000..02b1db13ea34f --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmla.ll @@ -0,0 +1,35 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -verify-machineinstrs < %s | FileCheck %s + +define @bfmla_m( %pg, %a, %b, %c){ +; CHECK-LABEL: bfmla_m: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmla z0.h, p0/m, z1.h, z2.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmla.nxv8bf16( %pg, %a, %b, %c) + ret %res +} + +define @bfmla_x( %pg, %a, %b, %c){ +; CHECK-LABEL: bfmla_x: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmla z0.h, p0/m, z1.h, z2.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmla.u.nxv8bf16( %pg, %a, %b, %c) + ret %res +} + +define @bfmla_z( %pg, %a, %b, %c){ +; CHECK-LABEL: bfmla_z: +; CHECK: // %bb.0: +; CHECK-NEXT: mov z3.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z3.h +; CHECK-NEXT: bfmla z0.h, p0/m, z1.h, z2.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %res = call @llvm.aarch64.sve.fmla.nxv8bf16( %pg, %a_z, %b, %c) + ret %res +} + +declare @llvm.aarch64.sve.fmla.nxv8bf16(, , , ) +declare @llvm.aarch64.sve.fmla.u.nxv8bf16(, , , ) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmla_lane.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmla_lane.ll new file mode 100644 index 0000000000000..d0e3a82df3ff9 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmla_lane.ll @@ -0,0 +1,31 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -verify-machineinstrs < %s | FileCheck %s + +define @bfmla_lane_idx1( %a, %b, %c){ +; CHECK-LABEL: bfmla_lane_idx1: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmla z0.h, z1.h, z2.h[1] +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmla.lane.nxv8bf16( %a, %b, %c, i32 1) + ret %res +} + +define @bfmla_lane_idx3( %a, %b, %c){ +; CHECK-LABEL: bfmla_lane_idx3: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmla z0.h, z1.h, z2.h[3] +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmla.lane.nxv8bf16( %a, %b, %c, i32 3) + ret %res +} + +define @bfmla_lane_idx7( %a, %b, %c){ +; CHECK-LABEL: bfmla_lane_idx7: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmla z0.h, z1.h, z2.h[7] +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmla.lane.nxv8bf16( %a, %b, %c, i32 7) + ret %res +} + +declare @llvm.aarch64.sve.fmla.lane.nxv8bf16(, , , i32) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmls.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmls.ll index 04ad000f20f07..987fe1fb5822a 100644 --- a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmls.ll +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmls.ll @@ -1,43 +1,36 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme2p1 -mattr=+b16b16 -verify-machineinstrs < %s | FileCheck %s +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -verify-machineinstrs < %s | FileCheck %s -define @bfmlslb_f32( %zda, %zn, %zm) { -; CHECK-LABEL: bfmlslb_f32: +define @bfmls_m( %pg, %a, %b, %c){ +; CHECK-LABEL: bfmls_m: ; CHECK: // %bb.0: -; CHECK-NEXT: bfmlslb z0.s, z1.h, z2.h +; CHECK-NEXT: bfmls z0.h, p0/m, z1.h, z2.h ; CHECK-NEXT: ret - %out = call @llvm.aarch64.sve.bfmlslb( %zda, %zn, %zm) - ret %out + %res = call @llvm.aarch64.sve.fmls.nxv8bf16( %pg, %a, %b, %c) + ret %res } -define @bfmlslt_f32( %zda, %zn, %zm) { -; CHECK-LABEL: bfmlslt_f32: +define @bfmls_x( %pg, %a, %b, %c){ +; CHECK-LABEL: bfmls_x: ; CHECK: // %bb.0: -; CHECK-NEXT: bfmlslt z0.s, z1.h, z2.h +; CHECK-NEXT: bfmls z0.h, p0/m, z1.h, z2.h ; CHECK-NEXT: ret - %out = call @llvm.aarch64.sve.bfmlslt( %zda, %zn, %zm) - ret %out + %res = call @llvm.aarch64.sve.fmls.u.nxv8bf16( %pg, %a, %b, %c) + ret %res } -define @bfmlslb_lane_f32( %zda, %zn, %zm) { -; CHECK-LABEL: bfmlslb_lane_f32: -; CHECK: // %bb.0: -; CHECK-NEXT: bfmlslb z0.s, z1.h, z2.h[7] -; CHECK-NEXT: ret - %out = call @llvm.aarch64.sve.bfmlslb.lane( %zda, %zn, %zm, i32 7) - ret %out -} -define @bfmlslt_lane_f32( %zda, %zn, %zm) { -; CHECK-LABEL: bfmlslt_lane_f32: +define @bfmls_z( %pg, %a, %b, %c){ +; CHECK-LABEL: bfmls_z: ; CHECK: // %bb.0: -; CHECK-NEXT: bfmlslt z0.s, z1.h, z2.h[7] +; CHECK-NEXT: mov z3.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z3.h +; CHECK-NEXT: bfmls z0.h, p0/m, z1.h, z2.h ; CHECK-NEXT: ret - %out = call @llvm.aarch64.sve.bfmlslt.lane( %zda, %zn, %zm, i32 7) - ret %out + %a_z = select %pg, %a, zeroinitializer + %res = call @llvm.aarch64.sve.fmls.nxv8bf16( %pg, %a_z, %b, %c) + ret %res } -declare @llvm.aarch64.sve.bfmlslb(, , ) -declare @llvm.aarch64.sve.bfmlslt(, , ) -declare @llvm.aarch64.sve.bfmlslb.lane(, , , i32) -declare @llvm.aarch64.sve.bfmlslt.lane(, , , i32) +declare @llvm.aarch64.sve.fmls.nxv8bf16(, , , ) +declare @llvm.aarch64.sve.fmls.u.nxv8bf16(, , , ) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmls_lane.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmls_lane.ll new file mode 100644 index 0000000000000..16b4538ffab9e --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmls_lane.ll @@ -0,0 +1,31 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -verify-machineinstrs < %s | FileCheck %s + +define @bfmls_lane_idx1( %a, %b, %c){ +; CHECK-LABEL: bfmls_lane_idx1: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmls z0.h, z1.h, z2.h[1] +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmls.lane.nxv8bf16( %a, %b, %c, i32 1) + ret %res +} + +define @bfmls_lane_idx3( %a, %b, %c){ +; CHECK-LABEL: bfmls_lane_idx3: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmls z0.h, z1.h, z2.h[3] +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmls.lane.nxv8bf16( %a, %b, %c, i32 3) + ret %res +} + +define @bfmls_lane_idx7( %a, %b, %c){ +; CHECK-LABEL: bfmls_lane_idx7: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmls z0.h, z1.h, z2.h[7] +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmls.lane.nxv8bf16( %a, %b, %c, i32 7) + ret %res +} + +declare @llvm.aarch64.sve.fmls.lane.nxv8bf16(, , , i32) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmlsl.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmlsl.ll new file mode 100644 index 0000000000000..2b96d452fba0d --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmlsl.ll @@ -0,0 +1,43 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -verify-machineinstrs < %s | FileCheck %s + +define @bfmlslb_f32( %zda, %zn, %zm) { +; CHECK-LABEL: bfmlslb_f32: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmlslb z0.s, z1.h, z2.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.bfmlslb( %zda, %zn, %zm) + ret %out +} + +define @bfmlslt_f32( %zda, %zn, %zm) { +; CHECK-LABEL: bfmlslt_f32: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmlslt z0.s, z1.h, z2.h +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.bfmlslt( %zda, %zn, %zm) + ret %out +} + +define @bfmlslb_lane_f32( %zda, %zn, %zm) { +; CHECK-LABEL: bfmlslb_lane_f32: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmlslb z0.s, z1.h, z2.h[7] +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.bfmlslb.lane( %zda, %zn, %zm, i32 7) + ret %out +} + +define @bfmlslt_lane_f32( %zda, %zn, %zm) { +; CHECK-LABEL: bfmlslt_lane_f32: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmlslt z0.s, z1.h, z2.h[7] +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.bfmlslt.lane( %zda, %zn, %zm, i32 7) + ret %out +} + +declare @llvm.aarch64.sve.bfmlslb(, , ) +declare @llvm.aarch64.sve.bfmlslt(, , ) +declare @llvm.aarch64.sve.bfmlslb.lane(, , , i32) +declare @llvm.aarch64.sve.bfmlslt.lane(, , , i32) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmul.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmul.ll new file mode 100644 index 0000000000000..a04c5a52139cd --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmul.ll @@ -0,0 +1,62 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -mattr=+use-experimental-zeroing-pseudos -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define @bfmul_pred( %pg, %a, %b){ +; CHECK-LABEL: bfmul_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmul z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmul.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfmul_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfmul_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: movprfx z0.h, p0/z, z0.h +; CHECK-NEXT: bfmul z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fmul.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +define @bfmul_u_pred( %pg, %a, %b){ +; CHECK-LABEL: bfmul_u_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmul z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fmul.u.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfmul_u( %a, %b){ +; CHECK-LABEL: bfmul_u: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmul z0.h, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fmul.u.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfmul_u_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfmul_u_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: mov z2.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z2.h +; CHECK-NEXT: bfmul z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fmul.u.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +declare @llvm.aarch64.sve.fmul.nxv8bf16(, , ) +declare @llvm.aarch64.sve.fmul.u.nxv8bf16(, , ) +declare @llvm.aarch64.sve.ptrue.nxv8i1(i32 immarg) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmul_lane.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmul_lane.ll new file mode 100644 index 0000000000000..2962d59e707ca --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfmul_lane.ll @@ -0,0 +1,37 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -verify-machineinstrs < %s | FileCheck %s + +define @bfmul_lane_idx1( %a, %b) { +; CHECK-LABEL: bfmul_lane_idx1: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmul z0.h, z0.h, z1.h[1] +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fmul.lane.nxv8bf16( %a, + %b, + i32 1) + ret %out +} + +define @bfmul_lane_idx3( %a, %b) { +; CHECK-LABEL: bfmul_lane_idx3: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmul z0.h, z0.h, z1.h[3] +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fmul.lane.nxv8bf16( %a, + %b, + i32 3) + ret %out +} + +define @bfmul_lane_idx7( %a, %b) { +; CHECK-LABEL: bfmul_lane_idx7: +; CHECK: // %bb.0: +; CHECK-NEXT: bfmul z0.h, z0.h, z1.h[7] +; CHECK-NEXT: ret + %out = call @llvm.aarch64.sve.fmul.lane.nxv8bf16( %a, + %b, + i32 7) + ret %out +} + +declare @llvm.aarch64.sve.fmul.lane.nxv8bf16(, , i32) diff --git a/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfsub.ll b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfsub.ll new file mode 100644 index 0000000000000..752b5ae9df630 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/sve2p1-intrinsics-bfsub.ll @@ -0,0 +1,62 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2p1 -mattr=+b16b16 -mattr=+use-experimental-zeroing-pseudos -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define @bfsub_pred( %pg, %a, %b){ +; CHECK-LABEL: bfsub_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfsub z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fsub.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfsub_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfsub_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: movprfx z0.h, p0/z, z0.h +; CHECK-NEXT: bfsub z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fsub.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +define @bfsub_u_pred( %pg, %a, %b){ +; CHECK-LABEL: bfsub_u_pred: +; CHECK: // %bb.0: +; CHECK-NEXT: bfsub z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %res = call @llvm.aarch64.sve.fsub.u.nxv8bf16( %pg, %a, %b) + ret %res +} + +define @bfsub_u( %a, %b){ +; CHECK-LABEL: bfsub_u: +; CHECK: // %bb.0: +; CHECK-NEXT: bfsub z0.h, z0.h, z1.h +; CHECK-NEXT: ret + %elt = call @llvm.aarch64.sve.ptrue.nxv8i1(i32 31) + %res = call @llvm.aarch64.sve.fsub.u.nxv8bf16( %elt, %a, %b) + ret %res +} + +define @bfsub_u_zeroing( %pg, %a, %b) { +; CHECK-LABEL: bfsub_u_zeroing: +; CHECK: // %bb.0: +; CHECK-NEXT: mov z2.h, #0 // =0x0 +; CHECK-NEXT: sel z0.h, p0, z0.h, z2.h +; CHECK-NEXT: bfsub z0.h, p0/m, z0.h, z1.h +; CHECK-NEXT: ret + %a_z = select %pg, %a, zeroinitializer + %out = call @llvm.aarch64.sve.fsub.u.nxv8bf16( %pg, + %a_z, + %b) + ret %out +} + +declare @llvm.aarch64.sve.fsub.nxv8bf16(, , ) +declare @llvm.aarch64.sve.fsub.u.nxv8bf16(, , ) +declare @llvm.aarch64.sve.ptrue.nxv8i1(i32 immarg) diff --git a/llvm/test/MC/AArch64/SVE2p1/bfadd.s b/llvm/test/MC/AArch64/SVE2p1/bfadd.s index 1021df12fc050..a29f3e6af8ba4 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfadd.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfadd.s @@ -16,7 +16,7 @@ bfadd z23.h, p3/m, z23.h, z13.h // 01100101-00000000-10001101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfadd z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65008db7 movprfx z23, z31 @@ -24,53 +24,53 @@ bfadd z23.h, p3/m, z23.h, z13.h // 01100101-00000000-10001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfadd z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65008db7 bfadd z0.h, p0/m, z0.h, z0.h // 01100101-00000000-10000000-00000000 // CHECK-INST: bfadd z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x80,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65008000 bfadd z21.h, p5/m, z21.h, z10.h // 01100101-00000000-10010101-01010101 // CHECK-INST: bfadd z21.h, p5/m, z21.h, z10.h // CHECK-ENCODING: [0x55,0x95,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65009555 bfadd z23.h, p3/m, z23.h, z13.h // 01100101-00000000-10001101-10110111 // CHECK-INST: bfadd z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65008db7 bfadd z31.h, p7/m, z31.h, z31.h // 01100101-00000000-10011111-11111111 // CHECK-INST: bfadd z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x9f,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65009fff bfadd z0.h, z0.h, z0.h // 01100101-00000000-00000000-00000000 // CHECK-INST: bfadd z0.h, z0.h, z0.h // CHECK-ENCODING: [0x00,0x00,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65000000 bfadd z21.h, z10.h, z21.h // 01100101-00010101-00000001-01010101 // CHECK-INST: bfadd z21.h, z10.h, z21.h // CHECK-ENCODING: [0x55,0x01,0x15,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65150155 bfadd z23.h, z13.h, z8.h // 01100101-00001000-00000001-10110111 // CHECK-INST: bfadd z23.h, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x01,0x08,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 650801b7 bfadd z31.h, z31.h, z31.h // 01100101-00011111-00000011-11111111 // CHECK-INST: bfadd z31.h, z31.h, z31.h // CHECK-ENCODING: [0xff,0x03,0x1f,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 651f03ff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfclamp.s b/llvm/test/MC/AArch64/SVE2p1/bfclamp.s index d7b85edb1730e..aed96f3d91e98 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfclamp.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfclamp.s @@ -17,30 +17,30 @@ bfclamp z23.h, z13.h, z8.h // 01100100-00101000-00100101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfclamp z23.h, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x25,0x28,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 642825b7 bfclamp z0.h, z0.h, z0.h // 01100100-00100000-00100100-00000000 // CHECK-INST: bfclamp z0.h, z0.h, z0.h // CHECK-ENCODING: [0x00,0x24,0x20,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64202400 bfclamp z21.h, z10.h, z21.h // 01100100-00110101-00100101-01010101 // CHECK-INST: bfclamp z21.h, z10.h, z21.h // CHECK-ENCODING: [0x55,0x25,0x35,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64352555 bfclamp z23.h, z13.h, z8.h // 01100100-00101000-00100101-10110111 // CHECK-INST: bfclamp z23.h, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x25,0x28,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 642825b7 bfclamp z31.h, z31.h, z31.h // 01100100-00111111-00100111-11111111 // CHECK-INST: bfclamp z31.h, z31.h, z31.h // CHECK-ENCODING: [0xff,0x27,0x3f,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 643f27ff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfmax.s b/llvm/test/MC/AArch64/SVE2p1/bfmax.s index cd67abc498f3b..bf69c0a040686 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfmax.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfmax.s @@ -17,7 +17,7 @@ bfmax z23.h, p3/m, z23.h, z13.h // 01100101-00000110-10001101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfmax z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x06,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65068db7 movprfx z23, z31 @@ -25,29 +25,29 @@ bfmax z23.h, p3/m, z23.h, z13.h // 01100101-00000110-10001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfmax z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x06,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65068db7 bfmax z0.h, p0/m, z0.h, z0.h // 01100101-00000110-10000000-00000000 // CHECK-INST: bfmax z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x80,0x06,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65068000 bfmax z21.h, p5/m, z21.h, z10.h // 01100101-00000110-10010101-01010101 // CHECK-INST: bfmax z21.h, p5/m, z21.h, z10.h // CHECK-ENCODING: [0x55,0x95,0x06,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65069555 bfmax z23.h, p3/m, z23.h, z13.h // 01100101-00000110-10001101-10110111 // CHECK-INST: bfmax z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x06,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65068db7 bfmax z31.h, p7/m, z31.h, z31.h // 01100101-00000110-10011111-11111111 // CHECK-INST: bfmax z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x9f,0x06,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65069fff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfmaxnm.s b/llvm/test/MC/AArch64/SVE2p1/bfmaxnm.s index 83669ebc42b1f..8e4ffc31218ab 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfmaxnm.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfmaxnm.s @@ -17,7 +17,7 @@ bfmaxnm z23.h, p3/m, z23.h, z13.h // 01100101-00000100-10001101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfmaxnm z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x04,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65048db7 movprfx z23, z31 @@ -25,30 +25,30 @@ bfmaxnm z23.h, p3/m, z23.h, z13.h // 01100101-00000100-10001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfmaxnm z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x04,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65048db7 bfmaxnm z0.h, p0/m, z0.h, z0.h // 01100101-00000100-10000000-00000000 // CHECK-INST: bfmaxnm z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x80,0x04,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65048000 bfmaxnm z21.h, p5/m, z21.h, z10.h // 01100101-00000100-10010101-01010101 // CHECK-INST: bfmaxnm z21.h, p5/m, z21.h, z10.h // CHECK-ENCODING: [0x55,0x95,0x04,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65049555 bfmaxnm z23.h, p3/m, z23.h, z13.h // 01100101-00000100-10001101-10110111 // CHECK-INST: bfmaxnm z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x04,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65048db7 bfmaxnm z31.h, p7/m, z31.h, z31.h // 01100101-00000100-10011111-11111111 // CHECK-INST: bfmaxnm z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x9f,0x04,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65049fff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfmin.s b/llvm/test/MC/AArch64/SVE2p1/bfmin.s index 1bb3a0e6f1f26..17bf50913271c 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfmin.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfmin.s @@ -17,7 +17,7 @@ bfmin z23.h, p3/m, z23.h, z13.h // 01100101-00000111-10001101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfmin z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x07,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65078db7 movprfx z23, z31 @@ -25,30 +25,30 @@ bfmin z23.h, p3/m, z23.h, z13.h // 01100101-00000111-10001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfmin z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x07,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65078db7 bfmin z0.h, p0/m, z0.h, z0.h // 01100101-00000111-10000000-00000000 // CHECK-INST: bfmin z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x80,0x07,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65078000 bfmin z21.h, p5/m, z21.h, z10.h // 01100101-00000111-10010101-01010101 // CHECK-INST: bfmin z21.h, p5/m, z21.h, z10.h // CHECK-ENCODING: [0x55,0x95,0x07,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65079555 bfmin z23.h, p3/m, z23.h, z13.h // 01100101-00000111-10001101-10110111 // CHECK-INST: bfmin z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x07,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65078db7 bfmin z31.h, p7/m, z31.h, z31.h // 01100101-00000111-10011111-11111111 // CHECK-INST: bfmin z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x9f,0x07,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65079fff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfminnm.s b/llvm/test/MC/AArch64/SVE2p1/bfminnm.s index 9f444c7ac26ae..e0cd2adc675ee 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfminnm.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfminnm.s @@ -17,7 +17,7 @@ bfminnm z23.h, p3/m, z23.h, z13.h // 01100101-00000101-10001101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfminnm z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x05,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65058db7 movprfx z23, z31 @@ -25,30 +25,30 @@ bfminnm z23.h, p3/m, z23.h, z13.h // 01100101-00000101-10001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfminnm z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x05,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65058db7 bfminnm z0.h, p0/m, z0.h, z0.h // 01100101-00000101-10000000-00000000 // CHECK-INST: bfminnm z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x80,0x05,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65058000 bfminnm z21.h, p5/m, z21.h, z10.h // 01100101-00000101-10010101-01010101 // CHECK-INST: bfminnm z21.h, p5/m, z21.h, z10.h // CHECK-ENCODING: [0x55,0x95,0x05,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65059555 bfminnm z23.h, p3/m, z23.h, z13.h // 01100101-00000101-10001101-10110111 // CHECK-INST: bfminnm z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x05,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65058db7 bfminnm z31.h, p7/m, z31.h, z31.h // 01100101-00000101-10011111-11111111 // CHECK-INST: bfminnm z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x9f,0x05,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65059fff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfmla.s b/llvm/test/MC/AArch64/SVE2p1/bfmla.s index ff257830a13da..a265eb8b71df9 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfmla.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfmla.s @@ -17,31 +17,31 @@ bfmla z23.h, z13.h, z0.h[5] // 01100100-01101000-00001001-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfmla z23.h, z13.h, z0.h[5] // CHECK-ENCODING: [0xb7,0x09,0x68,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 646809b7 bfmla z0.h, z0.h, z0.h[0] // 01100100-00100000-00001000-00000000 // CHECK-INST: bfmla z0.h, z0.h, z0.h[0] // CHECK-ENCODING: [0x00,0x08,0x20,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64200800 bfmla z21.h, z10.h, z5.h[6] // 01100100-01110101-00001001-01010101 // CHECK-INST: bfmla z21.h, z10.h, z5.h[6] // CHECK-ENCODING: [0x55,0x09,0x75,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64750955 bfmla z23.h, z13.h, z0.h[5] // 01100100-01101000-00001001-10110111 // CHECK-INST: bfmla z23.h, z13.h, z0.h[5] // CHECK-ENCODING: [0xb7,0x09,0x68,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 646809b7 bfmla z31.h, z31.h, z7.h[7] // 01100100-01111111-00001011-11111111 // CHECK-INST: bfmla z31.h, z31.h, z7.h[7] // CHECK-ENCODING: [0xff,0x0b,0x7f,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 647f0bff @@ -50,7 +50,7 @@ bfmla z23.h, p3/m, z13.h, z8.h // 01100101-00101000-00001101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfmla z23.h, p3/m, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x0d,0x28,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65280db7 movprfx z23, z31 @@ -58,30 +58,30 @@ bfmla z23.h, p3/m, z13.h, z8.h // 01100101-00101000-00001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfmla z23.h, p3/m, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x0d,0x28,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65280db7 bfmla z0.h, p0/m, z0.h, z0.h // 01100101-00100000-00000000-00000000 // CHECK-INST: bfmla z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x00,0x20,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65200000 bfmla z21.h, p5/m, z10.h, z21.h // 01100101-00110101-00010101-01010101 // CHECK-INST: bfmla z21.h, p5/m, z10.h, z21.h // CHECK-ENCODING: [0x55,0x15,0x35,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65351555 bfmla z23.h, p3/m, z13.h, z8.h // 01100101-00101000-00001101-10110111 // CHECK-INST: bfmla z23.h, p3/m, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x0d,0x28,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65280db7 bfmla z31.h, p7/m, z31.h, z31.h // 01100101-00111111-00011111-11111111 // CHECK-INST: bfmla z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x1f,0x3f,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 653f1fff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfmls.s b/llvm/test/MC/AArch64/SVE2p1/bfmls.s index c153b56b9586b..56713e74adf8f 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfmls.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfmls.s @@ -17,31 +17,31 @@ bfmls z23.h, z13.h, z0.h[5] // 01100100-01101000-00001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfmls z23.h, z13.h, z0.h[5] // CHECK-ENCODING: [0xb7,0x0d,0x68,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64680db7 bfmls z0.h, z0.h, z0.h[0] // 01100100-00100000-00001100-00000000 // CHECK-INST: bfmls z0.h, z0.h, z0.h[0] // CHECK-ENCODING: [0x00,0x0c,0x20,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64200c00 bfmls z21.h, z10.h, z5.h[6] // 01100100-01110101-00001101-01010101 // CHECK-INST: bfmls z21.h, z10.h, z5.h[6] // CHECK-ENCODING: [0x55,0x0d,0x75,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64750d55 bfmls z23.h, z13.h, z0.h[5] // 01100100-01101000-00001101-10110111 // CHECK-INST: bfmls z23.h, z13.h, z0.h[5] // CHECK-ENCODING: [0xb7,0x0d,0x68,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64680db7 bfmls z31.h, z31.h, z7.h[7] // 01100100-01111111-00001111-11111111 // CHECK-INST: bfmls z31.h, z31.h, z7.h[7] // CHECK-ENCODING: [0xff,0x0f,0x7f,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 647f0fff @@ -50,7 +50,7 @@ bfmls z23.h, p3/m, z13.h, z8.h // 01100101-00101000-00101101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfmls z23.h, p3/m, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x2d,0x28,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65282db7 movprfx z23, z31 @@ -58,30 +58,30 @@ bfmls z23.h, p3/m, z13.h, z8.h // 01100101-00101000-00101101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfmls z23.h, p3/m, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x2d,0x28,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65282db7 bfmls z0.h, p0/m, z0.h, z0.h // 01100101-00100000-00100000-00000000 // CHECK-INST: bfmls z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x20,0x20,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65202000 bfmls z21.h, p5/m, z10.h, z21.h // 01100101-00110101-00110101-01010101 // CHECK-INST: bfmls z21.h, p5/m, z10.h, z21.h // CHECK-ENCODING: [0x55,0x35,0x35,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65353555 bfmls z23.h, p3/m, z13.h, z8.h // 01100101-00101000-00101101-10110111 // CHECK-INST: bfmls z23.h, p3/m, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x2d,0x28,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65282db7 bfmls z31.h, p7/m, z31.h, z31.h // 01100101-00111111-00111111-11111111 // CHECK-INST: bfmls z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x3f,0x3f,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 653f3fff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfmul.s b/llvm/test/MC/AArch64/SVE2p1/bfmul.s index e0b93bcbb1035..62e7d892468b6 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfmul.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfmul.s @@ -14,25 +14,25 @@ bfmul z0.h, z0.h, z0.h[0] // 01100100-00100000-00101000-00000000 // CHECK-INST: bfmul z0.h, z0.h, z0.h[0] // CHECK-ENCODING: [0x00,0x28,0x20,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64202800 bfmul z21.h, z10.h, z5.h[6] // 01100100-01110101-00101001-01010101 // CHECK-INST: bfmul z21.h, z10.h, z5.h[6] // CHECK-ENCODING: [0x55,0x29,0x75,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 64752955 bfmul z23.h, z13.h, z0.h[5] // 01100100-01101000-00101001-10110111 // CHECK-INST: bfmul z23.h, z13.h, z0.h[5] // CHECK-ENCODING: [0xb7,0x29,0x68,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 646829b7 bfmul z31.h, z31.h, z7.h[7] // 01100100-01111111-00101011-11111111 // CHECK-INST: bfmul z31.h, z31.h, z7.h[7] // CHECK-ENCODING: [0xff,0x2b,0x7f,0x64] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 647f2bff movprfx z23.h, p3/m, z31.h @@ -40,7 +40,7 @@ bfmul z23.h, p3/m, z23.h, z13.h // 01100101-00000010-10001101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfmul z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x02,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65028db7 movprfx z23, z31 @@ -48,54 +48,54 @@ bfmul z23.h, p3/m, z23.h, z13.h // 01100101-00000010-10001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfmul z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x02,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65028db7 bfmul z0.h, p0/m, z0.h, z0.h // 01100101-00000010-10000000-00000000 // CHECK-INST: bfmul z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x80,0x02,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65028000 bfmul z21.h, p5/m, z21.h, z10.h // 01100101-00000010-10010101-01010101 // CHECK-INST: bfmul z21.h, p5/m, z21.h, z10.h // CHECK-ENCODING: [0x55,0x95,0x02,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65029555 bfmul z23.h, p3/m, z23.h, z13.h // 01100101-00000010-10001101-10110111 // CHECK-INST: bfmul z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x02,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65028db7 bfmul z31.h, p7/m, z31.h, z31.h // 01100101-00000010-10011111-11111111 // CHECK-INST: bfmul z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x9f,0x02,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65029fff bfmul z0.h, z0.h, z0.h // 01100101-00000000-00001000-00000000 // CHECK-INST: bfmul z0.h, z0.h, z0.h // CHECK-ENCODING: [0x00,0x08,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65000800 bfmul z21.h, z10.h, z21.h // 01100101-00010101-00001001-01010101 // CHECK-INST: bfmul z21.h, z10.h, z21.h // CHECK-ENCODING: [0x55,0x09,0x15,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65150955 bfmul z23.h, z13.h, z8.h // 01100101-00001000-00001001-10110111 // CHECK-INST: bfmul z23.h, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x09,0x08,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 650809b7 bfmul z31.h, z31.h, z31.h // 01100101-00011111-00001011-11111111 // CHECK-INST: bfmul z31.h, z31.h, z31.h // CHECK-ENCODING: [0xff,0x0b,0x1f,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 651f0bff diff --git a/llvm/test/MC/AArch64/SVE2p1/bfsub.s b/llvm/test/MC/AArch64/SVE2p1/bfsub.s index 42cb6772c3a51..66590a72ed6b4 100644 --- a/llvm/test/MC/AArch64/SVE2p1/bfsub.s +++ b/llvm/test/MC/AArch64/SVE2p1/bfsub.s @@ -16,7 +16,7 @@ bfsub z23.h, p3/m, z23.h, z13.h // 01100101-00000001-10001101-10110111 // CHECK-INST: movprfx z23.h, p3/m, z31.h // CHECK-INST: bfsub z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x01,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65018db7 movprfx z23, z31 @@ -24,53 +24,53 @@ bfsub z23.h, p3/m, z23.h, z13.h // 01100101-00000001-10001101-10110111 // CHECK-INST: movprfx z23, z31 // CHECK-INST: bfsub z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x01,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65018db7 bfsub z0.h, p0/m, z0.h, z0.h // 01100101-00000001-10000000-00000000 // CHECK-INST: bfsub z0.h, p0/m, z0.h, z0.h // CHECK-ENCODING: [0x00,0x80,0x01,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65018000 bfsub z21.h, p5/m, z21.h, z10.h // 01100101-00000001-10010101-01010101 // CHECK-INST: bfsub z21.h, p5/m, z21.h, z10.h // CHECK-ENCODING: [0x55,0x95,0x01,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65019555 bfsub z23.h, p3/m, z23.h, z13.h // 01100101-00000001-10001101-10110111 // CHECK-INST: bfsub z23.h, p3/m, z23.h, z13.h // CHECK-ENCODING: [0xb7,0x8d,0x01,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65018db7 bfsub z31.h, p7/m, z31.h, z31.h // 01100101-00000001-10011111-11111111 // CHECK-INST: bfsub z31.h, p7/m, z31.h, z31.h // CHECK-ENCODING: [0xff,0x9f,0x01,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65019fff bfsub z0.h, z0.h, z0.h // 01100101-00000000-00000100-00000000 // CHECK-INST: bfsub z0.h, z0.h, z0.h // CHECK-ENCODING: [0x00,0x04,0x00,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65000400 bfsub z21.h, z10.h, z21.h // 01100101-00010101-00000101-01010101 // CHECK-INST: bfsub z21.h, z10.h, z21.h // CHECK-ENCODING: [0x55,0x05,0x15,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 65150555 bfsub z23.h, z13.h, z8.h // 01100101-00001000-00000101-10110111 // CHECK-INST: bfsub z23.h, z13.h, z8.h // CHECK-ENCODING: [0xb7,0x05,0x08,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 650805b7 bfsub z31.h, z31.h, z31.h // 01100101-00011111-00000111-11111111 // CHECK-INST: bfsub z31.h, z31.h, z31.h // CHECK-ENCODING: [0xff,0x07,0x1f,0x65] -// CHECK-ERROR: instruction requires: b16b16 sme2p1 or sve2p1 +// CHECK-ERROR: instruction requires: b16b16 sve2p1 // CHECK-UNKNOWN: 651f07ff diff --git a/llvm/test/MC/AArch64/SVE2p1/ld1d_q.s b/llvm/test/MC/AArch64/SVE2p1/ld1d_q.s index 12ecde8dc80f8..b25060f33ec63 100644 --- a/llvm/test/MC/AArch64/SVE2p1/ld1d_q.s +++ b/llvm/test/MC/AArch64/SVE2p1/ld1d_q.s @@ -5,7 +5,7 @@ // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p1 < %s \ // RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sve2p1 - | FileCheck %s --check-prefix=CHECK-INST // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p1 < %s \ -// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: | llvm-objdump -d --mattr=-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %s \ // RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ // RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p1 -disassemble -show-encoding \ diff --git a/llvm/test/MC/AArch64/SVE2p1/ld1w_q.s b/llvm/test/MC/AArch64/SVE2p1/ld1w_q.s index 9450ac5b0fe92..afdd3371d93c7 100644 --- a/llvm/test/MC/AArch64/SVE2p1/ld1w_q.s +++ b/llvm/test/MC/AArch64/SVE2p1/ld1w_q.s @@ -5,7 +5,7 @@ // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p1 < %s \ // RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sve2p1 - | FileCheck %s --check-prefix=CHECK-INST // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p1 < %s \ -// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: | llvm-objdump -d --mattr=-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %s \ // RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ // RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p1 -disassemble -show-encoding \ diff --git a/llvm/test/MC/AArch64/SVE2p1/st1d_q.s b/llvm/test/MC/AArch64/SVE2p1/st1d_q.s index 52d1f1635bf34..6d5aaf4ce3faa 100644 --- a/llvm/test/MC/AArch64/SVE2p1/st1d_q.s +++ b/llvm/test/MC/AArch64/SVE2p1/st1d_q.s @@ -5,7 +5,7 @@ // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p1 < %s \ // RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sve2p1 - | FileCheck %s --check-prefix=CHECK-INST // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p1 < %s \ -// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: | llvm-objdump -d --mattr=-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %s \ // RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ // RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p1 -disassemble -show-encoding \ diff --git a/llvm/test/MC/AArch64/SVE2p1/st1w_q.s b/llvm/test/MC/AArch64/SVE2p1/st1w_q.s index efb682692224e..2ac9b077c0e6d 100644 --- a/llvm/test/MC/AArch64/SVE2p1/st1w_q.s +++ b/llvm/test/MC/AArch64/SVE2p1/st1w_q.s @@ -5,7 +5,7 @@ // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p1 < %s \ // RUN: | llvm-objdump -d --no-print-imm-hex --mattr=+sve2p1 - | FileCheck %s --check-prefix=CHECK-INST // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve2p1 < %s \ -// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN +// RUN: | llvm-objdump -d --mattr=-sve2p1 - | FileCheck %s --check-prefix=CHECK-UNKNOWN // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2p1 < %s \ // RUN: | sed '/.text/d' | sed 's/.*encoding: //g' \ // RUN: | llvm-mc -triple=aarch64 -mattr=+sve2p1 -disassemble -show-encoding \