brintos

brintos / llvm-project-archived public Read only

0
0
Text · 12.0 KiB · 6fffcb6 Raw
206 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 52// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon -target-feature +fullfp16 -target-feature +v8.6a -target-feature +i8mm \3// RUN: -disable-O0-optnone -emit-llvm -o - %s \4// RUN: | opt -S -passes=mem2reg,sroa \5// RUN: | FileCheck %s6 7// REQUIRES: aarch64-registered-target8 9#include <arm_neon.h>10 11// CHECK-LABEL: define dso_local <4 x i32> @test_vmmlaq_s32(12// CHECK-SAME: <4 x i32> noundef [[R:%.*]], <16 x i8> noundef [[A:%.*]], <16 x i8> noundef [[B:%.*]]) #[[ATTR0:[0-9]+]] {13// CHECK-NEXT:  [[ENTRY:.*:]]14// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x i32> [[R]] to <16 x i8>15// CHECK-NEXT:    [[VMMLA_I:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>16// CHECK-NEXT:    [[VMMLA1_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.smmla.v4i32.v16i8(<4 x i32> [[VMMLA_I]], <16 x i8> [[A]], <16 x i8> [[B]])17// CHECK-NEXT:    ret <4 x i32> [[VMMLA1_I]]18//19int32x4_t test_vmmlaq_s32(int32x4_t r, int8x16_t a, int8x16_t b) {20  return vmmlaq_s32(r, a, b);21}22 23// CHECK-LABEL: define dso_local <4 x i32> @test_vmmlaq_u32(24// CHECK-SAME: <4 x i32> noundef [[R:%.*]], <16 x i8> noundef [[A:%.*]], <16 x i8> noundef [[B:%.*]]) #[[ATTR0]] {25// CHECK-NEXT:  [[ENTRY:.*:]]26// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x i32> [[R]] to <16 x i8>27// CHECK-NEXT:    [[VMMLA_I:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>28// CHECK-NEXT:    [[VMMLA1_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.ummla.v4i32.v16i8(<4 x i32> [[VMMLA_I]], <16 x i8> [[A]], <16 x i8> [[B]])29// CHECK-NEXT:    ret <4 x i32> [[VMMLA1_I]]30//31uint32x4_t test_vmmlaq_u32(uint32x4_t r, uint8x16_t a, uint8x16_t b) {32  return vmmlaq_u32(r, a, b);33}34 35// CHECK-LABEL: define dso_local <4 x i32> @test_vusmmlaq_s32(36// CHECK-SAME: <4 x i32> noundef [[R:%.*]], <16 x i8> noundef [[A:%.*]], <16 x i8> noundef [[B:%.*]]) #[[ATTR0]] {37// CHECK-NEXT:  [[ENTRY:.*:]]38// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x i32> [[R]] to <16 x i8>39// CHECK-NEXT:    [[VUSMMLA_I:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>40// CHECK-NEXT:    [[VUSMMLA1_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.usmmla.v4i32.v16i8(<4 x i32> [[VUSMMLA_I]], <16 x i8> [[A]], <16 x i8> [[B]])41// CHECK-NEXT:    ret <4 x i32> [[VUSMMLA1_I]]42//43int32x4_t test_vusmmlaq_s32(int32x4_t r, uint8x16_t a, int8x16_t b) {44  return vusmmlaq_s32(r, a, b);45}46 47// CHECK-LABEL: define dso_local <2 x i32> @test_vusdot_s32(48// CHECK-SAME: <2 x i32> noundef [[R:%.*]], <8 x i8> noundef [[A:%.*]], <8 x i8> noundef [[B:%.*]]) #[[ATTR0]] {49// CHECK-NEXT:  [[ENTRY:.*:]]50// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <2 x i32> [[R]] to <8 x i8>51// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32>52// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <2 x i32> @llvm.aarch64.neon.usdot.v2i32.v8i8(<2 x i32> [[VUSDOT_I]], <8 x i8> [[A]], <8 x i8> [[B]])53// CHECK-NEXT:    ret <2 x i32> [[VUSDOT1_I]]54//55int32x2_t test_vusdot_s32(int32x2_t r, uint8x8_t a, int8x8_t b) {56  return vusdot_s32(r, a, b);57}58 59// CHECK-LABEL: define dso_local <2 x i32> @test_vusdot_lane_s32(60// CHECK-SAME: <2 x i32> noundef [[R:%.*]], <8 x i8> noundef [[A:%.*]], <8 x i8> noundef [[B:%.*]]) #[[ATTR0]] {61// CHECK-NEXT:  [[ENTRY:.*:]]62// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x i8> [[B]] to <2 x i32>63// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>64// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x i32>65// CHECK-NEXT:    [[LANE:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> [[TMP2]], <2 x i32> zeroinitializer66// CHECK-NEXT:    [[TMP3:%.*]] = bitcast <2 x i32> [[LANE]] to <8 x i8>67// CHECK-NEXT:    [[TMP4:%.*]] = bitcast <2 x i32> [[R]] to <8 x i8>68// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <8 x i8> [[TMP4]] to <2 x i32>69// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <2 x i32> @llvm.aarch64.neon.usdot.v2i32.v8i8(<2 x i32> [[VUSDOT_I]], <8 x i8> [[A]], <8 x i8> [[TMP3]])70// CHECK-NEXT:    ret <2 x i32> [[VUSDOT1_I]]71//72int32x2_t test_vusdot_lane_s32(int32x2_t r, uint8x8_t a, int8x8_t b) {73  return vusdot_lane_s32(r, a, b, 0);74}75 76// CHECK-LABEL: define dso_local <2 x i32> @test_vsudot_lane_s32(77// CHECK-SAME: <2 x i32> noundef [[R:%.*]], <8 x i8> noundef [[A:%.*]], <8 x i8> noundef [[B:%.*]]) #[[ATTR0]] {78// CHECK-NEXT:  [[ENTRY:.*:]]79// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x i8> [[B]] to <2 x i32>80// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>81// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x i32>82// CHECK-NEXT:    [[LANE:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> [[TMP2]], <2 x i32> zeroinitializer83// CHECK-NEXT:    [[TMP3:%.*]] = bitcast <2 x i32> [[LANE]] to <8 x i8>84// CHECK-NEXT:    [[TMP4:%.*]] = bitcast <2 x i32> [[R]] to <8 x i8>85// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <8 x i8> [[TMP4]] to <2 x i32>86// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <2 x i32> @llvm.aarch64.neon.usdot.v2i32.v8i8(<2 x i32> [[VUSDOT_I]], <8 x i8> [[TMP3]], <8 x i8> [[A]])87// CHECK-NEXT:    ret <2 x i32> [[VUSDOT1_I]]88//89int32x2_t test_vsudot_lane_s32(int32x2_t r, int8x8_t a, uint8x8_t b) {90  return vsudot_lane_s32(r, a, b, 0);91}92 93// CHECK-LABEL: define dso_local <2 x i32> @test_vusdot_laneq_s32(94// CHECK-SAME: <2 x i32> noundef [[R:%.*]], <8 x i8> noundef [[A:%.*]], <16 x i8> noundef [[B:%.*]]) #[[ATTR0]] {95// CHECK-NEXT:  [[ENTRY:.*:]]96// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <16 x i8> [[B]] to <4 x i32>97// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>98// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x i32>99// CHECK-NEXT:    [[LANE:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP2]], <2 x i32> zeroinitializer100// CHECK-NEXT:    [[TMP3:%.*]] = bitcast <2 x i32> [[LANE]] to <8 x i8>101// CHECK-NEXT:    [[TMP4:%.*]] = bitcast <2 x i32> [[R]] to <8 x i8>102// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <8 x i8> [[TMP4]] to <2 x i32>103// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <2 x i32> @llvm.aarch64.neon.usdot.v2i32.v8i8(<2 x i32> [[VUSDOT_I]], <8 x i8> [[A]], <8 x i8> [[TMP3]])104// CHECK-NEXT:    ret <2 x i32> [[VUSDOT1_I]]105//106int32x2_t test_vusdot_laneq_s32(int32x2_t r, uint8x8_t a, int8x16_t b) {107  return vusdot_laneq_s32(r, a, b, 0);108}109 110// CHECK-LABEL: define dso_local <2 x i32> @test_vsudot_laneq_s32(111// CHECK-SAME: <2 x i32> noundef [[R:%.*]], <8 x i8> noundef [[A:%.*]], <16 x i8> noundef [[B:%.*]]) #[[ATTR0]] {112// CHECK-NEXT:  [[ENTRY:.*:]]113// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <16 x i8> [[B]] to <4 x i32>114// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>115// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x i32>116// CHECK-NEXT:    [[LANE:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP2]], <2 x i32> zeroinitializer117// CHECK-NEXT:    [[TMP3:%.*]] = bitcast <2 x i32> [[LANE]] to <8 x i8>118// CHECK-NEXT:    [[TMP4:%.*]] = bitcast <2 x i32> [[R]] to <8 x i8>119// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <8 x i8> [[TMP4]] to <2 x i32>120// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <2 x i32> @llvm.aarch64.neon.usdot.v2i32.v8i8(<2 x i32> [[VUSDOT_I]], <8 x i8> [[TMP3]], <8 x i8> [[A]])121// CHECK-NEXT:    ret <2 x i32> [[VUSDOT1_I]]122//123int32x2_t test_vsudot_laneq_s32(int32x2_t r, int8x8_t a, uint8x16_t b) {124  return vsudot_laneq_s32(r, a, b, 0);125}126 127// CHECK-LABEL: define dso_local <4 x i32> @test_vusdotq_s32(128// CHECK-SAME: <4 x i32> noundef [[R:%.*]], <16 x i8> noundef [[A:%.*]], <16 x i8> noundef [[B:%.*]]) #[[ATTR0]] {129// CHECK-NEXT:  [[ENTRY:.*:]]130// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <4 x i32> [[R]] to <16 x i8>131// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32>132// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.usdot.v4i32.v16i8(<4 x i32> [[VUSDOT_I]], <16 x i8> [[A]], <16 x i8> [[B]])133// CHECK-NEXT:    ret <4 x i32> [[VUSDOT1_I]]134//135int32x4_t test_vusdotq_s32(int32x4_t r, uint8x16_t a, int8x16_t b) {136  return vusdotq_s32(r, a, b);137}138 139// CHECK-LABEL: define dso_local <4 x i32> @test_vusdotq_lane_s32(140// CHECK-SAME: <4 x i32> noundef [[R:%.*]], <16 x i8> noundef [[A:%.*]], <8 x i8> noundef [[B:%.*]]) #[[ATTR0]] {141// CHECK-NEXT:  [[ENTRY:.*:]]142// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x i8> [[B]] to <2 x i32>143// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>144// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x i32>145// CHECK-NEXT:    [[LANE:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> [[TMP2]], <4 x i32> zeroinitializer146// CHECK-NEXT:    [[TMP3:%.*]] = bitcast <4 x i32> [[LANE]] to <16 x i8>147// CHECK-NEXT:    [[TMP4:%.*]] = bitcast <4 x i32> [[R]] to <16 x i8>148// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <16 x i8> [[TMP4]] to <4 x i32>149// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.usdot.v4i32.v16i8(<4 x i32> [[VUSDOT_I]], <16 x i8> [[A]], <16 x i8> [[TMP3]])150// CHECK-NEXT:    ret <4 x i32> [[VUSDOT1_I]]151//152int32x4_t test_vusdotq_lane_s32(int32x4_t r, uint8x16_t a, int8x8_t b) {153  return vusdotq_lane_s32(r, a, b, 0);154}155 156// CHECK-LABEL: define dso_local <4 x i32> @test_vsudotq_lane_s32(157// CHECK-SAME: <4 x i32> noundef [[R:%.*]], <16 x i8> noundef [[A:%.*]], <8 x i8> noundef [[B:%.*]]) #[[ATTR0]] {158// CHECK-NEXT:  [[ENTRY:.*:]]159// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <8 x i8> [[B]] to <2 x i32>160// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <2 x i32> [[TMP0]] to <8 x i8>161// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <8 x i8> [[TMP1]] to <2 x i32>162// CHECK-NEXT:    [[LANE:%.*]] = shufflevector <2 x i32> [[TMP2]], <2 x i32> [[TMP2]], <4 x i32> zeroinitializer163// CHECK-NEXT:    [[TMP3:%.*]] = bitcast <4 x i32> [[LANE]] to <16 x i8>164// CHECK-NEXT:    [[TMP4:%.*]] = bitcast <4 x i32> [[R]] to <16 x i8>165// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <16 x i8> [[TMP4]] to <4 x i32>166// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.usdot.v4i32.v16i8(<4 x i32> [[VUSDOT_I]], <16 x i8> [[TMP3]], <16 x i8> [[A]])167// CHECK-NEXT:    ret <4 x i32> [[VUSDOT1_I]]168//169int32x4_t test_vsudotq_lane_s32(int32x4_t r, int8x16_t a, uint8x8_t b) {170  return vsudotq_lane_s32(r, a, b, 0);171}172 173// CHECK-LABEL: define dso_local <4 x i32> @test_vusdotq_laneq_s32(174// CHECK-SAME: <4 x i32> noundef [[R:%.*]], <16 x i8> noundef [[A:%.*]], <16 x i8> noundef [[B:%.*]]) #[[ATTR0]] {175// CHECK-NEXT:  [[ENTRY:.*:]]176// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <16 x i8> [[B]] to <4 x i32>177// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>178// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x i32>179// CHECK-NEXT:    [[LANE:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP2]], <4 x i32> zeroinitializer180// CHECK-NEXT:    [[TMP3:%.*]] = bitcast <4 x i32> [[LANE]] to <16 x i8>181// CHECK-NEXT:    [[TMP4:%.*]] = bitcast <4 x i32> [[R]] to <16 x i8>182// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <16 x i8> [[TMP4]] to <4 x i32>183// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.usdot.v4i32.v16i8(<4 x i32> [[VUSDOT_I]], <16 x i8> [[A]], <16 x i8> [[TMP3]])184// CHECK-NEXT:    ret <4 x i32> [[VUSDOT1_I]]185//186int32x4_t test_vusdotq_laneq_s32(int32x4_t r, uint8x16_t a, int8x16_t b) {187  return vusdotq_laneq_s32(r, a, b, 0);188}189 190// CHECK-LABEL: define dso_local <4 x i32> @test_vsudotq_laneq_s32(191// CHECK-SAME: <4 x i32> noundef [[R:%.*]], <16 x i8> noundef [[A:%.*]], <16 x i8> noundef [[B:%.*]]) #[[ATTR0]] {192// CHECK-NEXT:  [[ENTRY:.*:]]193// CHECK-NEXT:    [[TMP0:%.*]] = bitcast <16 x i8> [[B]] to <4 x i32>194// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <4 x i32> [[TMP0]] to <16 x i8>195// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <16 x i8> [[TMP1]] to <4 x i32>196// CHECK-NEXT:    [[LANE:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP2]], <4 x i32> zeroinitializer197// CHECK-NEXT:    [[TMP3:%.*]] = bitcast <4 x i32> [[LANE]] to <16 x i8>198// CHECK-NEXT:    [[TMP4:%.*]] = bitcast <4 x i32> [[R]] to <16 x i8>199// CHECK-NEXT:    [[VUSDOT_I:%.*]] = bitcast <16 x i8> [[TMP4]] to <4 x i32>200// CHECK-NEXT:    [[VUSDOT1_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.usdot.v4i32.v16i8(<4 x i32> [[VUSDOT_I]], <16 x i8> [[TMP3]], <16 x i8> [[A]])201// CHECK-NEXT:    ret <4 x i32> [[VUSDOT1_I]]202//203int32x4_t test_vsudotq_laneq_s32(int32x4_t r, int8x16_t a, uint8x16_t b) {204  return vsudotq_laneq_s32(r, a, b, 0);205}206