• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon,+fullfp16 -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.4h, v1.4h, v2.4h
71         fmaxp v31.8h, v15.8h, v16.8h
72         fmaxp v0.2s, v1.2s, v2.2s
73         fmaxp v31.4s, v15.4s, v16.4s
74         fmaxp v7.2d, v8.2d, v25.2d
75
76// CHECK: fmaxp   v0.4h, v1.4h, v2.4h     // encoding: [0x20,0x34,0x42,0x2e]
77// CHECK: fmaxp   v31.8h, v15.8h, v16.8h  // encoding: [0xff,0x35,0x50,0x6e]
78// CHECK: fmaxp v0.2s, v1.2s, v2.2s    // encoding: [0x20,0xf4,0x22,0x2e]
79// CHECK: fmaxp v31.4s, v15.4s, v16.4s // encoding: [0xff,0xf5,0x30,0x6e]
80// CHECK: fmaxp v7.2d, v8.2d, v25.2d   // encoding: [0x07,0xf5,0x79,0x6e]
81
82//----------------------------------------------------------------------
83// Vector Minimum Pairwise (Floating Point)
84//----------------------------------------------------------------------
85         fminp v10.4h, v15.4h, v22.4h
86         fminp v3.8h, v5.8h, v6.8h
87         fminp v10.2s, v15.2s, v22.2s
88         fminp v3.4s, v5.4s, v6.4s
89         fminp v17.2d, v13.2d, v2.2d
90
91// CHECK: fminp   v10.4h, v15.4h, v22.4h  // encoding: [0xea,0x35,0xd6,0x2e]
92// CHECK: fminp   v3.8h, v5.8h, v6.8h     // encoding: [0xa3,0x34,0xc6,0x6e]
93// CHECK: fminp v10.2s, v15.2s, v22.2s  // encoding: [0xea,0xf5,0xb6,0x2e]
94// CHECK: fminp v3.4s, v5.4s, v6.4s     // encoding: [0xa3,0xf4,0xa6,0x6e]
95// CHECK: fminp v17.2d, v13.2d, v2.2d   // encoding: [0xb1,0xf5,0xe2,0x6e]
96
97//----------------------------------------------------------------------
98// Vector maxNum Pairwise (Floating Point)
99//----------------------------------------------------------------------
100         fmaxnmp v0.4h, v1.4h, v2.4h
101         fmaxnmp v31.8h, v15.8h, v16.8h
102         fmaxnmp v0.2s, v1.2s, v2.2s
103         fmaxnmp v31.4s, v15.4s, v16.4s
104         fmaxnmp v7.2d, v8.2d, v25.2d
105
106// CHECK: fmaxnmp v0.4h, v1.4h, v2.4h     // encoding: [0x20,0x04,0x42,0x2e]
107// CHECK: fmaxnmp v31.8h, v15.8h, v16.8h  // encoding: [0xff,0x05,0x50,0x6e]
108// CHECK: fmaxnmp v0.2s, v1.2s, v2.2s    // encoding: [0x20,0xc4,0x22,0x2e]
109// CHECK: fmaxnmp v31.4s, v15.4s, v16.4s // encoding: [0xff,0xc5,0x30,0x6e]
110// CHECK: fmaxnmp v7.2d, v8.2d, v25.2d   // encoding: [0x07,0xc5,0x79,0x6e]
111
112//----------------------------------------------------------------------
113// Vector minNum Pairwise (Floating Point)
114//----------------------------------------------------------------------
115         fminnmp v10.4h, v15.4h, v22.4h
116         fminnmp v3.8h, v5.8h, v6.8h
117         fminnmp v10.2s, v15.2s, v22.2s
118         fminnmp v3.4s, v5.4s, v6.4s
119         fminnmp v17.2d, v13.2d, v2.2d
120
121// CHECK: fminnmp v10.4h, v15.4h, v22.4h  // encoding: [0xea,0x05,0xd6,0x2e]
122// CHECK: fminnmp v3.8h, v5.8h, v6.8h     // encoding: [0xa3,0x04,0xc6,0x6e]
123// CHECK: fminnmp v10.2s, v15.2s, v22.2s  // encoding: [0xea,0xc5,0xb6,0x2e]
124// CHECK: fminnmp v3.4s, v5.4s, v6.4s     // encoding: [0xa3,0xc4,0xa6,0x6e]
125// CHECK: fminnmp v17.2d, v13.2d, v2.2d   // encoding: [0xb1,0xc5,0xe2,0x6e]
126
127