|
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 | +// REQUIRES: aarch64-registered-target |
| 3 | +// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2p3 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s |
| 4 | +// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2p3 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK |
| 5 | +// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2p3 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s |
| 6 | +// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2p3 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 7 | +// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2p3 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 8 | + |
| 9 | +#include <arm_sve.h> |
| 10 | + |
| 11 | +#if defined(__ARM_FEATURE_SME) |
| 12 | +#define ATTR __arm_streaming |
| 13 | +#else |
| 14 | +#define ATTR |
| 15 | +#endif |
| 16 | + |
| 17 | +#ifdef SVE_OVERLOADED_FORMS |
| 18 | +// A simple used,unused... macro, long enough to represent any SVE builtin. |
| 19 | +#define SVE_ACLE_FUNC(A1,A2_UNUSED) A1 |
| 20 | +#else |
| 21 | +#define SVE_ACLE_FUNC(A1,A2) A1##A2 |
| 22 | +#endif |
| 23 | + |
| 24 | +// CHECK-LABEL: @test_svdot_s16_x2( |
| 25 | +// CHECK-NEXT: entry: |
| 26 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sdot.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[OP3:%.*]]) |
| 27 | +// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 28 | +// |
| 29 | +// CPP-CHECK-LABEL: @_Z17test_svdot_s16_x2u11__SVInt16_tu10__SVInt8_tS0_( |
| 30 | +// CPP-CHECK-NEXT: entry: |
| 31 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sdot.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[OP3:%.*]]) |
| 32 | +// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 33 | +// |
| 34 | +svint16_t test_svdot_s16_x2(svint16_t op1, svint8_t op2, svint8_t op3) ATTR |
| 35 | +{ |
| 36 | + return SVE_ACLE_FUNC(svdot,_s16_s8)(op1, op2, op3); |
| 37 | +} |
| 38 | + |
| 39 | +// CHECK-LABEL: @test_svdot_u16_x2( |
| 40 | +// CHECK-NEXT: entry: |
| 41 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.udot.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[OP3:%.*]]) |
| 42 | +// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 43 | +// |
| 44 | +// CPP-CHECK-LABEL: @_Z17test_svdot_u16_x2u12__SVUint16_tu11__SVUint8_tS0_( |
| 45 | +// CPP-CHECK-NEXT: entry: |
| 46 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.udot.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[OP3:%.*]]) |
| 47 | +// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 48 | +// |
| 49 | +svuint16_t test_svdot_u16_x2(svuint16_t op1, svuint8_t op2, svuint8_t op3) ATTR |
| 50 | +{ |
| 51 | + return SVE_ACLE_FUNC(svdot,_u16_u8)(op1, op2, op3); |
| 52 | +} |
| 53 | + |
| 54 | +// CHECK-LABEL: @test_svdot_n_s16_x2( |
| 55 | +// CHECK-NEXT: entry: |
| 56 | +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP3:%.*]], i64 0 |
| 57 | +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer |
| 58 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sdot.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[DOTSPLAT]]) |
| 59 | +// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 60 | +// |
| 61 | +// CPP-CHECK-LABEL: @_Z19test_svdot_n_s16_x2u11__SVInt16_tu10__SVInt8_ta( |
| 62 | +// CPP-CHECK-NEXT: entry: |
| 63 | +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP3:%.*]], i64 0 |
| 64 | +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer |
| 65 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sdot.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[DOTSPLAT]]) |
| 66 | +// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 67 | +// |
| 68 | +svint16_t test_svdot_n_s16_x2(svint16_t op1, svint8_t op2, int8_t op3) ATTR |
| 69 | +{ |
| 70 | + return SVE_ACLE_FUNC(svdot,_n_s16_s8)(op1, op2, op3); |
| 71 | +} |
| 72 | + |
| 73 | +// CHECK-LABEL: @test_svdot_n_u16_x2( |
| 74 | +// CHECK-NEXT: entry: |
| 75 | +// CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP3:%.*]], i64 0 |
| 76 | +// CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer |
| 77 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.udot.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[DOTSPLAT]]) |
| 78 | +// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 79 | +// |
| 80 | +// CPP-CHECK-LABEL: @_Z19test_svdot_n_u16_x2u12__SVUint16_tu11__SVUint8_th( |
| 81 | +// CPP-CHECK-NEXT: entry: |
| 82 | +// CPP-CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 16 x i8> poison, i8 [[OP3:%.*]], i64 0 |
| 83 | +// CPP-CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 16 x i8> [[DOTSPLATINSERT]], <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer |
| 84 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.udot.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[DOTSPLAT]]) |
| 85 | +// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 86 | +// |
| 87 | +svuint16_t test_svdot_n_u16_x2(svuint16_t op1, svuint8_t op2, uint8_t op3) ATTR |
| 88 | +{ |
| 89 | + return SVE_ACLE_FUNC(svdot,_n_u16_u8)(op1, op2, op3); |
| 90 | +} |
| 91 | + |
| 92 | +// CHECK-LABEL: @test_svdot_lane_s16_x2( |
| 93 | +// CHECK-NEXT: entry: |
| 94 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sdot.lane.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[OP3:%.*]], i32 7) |
| 95 | +// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 96 | +// |
| 97 | +// CPP-CHECK-LABEL: @_Z22test_svdot_lane_s16_x2u11__SVInt16_tu10__SVInt8_tS0_( |
| 98 | +// CPP-CHECK-NEXT: entry: |
| 99 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.sdot.lane.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[OP3:%.*]], i32 7) |
| 100 | +// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 101 | +// |
| 102 | +svint16_t test_svdot_lane_s16_x2(svint16_t op1, svint8_t op2, svint8_t op3) ATTR |
| 103 | +{ |
| 104 | + return SVE_ACLE_FUNC(svdot_lane,_s16_s8)(op1, op2, op3, 7); |
| 105 | +} |
| 106 | + |
| 107 | +// CHECK-LABEL: @test_svdot_lane_u16_x2( |
| 108 | +// CHECK-NEXT: entry: |
| 109 | +// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.udot.lane.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[OP3:%.*]], i32 7) |
| 110 | +// CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 111 | +// |
| 112 | +// CPP-CHECK-LABEL: @_Z22test_svdot_lane_u16_x2u12__SVUint16_tu11__SVUint8_tS0_( |
| 113 | +// CPP-CHECK-NEXT: entry: |
| 114 | +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.udot.lane.x2.nxv8i16(<vscale x 8 x i16> [[OP1:%.*]], <vscale x 16 x i8> [[OP2:%.*]], <vscale x 16 x i8> [[OP3:%.*]], i32 7) |
| 115 | +// CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 116 | +// |
| 117 | +svuint16_t test_svdot_lane_u16_x2(svuint16_t op1, svuint8_t op2, svuint8_t op3) ATTR |
| 118 | +{ |
| 119 | + return SVE_ACLE_FUNC(svdot_lane,_u16_u8)(op1, op2, op3, 7); |
| 120 | +} |
0 commit comments