|
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 |
| 2 | + |
| 3 | +// REQUIRES: arm-registered-target |
| 4 | + |
| 5 | +// RUN: %clang_cc1 -triple armv8a-arm-none-eabihf -target-cpu generic -emit-llvm -o - %s -disable-O0-optnone | \ |
| 6 | +// RUN: opt -S -passes=instcombine -o - | FileCheck %s --check-prefix=LE |
| 7 | +// RUN: %clang_cc1 -triple armebv8a-arm-none-eabihf -target-cpu generic -emit-llvm -o - %s -disable-O0-optnone | \ |
| 8 | +// RUN: opt -S -passes=instcombine -o - | FileCheck %s --check-prefix=BE |
| 9 | + |
| 10 | +#include <arm_neon.h> |
| 11 | + |
| 12 | +// LE-LABEL: define dso_local i32 @int32x4_t_lane_0( |
| 13 | +// LE-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] { |
| 14 | +// LE-NEXT: [[ENTRY:.*:]] |
| 15 | +// LE-NEXT: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[A]], i64 0 |
| 16 | +// LE-NEXT: ret i32 [[VGET_LANE]] |
| 17 | +// |
| 18 | +// BE-LABEL: define dso_local i32 @int32x4_t_lane_0( |
| 19 | +// BE-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0:[0-9]+]] { |
| 20 | +// BE-NEXT: [[ENTRY:.*:]] |
| 21 | +// BE-NEXT: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[A]], i64 1 |
| 22 | +// BE-NEXT: ret i32 [[VGET_LANE]] |
| 23 | +// |
| 24 | +int int32x4_t_lane_0(int32x4_t a) { return vgetq_lane_s32(a, 0); } |
| 25 | +// LE-LABEL: define dso_local i32 @int32x4_t_lane_1( |
| 26 | +// LE-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 27 | +// LE-NEXT: [[ENTRY:.*:]] |
| 28 | +// LE-NEXT: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[A]], i64 1 |
| 29 | +// LE-NEXT: ret i32 [[VGET_LANE]] |
| 30 | +// |
| 31 | +// BE-LABEL: define dso_local i32 @int32x4_t_lane_1( |
| 32 | +// BE-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 33 | +// BE-NEXT: [[ENTRY:.*:]] |
| 34 | +// BE-NEXT: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[A]], i64 0 |
| 35 | +// BE-NEXT: ret i32 [[VGET_LANE]] |
| 36 | +// |
| 37 | +int int32x4_t_lane_1(int32x4_t a) { return vgetq_lane_s32(a, 1); } |
| 38 | +// LE-LABEL: define dso_local i32 @int32x4_t_lane_2( |
| 39 | +// LE-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 40 | +// LE-NEXT: [[ENTRY:.*:]] |
| 41 | +// LE-NEXT: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[A]], i64 2 |
| 42 | +// LE-NEXT: ret i32 [[VGET_LANE]] |
| 43 | +// |
| 44 | +// BE-LABEL: define dso_local i32 @int32x4_t_lane_2( |
| 45 | +// BE-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 46 | +// BE-NEXT: [[ENTRY:.*:]] |
| 47 | +// BE-NEXT: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[A]], i64 3 |
| 48 | +// BE-NEXT: ret i32 [[VGET_LANE]] |
| 49 | +// |
| 50 | +int int32x4_t_lane_2(int32x4_t a) { return vgetq_lane_s32(a, 2); } |
| 51 | +// LE-LABEL: define dso_local i32 @int32x4_t_lane_3( |
| 52 | +// LE-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 53 | +// LE-NEXT: [[ENTRY:.*:]] |
| 54 | +// LE-NEXT: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[A]], i64 3 |
| 55 | +// LE-NEXT: ret i32 [[VGET_LANE]] |
| 56 | +// |
| 57 | +// BE-LABEL: define dso_local i32 @int32x4_t_lane_3( |
| 58 | +// BE-SAME: <4 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 59 | +// BE-NEXT: [[ENTRY:.*:]] |
| 60 | +// BE-NEXT: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[A]], i64 2 |
| 61 | +// BE-NEXT: ret i32 [[VGET_LANE]] |
| 62 | +// |
| 63 | +int int32x4_t_lane_3(int32x4_t a) { return vgetq_lane_s32(a, 3); } |
| 64 | +// LE-LABEL: define dso_local i32 @int32x2_t_lane_0( |
| 65 | +// LE-SAME: <2 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 66 | +// LE-NEXT: [[ENTRY:.*:]] |
| 67 | +// LE-NEXT: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[A]], i64 0 |
| 68 | +// LE-NEXT: ret i32 [[VGET_LANE]] |
| 69 | +// |
| 70 | +// BE-LABEL: define dso_local i32 @int32x2_t_lane_0( |
| 71 | +// BE-SAME: <2 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 72 | +// BE-NEXT: [[ENTRY:.*:]] |
| 73 | +// BE-NEXT: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[A]], i64 1 |
| 74 | +// BE-NEXT: ret i32 [[VGET_LANE]] |
| 75 | +// |
| 76 | +int int32x2_t_lane_0(int32x2_t a) { return vget_lane_s32(a, 0); } |
| 77 | +// LE-LABEL: define dso_local i32 @int32x2_t_lane_1( |
| 78 | +// LE-SAME: <2 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 79 | +// LE-NEXT: [[ENTRY:.*:]] |
| 80 | +// LE-NEXT: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[A]], i64 1 |
| 81 | +// LE-NEXT: ret i32 [[VGET_LANE]] |
| 82 | +// |
| 83 | +// BE-LABEL: define dso_local i32 @int32x2_t_lane_1( |
| 84 | +// BE-SAME: <2 x i32> noundef [[A:%.*]]) #[[ATTR0]] { |
| 85 | +// BE-NEXT: [[ENTRY:.*:]] |
| 86 | +// BE-NEXT: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[A]], i64 0 |
| 87 | +// BE-NEXT: ret i32 [[VGET_LANE]] |
| 88 | +// |
| 89 | +int int32x2_t_lane_1(int32x2_t a) { return vget_lane_s32(a, 1); } |
| 90 | +// LE-LABEL: define dso_local i64 @int64x2_t_lane_0( |
| 91 | +// LE-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] { |
| 92 | +// LE-NEXT: [[ENTRY:.*:]] |
| 93 | +// LE-NEXT: [[VGET_LANE:%.*]] = extractelement <2 x i64> [[A]], i64 0 |
| 94 | +// LE-NEXT: ret i64 [[VGET_LANE]] |
| 95 | +// |
| 96 | +// BE-LABEL: define dso_local i64 @int64x2_t_lane_0( |
| 97 | +// BE-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] { |
| 98 | +// BE-NEXT: [[ENTRY:.*:]] |
| 99 | +// BE-NEXT: [[VGET_LANE:%.*]] = extractelement <2 x i64> [[A]], i64 0 |
| 100 | +// BE-NEXT: ret i64 [[VGET_LANE]] |
| 101 | +// |
| 102 | +int64_t int64x2_t_lane_0(int64x2_t a) { return vgetq_lane_s64(a, 0); } |
| 103 | +// LE-LABEL: define dso_local i64 @int64x2_t_lane_1( |
| 104 | +// LE-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] { |
| 105 | +// LE-NEXT: [[ENTRY:.*:]] |
| 106 | +// LE-NEXT: [[VGET_LANE:%.*]] = extractelement <2 x i64> [[A]], i64 1 |
| 107 | +// LE-NEXT: ret i64 [[VGET_LANE]] |
| 108 | +// |
| 109 | +// BE-LABEL: define dso_local i64 @int64x2_t_lane_1( |
| 110 | +// BE-SAME: <2 x i64> noundef [[A:%.*]]) #[[ATTR0]] { |
| 111 | +// BE-NEXT: [[ENTRY:.*:]] |
| 112 | +// BE-NEXT: [[VGET_LANE:%.*]] = extractelement <2 x i64> [[A]], i64 1 |
| 113 | +// BE-NEXT: ret i64 [[VGET_LANE]] |
| 114 | +// |
| 115 | +int64_t int64x2_t_lane_1(int64x2_t a) { return vgetq_lane_s64(a, 1); } |
0 commit comments