Produce an error instead of a crash in an expr we cannot represent.
[oota-llvm.git] / test / MC / AArch64 / neon-add-sub-instructions.s
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
3
4 // Check that the assembler can handle the documented syntax for AArch64
5
6
7 //------------------------------------------------------------------------------
8 // Vector Integer Add
9 //------------------------------------------------------------------------------
10          add v0.8b, v1.8b, v2.8b
11          add v0.16b, v1.16b, v2.16b
12          add v0.4h, v1.4h, v2.4h
13          add v0.8h, v1.8h, v2.8h
14          add v0.2s, v1.2s, v2.2s
15          add v0.4s, v1.4s, v2.4s
16          add v0.2d, v1.2d, v2.2d
17
18 // CHECK: add v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x84,0x22,0x0e]
19 // CHECK: add v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x84,0x22,0x4e]
20 // CHECK: add v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x84,0x62,0x0e]
21 // CHECK: add v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x84,0x62,0x4e]
22 // CHECK: add v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x84,0xa2,0x0e]
23 // CHECK: add v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x84,0xa2,0x4e]
24 // CHECK: add v0.2d, v1.2d, v2.2d        // encoding: [0x20,0x84,0xe2,0x4e]
25
26 //------------------------------------------------------------------------------
27 // Vector Integer Sub
28 //------------------------------------------------------------------------------
29          sub v0.8b, v1.8b, v2.8b
30          sub v0.16b, v1.16b, v2.16b
31          sub v0.4h, v1.4h, v2.4h
32          sub v0.8h, v1.8h, v2.8h
33          sub v0.2s, v1.2s, v2.2s
34          sub v0.4s, v1.4s, v2.4s
35          sub v0.2d, v1.2d, v2.2d
36
37 // CHECK: sub v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x84,0x22,0x2e]
38 // CHECK: sub v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x84,0x22,0x6e]
39 // CHECK: sub v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x84,0x62,0x2e]
40 // CHECK: sub v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x84,0x62,0x6e]
41 // CHECK: sub v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x84,0xa2,0x2e]
42 // CHECK: sub v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x84,0xa2,0x6e]
43 // CHECK: sub v0.2d, v1.2d, v2.2d        // encoding: [0x20,0x84,0xe2,0x6e]
44
45 //------------------------------------------------------------------------------
46 // Vector Floating-Point Add
47 //------------------------------------------------------------------------------
48          fadd v0.2s, v1.2s, v2.2s
49          fadd v0.4s, v1.4s, v2.4s
50          fadd v0.2d, v1.2d, v2.2d
51
52 // CHECK: fadd v0.2s, v1.2s, v2.2s       // encoding: [0x20,0xd4,0x22,0x0e]
53 // CHECK: fadd v0.4s, v1.4s, v2.4s       // encoding: [0x20,0xd4,0x22,0x4e]
54 // CHECK: fadd v0.2d, v1.2d, v2.2d       // encoding: [0x20,0xd4,0x62,0x4e]
55
56
57 //------------------------------------------------------------------------------
58 // Vector Floating-Point Sub
59 //------------------------------------------------------------------------------
60          fsub v0.2s, v1.2s, v2.2s
61          fsub v0.4s, v1.4s, v2.4s
62          fsub v0.2d, v1.2d, v2.2d
63
64 // CHECK: fsub v0.2s, v1.2s, v2.2s       // encoding: [0x20,0xd4,0xa2,0x0e]
65 // CHECK: fsub v0.4s, v1.4s, v2.4s       // encoding: [0x20,0xd4,0xa2,0x4e]
66 // CHECK: fsub v0.2d, v1.2d, v2.2d       // encoding: [0x20,0xd4,0xe2,0x4e]
67
68
69