• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple=arm64 -mattr=+neon -show-encoding < %s | FileCheck %s
2
3// Check that the assembler can handle the documented syntax for AArch64
4
5//------------------------------------------------------------------------------
6// Instructions for permute
7//------------------------------------------------------------------------------
8
9        uzp1 v0.8b, v1.8b, v2.8b
10        uzp1 v0.16b, v1.16b, v2.16b
11        uzp1 v0.4h, v1.4h, v2.4h
12        uzp1 v0.8h, v1.8h, v2.8h
13        uzp1 v0.2s, v1.2s, v2.2s
14        uzp1 v0.4s, v1.4s, v2.4s
15        uzp1 v0.2d, v1.2d, v2.2d
16
17// CHECK: uzp1	v0.8b, v1.8b, v2.8b     // encoding: [0x20,0x18,0x02,0x0e]
18// CHECK: uzp1	v0.16b, v1.16b, v2.16b  // encoding: [0x20,0x18,0x02,0x4e]
19// CHECK: uzp1	v0.4h, v1.4h, v2.4h     // encoding: [0x20,0x18,0x42,0x0e]
20// CHECK: uzp1	v0.8h, v1.8h, v2.8h     // encoding: [0x20,0x18,0x42,0x4e]
21// CHECK: uzp1	v0.2s, v1.2s, v2.2s     // encoding: [0x20,0x18,0x82,0x0e]
22// CHECK: uzp1	v0.4s, v1.4s, v2.4s     // encoding: [0x20,0x18,0x82,0x4e]
23// CHECK: uzp1	v0.2d, v1.2d, v2.2d     // encoding: [0x20,0x18,0xc2,0x4e]
24
25        trn1 v0.8b, v1.8b, v2.8b
26        trn1 v0.16b, v1.16b, v2.16b
27        trn1 v0.4h, v1.4h, v2.4h
28        trn1 v0.8h, v1.8h, v2.8h
29        trn1 v0.2s, v1.2s, v2.2s
30        trn1 v0.4s, v1.4s, v2.4s
31        trn1 v0.2d, v1.2d, v2.2d
32
33// CHECK: trn1	v0.8b, v1.8b, v2.8b     // encoding: [0x20,0x28,0x02,0x0e]
34// CHECK: trn1	v0.16b, v1.16b, v2.16b  // encoding: [0x20,0x28,0x02,0x4e]
35// CHECK: trn1	v0.4h, v1.4h, v2.4h     // encoding: [0x20,0x28,0x42,0x0e]
36// CHECK: trn1	v0.8h, v1.8h, v2.8h     // encoding: [0x20,0x28,0x42,0x4e]
37// CHECK: trn1	v0.2s, v1.2s, v2.2s     // encoding: [0x20,0x28,0x82,0x0e]
38// CHECK: trn1	v0.4s, v1.4s, v2.4s     // encoding: [0x20,0x28,0x82,0x4e]
39// CHECK: trn1	v0.2d, v1.2d, v2.2d     // encoding: [0x20,0x28,0xc2,0x4e]
40
41        zip1 v0.8b, v1.8b, v2.8b
42        zip1 v0.16b, v1.16b, v2.16b
43        zip1 v0.4h, v1.4h, v2.4h
44        zip1 v0.8h, v1.8h, v2.8h
45        zip1 v0.2s, v1.2s, v2.2s
46        zip1 v0.4s, v1.4s, v2.4s
47        zip1 v0.2d, v1.2d, v2.2d
48
49// CHECK: zip1	v0.8b, v1.8b, v2.8b     // encoding: [0x20,0x38,0x02,0x0e]
50// CHECK: zip1	v0.16b, v1.16b, v2.16b  // encoding: [0x20,0x38,0x02,0x4e]
51// CHECK: zip1	v0.4h, v1.4h, v2.4h     // encoding: [0x20,0x38,0x42,0x0e]
52// CHECK: zip1	v0.8h, v1.8h, v2.8h     // encoding: [0x20,0x38,0x42,0x4e]
53// CHECK: zip1	v0.2s, v1.2s, v2.2s     // encoding: [0x20,0x38,0x82,0x0e]
54// CHECK: zip1	v0.4s, v1.4s, v2.4s     // encoding: [0x20,0x38,0x82,0x4e]
55// CHECK: zip1	v0.2d, v1.2d, v2.2d     // encoding: [0x20,0x38,0xc2,0x4e]
56
57        uzp2 v0.8b, v1.8b, v2.8b
58        uzp2 v0.16b, v1.16b, v2.16b
59        uzp2 v0.4h, v1.4h, v2.4h
60        uzp2 v0.8h, v1.8h, v2.8h
61        uzp2 v0.2s, v1.2s, v2.2s
62        uzp2 v0.4s, v1.4s, v2.4s
63        uzp2 v0.2d, v1.2d, v2.2d
64
65// CHECK: uzp2	v0.8b, v1.8b, v2.8b     // encoding: [0x20,0x58,0x02,0x0e]
66// CHECK: uzp2	v0.16b, v1.16b, v2.16b  // encoding: [0x20,0x58,0x02,0x4e]
67// CHECK: uzp2	v0.4h, v1.4h, v2.4h     // encoding: [0x20,0x58,0x42,0x0e]
68// CHECK: uzp2	v0.8h, v1.8h, v2.8h     // encoding: [0x20,0x58,0x42,0x4e]
69// CHECK: uzp2	v0.2s, v1.2s, v2.2s     // encoding: [0x20,0x58,0x82,0x0e]
70// CHECK: uzp2	v0.4s, v1.4s, v2.4s     // encoding: [0x20,0x58,0x82,0x4e]
71// CHECK: uzp2	v0.2d, v1.2d, v2.2d     // encoding: [0x20,0x58,0xc2,0x4e]
72
73        trn2 v0.8b, v1.8b, v2.8b
74        trn2 v0.16b, v1.16b, v2.16b
75        trn2 v0.4h, v1.4h, v2.4h
76        trn2 v0.8h, v1.8h, v2.8h
77        trn2 v0.2s, v1.2s, v2.2s
78        trn2 v0.4s, v1.4s, v2.4s
79        trn2 v0.2d, v1.2d, v2.2d
80
81// CHECK: trn2	v0.8b, v1.8b, v2.8b     // encoding: [0x20,0x68,0x02,0x0e]
82// CHECK: trn2	v0.16b, v1.16b, v2.16b  // encoding: [0x20,0x68,0x02,0x4e]
83// CHECK: trn2	v0.4h, v1.4h, v2.4h     // encoding: [0x20,0x68,0x42,0x0e]
84// CHECK: trn2	v0.8h, v1.8h, v2.8h     // encoding: [0x20,0x68,0x42,0x4e]
85// CHECK: trn2	v0.2s, v1.2s, v2.2s     // encoding: [0x20,0x68,0x82,0x0e]
86// CHECK: trn2	v0.4s, v1.4s, v2.4s     // encoding: [0x20,0x68,0x82,0x4e]
87// CHECK: trn2	v0.2d, v1.2d, v2.2d     // encoding: [0x20,0x68,0xc2,0x4e]
88
89        zip2 v0.8b, v1.8b, v2.8b
90        zip2 v0.16b, v1.16b, v2.16b
91        zip2 v0.4h, v1.4h, v2.4h
92        zip2 v0.8h, v1.8h, v2.8h
93        zip2 v0.2s, v1.2s, v2.2s
94        zip2 v0.4s, v1.4s, v2.4s
95        zip2 v0.2d, v1.2d, v2.2d
96
97// CHECK: zip2	v0.8b, v1.8b, v2.8b     // encoding: [0x20,0x78,0x02,0x0e]
98// CHECK: zip2	v0.16b, v1.16b, v2.16b  // encoding: [0x20,0x78,0x02,0x4e]
99// CHECK: zip2	v0.4h, v1.4h, v2.4h     // encoding: [0x20,0x78,0x42,0x0e]
100// CHECK: zip2	v0.8h, v1.8h, v2.8h     // encoding: [0x20,0x78,0x42,0x4e]
101// CHECK: zip2	v0.2s, v1.2s, v2.2s     // encoding: [0x20,0x78,0x82,0x0e]
102// CHECK: zip2	v0.4s, v1.4s, v2.4s     // encoding: [0x20,0x78,0x82,0x4e]
103// CHECK: zip2	v0.2d, v1.2d, v2.2d     // encoding: [0x20,0x78,0xc2,0x4e]
104