blob: ee5278600422fc0cc75be61e88b334a93902f122 [file] [log] [blame]
Ahmed Bougachae0afb1f2015-03-17 03:23:09 +00001; RUN: llc < %s -mtriple arm64-apple-darwin -asm-verbose=false | FileCheck %s
2
3target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
4
Ahmed Bougachadf437372015-04-09 20:04:47 +00005; Test the (concat_vectors (trunc), (trunc)) pattern.
6
Ahmed Bougachae0afb1f2015-03-17 03:23:09 +00007define <4 x i16> @test_concat_truncate_v2i64_to_v4i16(<2 x i64> %a, <2 x i64> %b) #0 {
8entry:
9; CHECK-LABEL: test_concat_truncate_v2i64_to_v4i16:
Ahmed Bougachae6bb09a2015-03-21 01:08:39 +000010; CHECK-NEXT: uzp1.4s v0, v0, v1
11; CHECK-NEXT: xtn.4h v0, v0
Ahmed Bougachae0afb1f2015-03-17 03:23:09 +000012; CHECK-NEXT: ret
13 %at = trunc <2 x i64> %a to <2 x i16>
14 %bt = trunc <2 x i64> %b to <2 x i16>
15 %shuffle = shufflevector <2 x i16> %at, <2 x i16> %bt, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
16 ret <4 x i16> %shuffle
17}
18
19define <8 x i8> @test_concat_truncate_v4i32_to_v8i8(<4 x i32> %a, <4 x i32> %b) #0 {
20entry:
21; CHECK-LABEL: test_concat_truncate_v4i32_to_v8i8:
Ahmed Bougachae6bb09a2015-03-21 01:08:39 +000022; CHECK-NEXT: uzp1.8h v0, v0, v1
23; CHECK-NEXT: xtn.8b v0, v0
Ahmed Bougachae0afb1f2015-03-17 03:23:09 +000024; CHECK-NEXT: ret
25 %at = trunc <4 x i32> %a to <4 x i8>
26 %bt = trunc <4 x i32> %b to <4 x i8>
27 %shuffle = shufflevector <4 x i8> %at, <4 x i8> %bt, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
28 ret <8 x i8> %shuffle
29}
30
Ahmed Bougachae6bb09a2015-03-21 01:08:39 +000031define <8 x i16> @test_concat_truncate_v4i32_to_v8i16(<4 x i32> %a, <4 x i32> %b) #0 {
32entry:
33; CHECK-LABEL: test_concat_truncate_v4i32_to_v8i16:
34; CHECK-NEXT: xtn.4h v0, v0
35; CHECK-NEXT: xtn2.8h v0, v1
36; CHECK-NEXT: ret
37 %at = trunc <4 x i32> %a to <4 x i16>
38 %bt = trunc <4 x i32> %b to <4 x i16>
39 %shuffle = shufflevector <4 x i16> %at, <4 x i16> %bt, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
40 ret <8 x i16> %shuffle
41}
42
Ahmed Bougachae0afb1f2015-03-17 03:23:09 +000043attributes #0 = { nounwind }