neon-saturating-rounding-shift.s revision 87773c318fcee853fb34a80a10c4347d523bdafb
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//------------------------------------------------------------------------------
7// Vector Integer Saturating Rounding Shift Lef (Signed)
8//------------------------------------------------------------------------------
9         sqrshl v0.8b, v1.8b, v2.8b
10         sqrshl v0.16b, v1.16b, v2.16b
11         sqrshl v0.4h, v1.4h, v2.4h
12         sqrshl v0.8h, v1.8h, v2.8h
13         sqrshl v0.2s, v1.2s, v2.2s
14         sqrshl v0.4s, v1.4s, v2.4s
15         sqrshl v0.2d, v1.2d, v2.2d
16
17// CHECK: sqrshl v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x5c,0x22,0x0e]
18// CHECK: sqrshl v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x5c,0x22,0x4e]
19// CHECK: sqrshl v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x5c,0x62,0x0e]
20// CHECK: sqrshl v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x5c,0x62,0x4e]
21// CHECK: sqrshl v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x5c,0xa2,0x0e]
22// CHECK: sqrshl v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x5c,0xa2,0x4e]
23// CHECK: sqrshl v0.2d, v1.2d, v2.2d        // encoding: [0x20,0x5c,0xe2,0x4e]
24
25//------------------------------------------------------------------------------
26// Vector Integer Saturating Rounding Shift Lef (Unsigned)
27//------------------------------------------------------------------------------
28         uqrshl v0.8b, v1.8b, v2.8b
29         uqrshl v0.16b, v1.16b, v2.16b
30         uqrshl v0.4h, v1.4h, v2.4h
31         uqrshl v0.8h, v1.8h, v2.8h
32         uqrshl v0.2s, v1.2s, v2.2s
33         uqrshl v0.4s, v1.4s, v2.4s
34         uqrshl v0.2d, v1.2d, v2.2d
35
36// CHECK: uqrshl v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x5c,0x22,0x2e]
37// CHECK: uqrshl v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x5c,0x22,0x6e]
38// CHECK: uqrshl v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x5c,0x62,0x2e]
39// CHECK: uqrshl v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x5c,0x62,0x6e]
40// CHECK: uqrshl v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x5c,0xa2,0x2e]
41// CHECK: uqrshl v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x5c,0xa2,0x6e]
42// CHECK: uqrshl v0.2d, v1.2d, v2.2d        // encoding: [0x20,0x5c,0xe2,0x6e]
43
44//------------------------------------------------------------------------------
45// Scalar Integer Saturating Rounding Shift Lef (Signed)
46//------------------------------------------------------------------------------
47         sqrshl b0, b1, b2
48         sqrshl h10, h11, h12
49         sqrshl s20, s21, s2
50         sqrshl d17, d31, d8
51
52// CHECK: sqrshl b0, b1, b2        // encoding: [0x20,0x5c,0x22,0x5e]
53// CHECK: sqrshl h10, h11, h12     // encoding: [0x6a,0x5d,0x6c,0x5e]
54// CHECK: sqrshl s20, s21, s2      // encoding: [0xb4,0x5e,0xa2,0x5e]
55// CHECK: sqrshl d17, d31, d8      // encoding: [0xf1,0x5f,0xe8,0x5e]
56
57//------------------------------------------------------------------------------
58// Scalar Integer Saturating Rounding Shift Lef (Unsigned)
59//------------------------------------------------------------------------------
60         uqrshl b0, b1, b2
61         uqrshl h10, h11, h12
62         uqrshl s20, s21, s2
63         uqrshl d17, d31, d8
64
65// CHECK: uqrshl b0, b1, b2        // encoding: [0x20,0x5c,0x22,0x7e]
66// CHECK: uqrshl h10, h11, h12     // encoding: [0x6a,0x5d,0x6c,0x7e]
67// CHECK: uqrshl s20, s21, s2      // encoding: [0xb4,0x5e,0xa2,0x7e]
68// CHECK: uqrshl d17, d31, d8      // encoding: [0xf1,0x5f,0xe8,0x7e]
69
70
71