• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 Halving Add (Signed)
8//------------------------------------------------------------------------------
9         shadd v0.8b, v1.8b, v2.8b
10         shadd v0.16b, v1.16b, v2.16b
11         shadd v0.4h, v1.4h, v2.4h
12         shadd v0.8h, v1.8h, v2.8h
13         shadd v0.2s, v1.2s, v2.2s
14         shadd v0.4s, v1.4s, v2.4s
15
16// CHECK: shadd v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x04,0x22,0x0e]
17// CHECK: shadd v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x04,0x22,0x4e]
18// CHECK: shadd v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x04,0x62,0x0e]
19// CHECK: shadd v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x04,0x62,0x4e]
20// CHECK: shadd v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x04,0xa2,0x0e]
21// CHECK: shadd v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x04,0xa2,0x4e]
22
23
24//------------------------------------------------------------------------------
25// Vector Integer Halving Add (Unsigned)
26//------------------------------------------------------------------------------
27         uhadd v0.8b, v1.8b, v2.8b
28         uhadd v0.16b, v1.16b, v2.16b
29         uhadd v0.4h, v1.4h, v2.4h
30         uhadd v0.8h, v1.8h, v2.8h
31         uhadd v0.2s, v1.2s, v2.2s
32         uhadd v0.4s, v1.4s, v2.4s
33
34// CHECK: uhadd v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x04,0x22,0x2e]
35// CHECK: uhadd v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x04,0x22,0x6e]
36// CHECK: uhadd v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x04,0x62,0x2e]
37// CHECK: uhadd v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x04,0x62,0x6e]
38// CHECK: uhadd v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x04,0xa2,0x2e]
39// CHECK: uhadd v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x04,0xa2,0x6e]
40
41//------------------------------------------------------------------------------
42// Vector Integer Halving Sub (Signed)
43//------------------------------------------------------------------------------
44         shsub v0.8b, v1.8b, v2.8b
45         shsub v0.16b, v1.16b, v2.16b
46         shsub v0.4h, v1.4h, v2.4h
47         shsub v0.8h, v1.8h, v2.8h
48         shsub v0.2s, v1.2s, v2.2s
49         shsub v0.4s, v1.4s, v2.4s
50
51// CHECK: shsub v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x24,0x22,0x0e]
52// CHECK: shsub v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x24,0x22,0x4e]
53// CHECK: shsub v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x24,0x62,0x0e]
54// CHECK: shsub v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x24,0x62,0x4e]
55// CHECK: shsub v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x24,0xa2,0x0e]
56// CHECK: shsub v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x24,0xa2,0x4e]
57
58//------------------------------------------------------------------------------
59// Vector Integer Halving Sub (Unsigned)
60//------------------------------------------------------------------------------
61         uhsub v0.8b, v1.8b, v2.8b
62         uhsub v0.16b, v1.16b, v2.16b
63         uhsub v0.4h, v1.4h, v2.4h
64         uhsub v0.8h, v1.8h, v2.8h
65         uhsub v0.2s, v1.2s, v2.2s
66         uhsub v0.4s, v1.4s, v2.4s
67
68// CHECK: uhsub v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x24,0x22,0x2e]
69// CHECK: uhsub v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x24,0x22,0x6e]
70// CHECK: uhsub v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x24,0x62,0x2e]
71// CHECK: uhsub v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x24,0x62,0x6e]
72// CHECK: uhsub v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x24,0xa2,0x2e]
73// CHECK: uhsub v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x24,0xa2,0x6e]
74
75