1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc < %s -mtriple=aarch64--linux-gnu | FileCheck %s
define <8 x i8> @sel_v8i8(<8 x i8> %v0, <8 x i8> %v1) {
; CHECK-LABEL: sel_v8i8:
; CHECK: // %bb.0:
; CHECK-NEXT: movi d2, #0xff00ff00ff00ff
; CHECK-NEXT: bif v0.8b, v1.8b, v2.8b
; CHECK-NEXT: ret
%tmp0 = shufflevector <8 x i8> %v0, <8 x i8> %v1, <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
ret <8 x i8> %tmp0
}
define <16 x i8> @sel_v16i8(<16 x i8> %v0, <16 x i8> %v1) {
; CHECK-LABEL: sel_v16i8:
; CHECK: // %bb.0:
; CHECK-NEXT: movi v2.2d, #0xff00ff00ff00ff
; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
; CHECK-NEXT: ret
%tmp0 = shufflevector <16 x i8> %v0, <16 x i8> %v1, <16 x i32> <i32 0, i32 17, i32 2, i32 19, i32 4, i32 21, i32 6, i32 23, i32 8, i32 25, i32 10, i32 27, i32 12, i32 29, i32 14, i32 31>
ret <16 x i8> %tmp0
}
define <16 x i8> @sel_v16i8_poison(<16 x i8> %v0, <16 x i8> %v1) {
; CHECK-LABEL: sel_v16i8_poison:
; CHECK: // %bb.0:
; CHECK-NEXT: adrp x8, .LCPI2_0
; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI2_0]
; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
; CHECK-NEXT: ret
%tmp0 = shufflevector <16 x i8> %v0, <16 x i8> %v1, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 22, i32 23, i32 24, i32 25, i32 26, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
ret <16 x i8> %tmp0
}
define <16 x i8> @sel_v16i8_unregular(<16 x i8> %v0, <16 x i8> %v1) {
; CHECK-LABEL: sel_v16i8_unregular:
; CHECK: // %bb.0:
; CHECK-NEXT: adrp x8, .LCPI3_0
; CHECK-NEXT: ldr q2, [x8, :lo12:.LCPI3_0]
; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
; CHECK-NEXT: ret
%tmp0 = shufflevector <16 x i8> %v0, <16 x i8> %v1, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 27, i32 28, i32 29, i32 30, i32 31>
ret <16 x i8> %tmp0
}
define <4 x i16> @sel_v4i16(<4 x i16> %v0, <4 x i16> %v1) {
; CHECK-LABEL: sel_v4i16:
; CHECK: // %bb.0:
; CHECK-NEXT: rev32 v0.4h, v0.4h
; CHECK-NEXT: trn2 v0.4h, v0.4h, v1.4h
; CHECK-NEXT: ret
%tmp0 = shufflevector <4 x i16> %v0, <4 x i16> %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
ret <4 x i16> %tmp0
}
define <8 x i16> @sel_v8i16(<8 x i16> %v0, <8 x i16> %v1) {
; CHECK-LABEL: sel_v8i16:
; CHECK: // %bb.0:
; CHECK-NEXT: movi v2.2d, #0x00ffff0000ffff
; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
; CHECK-NEXT: ret
%tmp0 = shufflevector <8 x i16> %v0, <8 x i16> %v1, <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
ret <8 x i16> %tmp0
}
define <2 x i32> @sel_v2i32(<2 x i32> %v0, <2 x i32> %v1) {
; CHECK-LABEL: sel_v2i32:
; CHECK: // %bb.0:
; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
; CHECK-NEXT: mov v0.s[1], v1.s[1]
; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
; CHECK-NEXT: ret
%tmp0 = shufflevector <2 x i32> %v0, <2 x i32> %v1, <2 x i32> <i32 0, i32 3>
ret <2 x i32> %tmp0
}
define <4 x i32> @sel_v4i32(<4 x i32> %v0, <4 x i32> %v1) {
; CHECK-LABEL: sel_v4i32:
; CHECK: // %bb.0:
; CHECK-NEXT: rev64 v0.4s, v0.4s
; CHECK-NEXT: trn2 v0.4s, v0.4s, v1.4s
; CHECK-NEXT: ret
%tmp0 = shufflevector <4 x i32> %v0, <4 x i32> %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
ret <4 x i32> %tmp0
}
define <2 x i64> @sel_v2i64(<2 x i64> %v0, <2 x i64> %v1) {
; CHECK-LABEL: sel_v2i64:
; CHECK: // %bb.0:
; CHECK-NEXT: mov v0.d[1], v1.d[1]
; CHECK-NEXT: ret
%tmp0 = shufflevector <2 x i64> %v0, <2 x i64> %v1, <2 x i32> <i32 0, i32 3>
ret <2 x i64> %tmp0
}
define <4 x half> @sel_v4f16(<4 x half> %v0, <4 x half> %v1) {
; CHECK-LABEL: sel_v4f16:
; CHECK: // %bb.0:
; CHECK-NEXT: rev32 v0.4h, v0.4h
; CHECK-NEXT: trn2 v0.4h, v0.4h, v1.4h
; CHECK-NEXT: ret
%tmp0 = shufflevector <4 x half> %v0, <4 x half> %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
ret <4 x half> %tmp0
}
define <8 x half> @sel_v8f16(<8 x half> %v0, <8 x half> %v1) {
; CHECK-LABEL: sel_v8f16:
; CHECK: // %bb.0:
; CHECK-NEXT: movi v2.2d, #0x00ffff0000ffff
; CHECK-NEXT: bif v0.16b, v1.16b, v2.16b
; CHECK-NEXT: ret
%tmp0 = shufflevector <8 x half> %v0, <8 x half> %v1, <8 x i32> <i32 0, i32 9, i32 2, i32 11, i32 4, i32 13, i32 6, i32 15>
ret <8 x half> %tmp0
}
define <2 x float> @sel_v2f32(<2 x float> %v0, <2 x float> %v1) {
; CHECK-LABEL: sel_v2f32:
; CHECK: // %bb.0:
; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
; CHECK-NEXT: // kill: def $d1 killed $d1 def $q1
; CHECK-NEXT: mov v0.s[1], v1.s[1]
; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
; CHECK-NEXT: ret
%tmp0 = shufflevector <2 x float> %v0, <2 x float> %v1, <2 x i32> <i32 0, i32 3>
ret <2 x float> %tmp0
}
define <4 x float> @sel_v4f32(<4 x float> %v0, <4 x float> %v1) {
; CHECK-LABEL: sel_v4f32:
; CHECK: // %bb.0:
; CHECK-NEXT: rev64 v0.4s, v0.4s
; CHECK-NEXT: trn2 v0.4s, v0.4s, v1.4s
; CHECK-NEXT: ret
%tmp0 = shufflevector <4 x float> %v0, <4 x float> %v1, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
ret <4 x float> %tmp0
}
define <2 x double> @sel_v2f64(<2 x double> %v0, <2 x double> %v1) {
; CHECK-LABEL: sel_v2f64:
; CHECK: // %bb.0:
; CHECK-NEXT: mov v0.d[1], v1.d[1]
; CHECK-NEXT: ret
%tmp0 = shufflevector <2 x double> %v0, <2 x double> %v1, <2 x i32> <i32 0, i32 3>
ret <2 x double> %tmp0
}
|