1// RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s
2
3// Check that the assembler can handle the documented syntax for AArch64
4
5//----------------------------------------------------------------------
6// Vector Maximum Pairwise (Signed and Unsigned Integer)
7//----------------------------------------------------------------------
8         smaxp v0.8b, v1.8b, v2.8b
9         smaxp v0.16b, v1.16b, v2.16b
10         smaxp v0.4h, v1.4h, v2.4h
11         smaxp v0.8h, v1.8h, v2.8h
12         smaxp v0.2s, v1.2s, v2.2s
13         smaxp v0.4s, v1.4s, v2.4s
14
15// CHECK: smaxp v0.8b, v1.8b, v2.8b        // encoding: [0x20,0xa4,0x22,0x0e]
16// CHECK: smaxp v0.16b, v1.16b, v2.16b     // encoding: [0x20,0xa4,0x22,0x4e]
17// CHECK: smaxp v0.4h, v1.4h, v2.4h        // encoding: [0x20,0xa4,0x62,0x0e]
18// CHECK: smaxp v0.8h, v1.8h, v2.8h        // encoding: [0x20,0xa4,0x62,0x4e]
19// CHECK: smaxp v0.2s, v1.2s, v2.2s        // encoding: [0x20,0xa4,0xa2,0x0e]
20// CHECK: smaxp v0.4s, v1.4s, v2.4s        // encoding: [0x20,0xa4,0xa2,0x4e]
21
22         umaxp v0.8b, v1.8b, v2.8b
23         umaxp v0.16b, v1.16b, v2.16b
24         umaxp v0.4h, v1.4h, v2.4h
25         umaxp v0.8h, v1.8h, v2.8h
26         umaxp v0.2s, v1.2s, v2.2s
27         umaxp v0.4s, v1.4s, v2.4s
28
29// CHECK: umaxp v0.8b, v1.8b, v2.8b         // encoding: [0x20,0xa4,0x22,0x2e]
30// CHECK: umaxp v0.16b, v1.16b, v2.16b      // encoding: [0x20,0xa4,0x22,0x6e]
31// CHECK: umaxp v0.4h, v1.4h, v2.4h         // encoding: [0x20,0xa4,0x62,0x2e]
32// CHECK: umaxp v0.8h, v1.8h, v2.8h         // encoding: [0x20,0xa4,0x62,0x6e]
33// CHECK: umaxp v0.2s, v1.2s, v2.2s         // encoding: [0x20,0xa4,0xa2,0x2e]
34// CHECK: umaxp v0.4s, v1.4s, v2.4s         // encoding: [0x20,0xa4,0xa2,0x6e]
35
36//----------------------------------------------------------------------
37// Vector Minimum Pairwise (Signed and Unsigned Integer)
38//----------------------------------------------------------------------
39         sminp v0.8b, v1.8b, v2.8b
40         sminp v0.16b, v1.16b, v2.16b
41         sminp v0.4h, v1.4h, v2.4h
42         sminp v0.8h, v1.8h, v2.8h
43         sminp v0.2s, v1.2s, v2.2s
44         sminp v0.4s, v1.4s, v2.4s
45
46// CHECK: sminp v0.8b, v1.8b, v2.8b        // encoding: [0x20,0xac,0x22,0x0e]
47// CHECK: sminp v0.16b, v1.16b, v2.16b     // encoding: [0x20,0xac,0x22,0x4e]
48// CHECK: sminp v0.4h, v1.4h, v2.4h        // encoding: [0x20,0xac,0x62,0x0e]
49// CHECK: sminp v0.8h, v1.8h, v2.8h        // encoding: [0x20,0xac,0x62,0x4e]
50// CHECK: sminp v0.2s, v1.2s, v2.2s        // encoding: [0x20,0xac,0xa2,0x0e]
51// CHECK: sminp v0.4s, v1.4s, v2.4s        // encoding: [0x20,0xac,0xa2,0x4e]
52
53         uminp v0.8b, v1.8b, v2.8b
54         uminp v0.16b, v1.16b, v2.16b
55         uminp v0.4h, v1.4h, v2.4h
56         uminp v0.8h, v1.8h, v2.8h
57         uminp v0.2s, v1.2s, v2.2s
58         uminp v0.4s, v1.4s, v2.4s
59
60// CHECK: uminp v0.8b, v1.8b, v2.8b         // encoding: [0x20,0xac,0x22,0x2e]
61// CHECK: uminp v0.16b, v1.16b, v2.16b      // encoding: [0x20,0xac,0x22,0x6e]
62// CHECK: uminp v0.4h, v1.4h, v2.4h         // encoding: [0x20,0xac,0x62,0x2e]
63// CHECK: uminp v0.8h, v1.8h, v2.8h         // encoding: [0x20,0xac,0x62,0x6e]
64// CHECK: uminp v0.2s, v1.2s, v2.2s         // encoding: [0x20,0xac,0xa2,0x2e]
65// CHECK: uminp v0.4s, v1.4s, v2.4s         // encoding: [0x20,0xac,0xa2,0x6e]
66
67//----------------------------------------------------------------------
68// Vector Maximum Pairwise (Floating Point)
69//----------------------------------------------------------------------
70         fmaxp v0.2s, v1.2s, v2.2s
71         fmaxp v31.4s, v15.4s, v16.4s
72         fmaxp v7.2d, v8.2d, v25.2d
73
74// CHECK: fmaxp v0.2s, v1.2s, v2.2s    // encoding: [0x20,0xf4,0x22,0x2e]
75// CHECK: fmaxp v31.4s, v15.4s, v16.4s // encoding: [0xff,0xf5,0x30,0x6e]
76// CHECK: fmaxp v7.2d, v8.2d, v25.2d   // encoding: [0x07,0xf5,0x79,0x6e]
77
78//----------------------------------------------------------------------
79// Vector Minimum Pairwise (Floating Point)
80//----------------------------------------------------------------------
81         fminp v10.2s, v15.2s, v22.2s
82         fminp v3.4s, v5.4s, v6.4s
83         fminp v17.2d, v13.2d, v2.2d
84
85// CHECK: fminp v10.2s, v15.2s, v22.2s  // encoding: [0xea,0xf5,0xb6,0x2e]
86// CHECK: fminp v3.4s, v5.4s, v6.4s     // encoding: [0xa3,0xf4,0xa6,0x6e]
87// CHECK: fminp v17.2d, v13.2d, v2.2d   // encoding: [0xb1,0xf5,0xe2,0x6e]
88
89//----------------------------------------------------------------------
90// Vector maxNum Pairwise (Floating Point)
91//----------------------------------------------------------------------
92         fmaxnmp v0.2s, v1.2s, v2.2s
93         fmaxnmp v31.4s, v15.4s, v16.4s
94         fmaxnmp v7.2d, v8.2d, v25.2d
95
96// CHECK: fmaxnmp v0.2s, v1.2s, v2.2s    // encoding: [0x20,0xc4,0x22,0x2e]
97// CHECK: fmaxnmp v31.4s, v15.4s, v16.4s // encoding: [0xff,0xc5,0x30,0x6e]
98// CHECK: fmaxnmp v7.2d, v8.2d, v25.2d   // encoding: [0x07,0xc5,0x79,0x6e]
99
100//----------------------------------------------------------------------
101// Vector minNum Pairwise (Floating Point)
102//----------------------------------------------------------------------
103         fminnmp v10.2s, v15.2s, v22.2s
104         fminnmp v3.4s, v5.4s, v6.4s
105         fminnmp v17.2d, v13.2d, v2.2d
106
107// CHECK: fminnmp v10.2s, v15.2s, v22.2s  // encoding: [0xea,0xc5,0xb6,0x2e]
108// CHECK: fminnmp v3.4s, v5.4s, v6.4s     // encoding: [0xa3,0xc4,0xa6,0x6e]
109// CHECK: fminnmp v17.2d, v13.2d, v2.2d   // encoding: [0xb1,0xc5,0xe2,0x6e]
110
111