1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=aarch64--linux-gnu | FileCheck %s 3 4define <16 x i32> @test_shuf1(<16 x i32> %x, <16 x i32> %y) { 5; CHECK-LABEL: test_shuf1: 6; CHECK: // %bb.0: 7; CHECK-NEXT: dup v3.4s, v4.s[0] 8; CHECK-NEXT: ext v5.16b, v6.16b, v1.16b, #4 9; CHECK-NEXT: uzp1 v16.4s, v1.4s, v0.4s 10; CHECK-NEXT: uzp2 v17.4s, v2.4s, v4.4s 11; CHECK-NEXT: mov v3.s[0], v6.s[3] 12; CHECK-NEXT: trn2 v4.4s, v1.4s, v5.4s 13; CHECK-NEXT: trn2 v1.4s, v16.4s, v1.4s 14; CHECK-NEXT: trn1 v2.4s, v17.4s, v2.4s 15; CHECK-NEXT: mov v3.s[2], v7.s[3] 16; CHECK-NEXT: mov v4.s[0], v7.s[1] 17; CHECK-NEXT: ext v1.16b, v0.16b, v1.16b, #12 18; CHECK-NEXT: mov v2.s[3], v7.s[0] 19; CHECK-NEXT: mov v3.s[3], v7.s[2] 20; CHECK-NEXT: mov v0.16b, v4.16b 21; CHECK-NEXT: ret 22 %s3 = shufflevector <16 x i32> %x, <16 x i32> %y, <16 x i32> <i32 29, i32 26, i32 7, i32 4, i32 3, i32 6, i32 5, i32 2, i32 9, i32 8, i32 17, i32 28, i32 27, i32 16, i32 31, i32 30> 23 ret <16 x i32> %s3 24} 25 26define <4 x i32> @test_shuf2(<16 x i32> %x, <16 x i32> %y) { 27; CHECK-LABEL: test_shuf2: 28; CHECK: // %bb.0: 29; CHECK-NEXT: zip2 v0.4s, v7.4s, v6.4s 30; CHECK-NEXT: trn2 v0.4s, v7.4s, v0.4s 31; CHECK-NEXT: mov v0.s[2], v1.s[3] 32; CHECK-NEXT: mov v0.s[3], v1.s[0] 33; CHECK-NEXT: ret 34 %s3 = shufflevector <16 x i32> %x, <16 x i32> %y, <4 x i32> <i32 29, i32 26, i32 7, i32 4> 35 ret <4 x i32> %s3 36} 37 38define <4 x i32> @test_shuf3(<16 x i32> %x, <16 x i32> %y) { 39; CHECK-LABEL: test_shuf3: 40; CHECK: // %bb.0: 41; CHECK-NEXT: uzp1 v2.4s, v1.4s, v0.4s 42; CHECK-NEXT: trn2 v1.4s, v2.4s, v1.4s 43; CHECK-NEXT: ext v0.16b, v0.16b, v1.16b, #12 44; CHECK-NEXT: ret 45 %s3 = shufflevector <16 x i32> %x, <16 x i32> %y, <4 x i32> <i32 3, i32 6, i32 5, i32 2> 46 ret <4 x i32> %s3 47} 48 49define <4 x i32> @test_shuf4(<16 x i32> %x, <16 x i32> %y) { 50; CHECK-LABEL: test_shuf4: 51; CHECK: // %bb.0: 52; CHECK-NEXT: uzp2 v0.4s, v2.4s, v4.4s 53; CHECK-NEXT: trn1 v0.4s, v0.4s, v2.4s 54; CHECK-NEXT: mov v0.s[3], v7.s[0] 55; CHECK-NEXT: ret 56 %s3 = shufflevector <16 x i32> %x, <16 x i32> %y, <4 x i32> <i32 9, i32 8, i32 17, i32 28> 57 ret <4 x i32> %s3 58} 59 60define <4 x i32> @test_shuf5(<16 x i32> %x, <16 x i32> %y) { 61; CHECK-LABEL: test_shuf5: 62; CHECK: // %bb.0: 63; CHECK-NEXT: ext v0.16b, v6.16b, v4.16b, #12 64; CHECK-NEXT: mov v0.s[2], v7.s[3] 65; CHECK-NEXT: mov v0.s[3], v7.s[2] 66; CHECK-NEXT: ret 67 %s3 = shufflevector <16 x i32> %x, <16 x i32> %y, <4 x i32> <i32 27, i32 16, i32 31, i32 30> 68 ret <4 x i32> %s3 69} 70 71define <4 x i32> @test1503(<4 x i32> %a, <4 x i32> %b) 72; CHECK-LABEL: test1503: 73; CHECK: // %bb.0: 74; CHECK-NEXT: zip1 v1.4s, v0.4s, v1.4s 75; CHECK-NEXT: ext v1.16b, v1.16b, v0.16b, #8 76; CHECK-NEXT: mov v1.s[3], v0.s[3] 77; CHECK-NEXT: mov v0.16b, v1.16b 78; CHECK-NEXT: ret 79{ 80 %r = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 1, i32 5, i32 0, i32 3> 81 ret <4 x i32> %r 82} 83 84define <4 x i32> @test4366(<4 x i32> %a, <4 x i32> %b) 85; CHECK-LABEL: test4366: 86; CHECK: // %bb.0: 87; CHECK-NEXT: trn1 v1.4s, v1.4s, v1.4s 88; CHECK-NEXT: mov v1.s[1], v0.s[3] 89; CHECK-NEXT: mov v0.16b, v1.16b 90; CHECK-NEXT: ret 91{ 92 %r = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 3, i32 6, i32 6> 93 ret <4 x i32> %r 94} 95 96define <4 x i32> @test7367(<4 x i32> %a, <4 x i32> %b) 97; CHECK-LABEL: test7367: 98; CHECK: // %bb.0: 99; CHECK-NEXT: mov v1.s[0], v1.s[3] 100; CHECK-NEXT: mov v1.s[1], v0.s[3] 101; CHECK-NEXT: mov v0.16b, v1.16b 102; CHECK-NEXT: ret 103{ 104 %r = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 7, i32 3, i32 6, i32 7> 105 ret <4 x i32> %r 106} 107