1 // RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s
2 // RUN: llvm-mc -triple arm64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s
4 // Check that the assembler can handle the documented syntax for AArch64
6 //----------------------------------------------------------------------
7 // Vector Absolute Difference and Accumulate (Signed, Unsigned)
8 //----------------------------------------------------------------------
9 uaba v0.8b, v1.8b, v2.8b
10 uaba v0.16b, v1.16b, v2.16b
11 uaba v0.4h, v1.4h, v2.4h
12 uaba v0.8h, v1.8h, v2.8h
13 uaba v0.2s, v1.2s, v2.2s
14 uaba v0.4s, v1.4s, v2.4s
16 // CHECK: uaba v0.8b, v1.8b, v2.8b // encoding: [0x20,0x7c,0x22,0x2e]
17 // CHECK: uaba v0.16b, v1.16b, v2.16b // encoding: [0x20,0x7c,0x22,0x6e]
18 // CHECK: uaba v0.4h, v1.4h, v2.4h // encoding: [0x20,0x7c,0x62,0x2e]
19 // CHECK: uaba v0.8h, v1.8h, v2.8h // encoding: [0x20,0x7c,0x62,0x6e]
20 // CHECK: uaba v0.2s, v1.2s, v2.2s // encoding: [0x20,0x7c,0xa2,0x2e]
21 // CHECK: uaba v0.4s, v1.4s, v2.4s // encoding: [0x20,0x7c,0xa2,0x6e]
24 saba v0.8b, v1.8b, v2.8b
25 saba v0.16b, v1.16b, v2.16b
26 saba v0.4h, v1.4h, v2.4h
27 saba v0.8h, v1.8h, v2.8h
28 saba v0.2s, v1.2s, v2.2s
29 saba v0.4s, v1.4s, v2.4s
31 // CHECK: saba v0.8b, v1.8b, v2.8b // encoding: [0x20,0x7c,0x22,0x0e]
32 // CHECK: saba v0.16b, v1.16b, v2.16b // encoding: [0x20,0x7c,0x22,0x4e]
33 // CHECK: saba v0.4h, v1.4h, v2.4h // encoding: [0x20,0x7c,0x62,0x0e]
34 // CHECK: saba v0.8h, v1.8h, v2.8h // encoding: [0x20,0x7c,0x62,0x4e]
35 // CHECK: saba v0.2s, v1.2s, v2.2s // encoding: [0x20,0x7c,0xa2,0x0e]
36 // CHECK: saba v0.4s, v1.4s, v2.4s // encoding: [0x20,0x7c,0xa2,0x4e]
38 //----------------------------------------------------------------------
39 // Vector Absolute Difference (Signed, Unsigned)
40 //----------------------------------------------------------------------
41 uabd v0.8b, v1.8b, v2.8b
42 uabd v0.16b, v1.16b, v2.16b
43 uabd v0.4h, v1.4h, v2.4h
44 uabd v0.8h, v1.8h, v2.8h
45 uabd v0.2s, v1.2s, v2.2s
46 uabd v0.4s, v1.4s, v2.4s
48 // CHECK: uabd v0.8b, v1.8b, v2.8b // encoding: [0x20,0x74,0x22,0x2e]
49 // CHECK: uabd v0.16b, v1.16b, v2.16b // encoding: [0x20,0x74,0x22,0x6e]
50 // CHECK: uabd v0.4h, v1.4h, v2.4h // encoding: [0x20,0x74,0x62,0x2e]
51 // CHECK: uabd v0.8h, v1.8h, v2.8h // encoding: [0x20,0x74,0x62,0x6e]
52 // CHECK: uabd v0.2s, v1.2s, v2.2s // encoding: [0x20,0x74,0xa2,0x2e]
53 // CHECK: uabd v0.4s, v1.4s, v2.4s // encoding: [0x20,0x74,0xa2,0x6e]
55 sabd v0.8b, v1.8b, v2.8b
56 sabd v0.16b, v1.16b, v2.16b
57 sabd v0.4h, v1.4h, v2.4h
58 sabd v0.8h, v1.8h, v2.8h
59 sabd v0.2s, v1.2s, v2.2s
60 sabd v0.4s, v1.4s, v2.4s
62 // CHECK: sabd v0.8b, v1.8b, v2.8b // encoding: [0x20,0x74,0x22,0x0e]
63 // CHECK: sabd v0.16b, v1.16b, v2.16b // encoding: [0x20,0x74,0x22,0x4e]
64 // CHECK: sabd v0.4h, v1.4h, v2.4h // encoding: [0x20,0x74,0x62,0x0e]
65 // CHECK: sabd v0.8h, v1.8h, v2.8h // encoding: [0x20,0x74,0x62,0x4e]
66 // CHECK: sabd v0.2s, v1.2s, v2.2s // encoding: [0x20,0x74,0xa2,0x0e]
67 // CHECK: sabd v0.4s, v1.4s, v2.4s // encoding: [0x20,0x74,0xa2,0x4e]
69 //----------------------------------------------------------------------
70 // Vector Absolute Difference (Floating Point)
71 //----------------------------------------------------------------------
72 fabd v0.2s, v1.2s, v2.2s
73 fabd v31.4s, v15.4s, v16.4s
74 fabd v7.2d, v8.2d, v25.2d
76 // CHECK: fabd v0.2s, v1.2s, v2.2s // encoding: [0x20,0xd4,0xa2,0x2e]
77 // CHECK: fabd v31.4s, v15.4s, v16.4s // encoding: [0xff,0xd5,0xb0,0x6e]
78 // CHECK: fabd v7.2d, v8.2d, v25.2d // encoding: [0x07,0xd5,0xf9,0x6e]