llvm.org GIT mirror llvm / 9983524
[AArch64][SVE] Asm: Add support for (ADD|SUB)_ZZZ Patch [5/5] in a series to add assembler/disassembler support for AArch64 SVE unpredicated ADD/SUB instructions. Patch by Sander De Smalen. Reviewed by: rengolin Differential Revision: https://reviews.llvm.org/D39091 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317591 91177308-0d34-0410-b5e6-96231b3b80d8 Florian Hahn 1 year, 11 months ago
7 changed file(s) with 292 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
334334 }
335335
336336 include "AArch64InstrFormats.td"
337 include "SVEInstrFormats.td"
337338
338339 //===----------------------------------------------------------------------===//
339340
62746275 (TCRETURNdi texternalsym:$dst, imm:$FPDiff)>;
62756276
62766277 include "AArch64InstrAtomics.td"
6278 include "AArch64SVEInstrInfo.td"
0 //=- AArch64SVEInstrInfo.td - AArch64 SVE Instructions -*- tablegen -*-----=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // AArch64 Scalable Vector Extension (SVE) Instruction definitions.
10 //
11 //===----------------------------------------------------------------------===//
12
13 let Predicates = [HasSVE] in {
14 defm ADD_ZZZ : sve_int_bin_cons_arit_0<0b000, "add">;
15 defm SUB_ZZZ : sve_int_bin_cons_arit_0<0b001, "sub">;
16 }
0 //=-- SVEInstrFormats.td - AArch64 SVE Instruction classes -*- tablegen -*--=//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // AArch64 Scalable Vector Extension (SVE) Instruction Class Definitions.
10 //
11 //===----------------------------------------------------------------------===//
12
13 //===----------------------------------------------------------------------===//
14 // SVE Integer Arithmetic - Unpredicated Group
15 //===----------------------------------------------------------------------===//
16
17 class sve_int_bin_cons_arit_0 sz8_64, bits<3> opc, string asm,
18 ZPRRegOp zprty>
19 : I<(outs zprty:$Zd), (ins zprty:$Zn, zprty:$Zm),
20 asm, "\t$Zd, $Zn, $Zm",
21 "", []>, Sched<[]> {
22 bits<5> Zd;
23 bits<5> Zm;
24 bits<5> Zn;
25 let Inst{31-24} = 0b00000100;
26 let Inst{23-22} = sz8_64;
27 let Inst{21} = 0b1;
28 let Inst{20-16} = Zm;
29 let Inst{15-13} = 0b000;
30 let Inst{12-10} = opc;
31 let Inst{9-5} = Zn;
32 let Inst{4-0} = Zd;
33 }
34
35 multiclass sve_int_bin_cons_arit_0 opc, string asm> {
36 def _B : sve_int_bin_cons_arit_0<0b00, opc, asm, ZPR8>;
37 def _H : sve_int_bin_cons_arit_0<0b01, opc, asm, ZPR16>;
38 def _S : sve_int_bin_cons_arit_0<0b10, opc, asm, ZPR32>;
39 def _D : sve_int_bin_cons_arit_0<0b11, opc, asm, ZPR64>;
40 }
0 // RUN: llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -mattr=+sve < %s | FileCheck %s
1 // RUN: not llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -mattr=-sve 2>&1 < %s | FileCheck --check-prefix=CHECK-ERROR %s
2 add z31.s, z31.s, z31.s // 00000100-10111111-00000011-11111111
3 // CHECK: add z31.s, z31.s, z31.s // encoding: [0xff,0x03,0xbf,0x04]
4 // CHECK-ERROR: invalid operand for instruction
5 // CHECK-ERROR-NEXT: 00000100-10111111-00000011-11111111
6 add z23.d, z13.d, z8.d // 00000100-11101000-00000001-10110111
7 // CHECK: add z23.d, z13.d, z8.d // encoding: [0xb7,0x01,0xe8,0x04]
8 // CHECK-ERROR: invalid operand for instruction
9 // CHECK-ERROR-NEXT: 00000100-11101000-00000001-10110111
10 add z0.s, z0.s, z0.s // 00000100-10100000-00000000-00000000
11 // CHECK: add z0.s, z0.s, z0.s // encoding: [0x00,0x00,0xa0,0x04]
12 // CHECK-ERROR: invalid operand for instruction
13 // CHECK-ERROR-NEXT: 00000100-10100000-00000000-00000000
14 add z31.d, z31.d, z31.d // 00000100-11111111-00000011-11111111
15 // CHECK: add z31.d, z31.d, z31.d // encoding: [0xff,0x03,0xff,0x04]
16 // CHECK-ERROR: invalid operand for instruction
17 // CHECK-ERROR-NEXT: 00000100-11111111-00000011-11111111
18 add z21.b, z10.b, z21.b // 00000100-00110101-00000001-01010101
19 // CHECK: add z21.b, z10.b, z21.b // encoding: [0x55,0x01,0x35,0x04]
20 // CHECK-ERROR: invalid operand for instruction
21 // CHECK-ERROR-NEXT: 00000100-00110101-00000001-01010101
22 add z31.b, z31.b, z31.b // 00000100-00111111-00000011-11111111
23 // CHECK: add z31.b, z31.b, z31.b // encoding: [0xff,0x03,0x3f,0x04]
24 // CHECK-ERROR: invalid operand for instruction
25 // CHECK-ERROR-NEXT: 00000100-00111111-00000011-11111111
26 add z0.h, z0.h, z0.h // 00000100-01100000-00000000-00000000
27 // CHECK: add z0.h, z0.h, z0.h // encoding: [0x00,0x00,0x60,0x04]
28 // CHECK-ERROR: invalid operand for instruction
29 // CHECK-ERROR-NEXT: 00000100-01100000-00000000-00000000
30 add z23.b, z13.b, z8.b // 00000100-00101000-00000001-10110111
31 // CHECK: add z23.b, z13.b, z8.b // encoding: [0xb7,0x01,0x28,0x04]
32 // CHECK-ERROR: invalid operand for instruction
33 // CHECK-ERROR-NEXT: 00000100-00101000-00000001-10110111
34 add z0.d, z0.d, z0.d // 00000100-11100000-00000000-00000000
35 // CHECK: add z0.d, z0.d, z0.d // encoding: [0x00,0x00,0xe0,0x04]
36 // CHECK-ERROR: invalid operand for instruction
37 // CHECK-ERROR-NEXT: 00000100-11100000-00000000-00000000
38 add z31.h, z31.h, z31.h // 00000100-01111111-00000011-11111111
39 // CHECK: add z31.h, z31.h, z31.h // encoding: [0xff,0x03,0x7f,0x04]
40 // CHECK-ERROR: invalid operand for instruction
41 // CHECK-ERROR-NEXT: 00000100-01111111-00000011-11111111
42 add z0.b, z0.b, z0.b // 00000100-00100000-00000000-00000000
43 // CHECK: add z0.b, z0.b, z0.b // encoding: [0x00,0x00,0x20,0x04]
44 // CHECK-ERROR: invalid operand for instruction
45 // CHECK-ERROR-NEXT: 00000100-00100000-00000000-00000000
46 add z21.d, z10.d, z21.d // 00000100-11110101-00000001-01010101
47 // CHECK: add z21.d, z10.d, z21.d // encoding: [0x55,0x01,0xf5,0x04]
48 // CHECK-ERROR: invalid operand for instruction
49 // CHECK-ERROR-NEXT: 00000100-11110101-00000001-01010101
50 add z21.h, z10.h, z21.h // 00000100-01110101-00000001-01010101
51 // CHECK: add z21.h, z10.h, z21.h // encoding: [0x55,0x01,0x75,0x04]
52 // CHECK-ERROR: invalid operand for instruction
53 // CHECK-ERROR-NEXT: 00000100-01110101-00000001-01010101
54 add z21.s, z10.s, z21.s // 00000100-10110101-00000001-01010101
55 // CHECK: add z21.s, z10.s, z21.s // encoding: [0x55,0x01,0xb5,0x04]
56 // CHECK-ERROR: invalid operand for instruction
57 // CHECK-ERROR-NEXT: 00000100-10110101-00000001-01010101
58 add z23.h, z13.h, z8.h // 00000100-01101000-00000001-10110111
59 // CHECK: add z23.h, z13.h, z8.h // encoding: [0xb7,0x01,0x68,0x04]
60 // CHECK-ERROR: invalid operand for instruction
61 // CHECK-ERROR-NEXT: 00000100-01101000-00000001-10110111
62 add z23.s, z13.s, z8.s // 00000100-10101000-00000001-10110111
63 // CHECK: add z23.s, z13.s, z8.s // encoding: [0xb7,0x01,0xa8,0x04]
64 // CHECK-ERROR: invalid operand for instruction
65 // CHECK-ERROR-NEXT: 00000100-10101000-00000001-10110111
0 // RUN: llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -mattr=+sve < %s | FileCheck %s
1 // RUN: not llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -mattr=-sve 2>&1 < %s | FileCheck --check-prefix=CHECK-ERROR %s
2 sub z0.h, z0.h, z0.h // 00000100-01100000-00000100-00000000
3 // CHECK: sub z0.h, z0.h, z0.h // encoding: [0x00,0x04,0x60,0x04]
4 // CHECK-ERROR: invalid operand for instruction
5 // CHECK-ERROR-NEXT: 00000100-01100000-00000100-00000000
6 sub z21.b, z10.b, z21.b // 00000100-00110101-00000101-01010101
7 // CHECK: sub z21.b, z10.b, z21.b // encoding: [0x55,0x05,0x35,0x04]
8 // CHECK-ERROR: invalid operand for instruction
9 // CHECK-ERROR-NEXT: 00000100-00110101-00000101-01010101
10 sub z31.h, z31.h, z31.h // 00000100-01111111-00000111-11111111
11 // CHECK: sub z31.h, z31.h, z31.h // encoding: [0xff,0x07,0x7f,0x04]
12 // CHECK-ERROR: invalid operand for instruction
13 // CHECK-ERROR-NEXT: 00000100-01111111-00000111-11111111
14 sub z21.h, z10.h, z21.h // 00000100-01110101-00000101-01010101
15 // CHECK: sub z21.h, z10.h, z21.h // encoding: [0x55,0x05,0x75,0x04]
16 // CHECK-ERROR: invalid operand for instruction
17 // CHECK-ERROR-NEXT: 00000100-01110101-00000101-01010101
18 sub z31.b, z31.b, z31.b // 00000100-00111111-00000111-11111111
19 // CHECK: sub z31.b, z31.b, z31.b // encoding: [0xff,0x07,0x3f,0x04]
20 // CHECK-ERROR: invalid operand for instruction
21 // CHECK-ERROR-NEXT: 00000100-00111111-00000111-11111111
22 sub z0.s, z0.s, z0.s // 00000100-10100000-00000100-00000000
23 // CHECK: sub z0.s, z0.s, z0.s // encoding: [0x00,0x04,0xa0,0x04]
24 // CHECK-ERROR: invalid operand for instruction
25 // CHECK-ERROR-NEXT: 00000100-10100000-00000100-00000000
26 sub z23.b, z13.b, z8.b // 00000100-00101000-00000101-10110111
27 // CHECK: sub z23.b, z13.b, z8.b // encoding: [0xb7,0x05,0x28,0x04]
28 // CHECK-ERROR: invalid operand for instruction
29 // CHECK-ERROR-NEXT: 00000100-00101000-00000101-10110111
30 sub z21.d, z10.d, z21.d // 00000100-11110101-00000101-01010101
31 // CHECK: sub z21.d, z10.d, z21.d // encoding: [0x55,0x05,0xf5,0x04]
32 // CHECK-ERROR: invalid operand for instruction
33 // CHECK-ERROR-NEXT: 00000100-11110101-00000101-01010101
34 sub z21.s, z10.s, z21.s // 00000100-10110101-00000101-01010101
35 // CHECK: sub z21.s, z10.s, z21.s // encoding: [0x55,0x05,0xb5,0x04]
36 // CHECK-ERROR: invalid operand for instruction
37 // CHECK-ERROR-NEXT: 00000100-10110101-00000101-01010101
38 sub z0.b, z0.b, z0.b // 00000100-00100000-00000100-00000000
39 // CHECK: sub z0.b, z0.b, z0.b // encoding: [0x00,0x04,0x20,0x04]
40 // CHECK-ERROR: invalid operand for instruction
41 // CHECK-ERROR-NEXT: 00000100-00100000-00000100-00000000
42 sub z23.d, z13.d, z8.d // 00000100-11101000-00000101-10110111
43 // CHECK: sub z23.d, z13.d, z8.d // encoding: [0xb7,0x05,0xe8,0x04]
44 // CHECK-ERROR: invalid operand for instruction
45 // CHECK-ERROR-NEXT: 00000100-11101000-00000101-10110111
46 sub z23.s, z13.s, z8.s // 00000100-10101000-00000101-10110111
47 // CHECK: sub z23.s, z13.s, z8.s // encoding: [0xb7,0x05,0xa8,0x04]
48 // CHECK-ERROR: invalid operand for instruction
49 // CHECK-ERROR-NEXT: 00000100-10101000-00000101-10110111
50 sub z31.d, z31.d, z31.d // 00000100-11111111-00000111-11111111
51 // CHECK: sub z31.d, z31.d, z31.d // encoding: [0xff,0x07,0xff,0x04]
52 // CHECK-ERROR: invalid operand for instruction
53 // CHECK-ERROR-NEXT: 00000100-11111111-00000111-11111111
54 sub z23.h, z13.h, z8.h // 00000100-01101000-00000101-10110111
55 // CHECK: sub z23.h, z13.h, z8.h // encoding: [0xb7,0x05,0x68,0x04]
56 // CHECK-ERROR: invalid operand for instruction
57 // CHECK-ERROR-NEXT: 00000100-01101000-00000101-10110111
58 sub z0.d, z0.d, z0.d // 00000100-11100000-00000100-00000000
59 // CHECK: sub z0.d, z0.d, z0.d // encoding: [0x00,0x04,0xe0,0x04]
60 // CHECK-ERROR: invalid operand for instruction
61 // CHECK-ERROR-NEXT: 00000100-11100000-00000100-00000000
62 sub z31.s, z31.s, z31.s // 00000100-10111111-00000111-11111111
63 // CHECK: sub z31.s, z31.s, z31.s // encoding: [0xff,0x07,0xbf,0x04]
64 // CHECK-ERROR: invalid operand for instruction
65 // CHECK-ERROR-NEXT: 00000100-10111111-00000111-11111111
0 # RUN: llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -disassemble -mattr=+sve < %s | FileCheck %s
1 # RUN: llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -disassemble -mattr=-sve 2>&1 < %s | FileCheck --check-prefix=CHECK-ERROR %s
2 0xff,0x03,0xbf,0x04
3 # CHECK: add z31.s, z31.s, z31.s // encoding: [0xff,0x03,0xbf,0x04]
4 # CHECK-ERROR: invalid instruction encoding
5 0xb7,0x01,0xe8,0x04
6 # CHECK: add z23.d, z13.d, z8.d // encoding: [0xb7,0x01,0xe8,0x04]
7 # CHECK-ERROR: invalid instruction encoding
8 0x00,0x00,0xa0,0x04
9 # CHECK: add z0.s, z0.s, z0.s // encoding: [0x00,0x00,0xa0,0x04]
10 # CHECK-ERROR: invalid instruction encoding
11 0xff,0x03,0xff,0x04
12 # CHECK: add z31.d, z31.d, z31.d // encoding: [0xff,0x03,0xff,0x04]
13 # CHECK-ERROR: invalid instruction encoding
14 0x55,0x01,0x35,0x04
15 # CHECK: add z21.b, z10.b, z21.b // encoding: [0x55,0x01,0x35,0x04]
16 # CHECK-ERROR: invalid instruction encoding
17 0xff,0x03,0x3f,0x04
18 # CHECK: add z31.b, z31.b, z31.b // encoding: [0xff,0x03,0x3f,0x04]
19 # CHECK-ERROR: invalid instruction encoding
20 0x00,0x00,0x60,0x04
21 # CHECK: add z0.h, z0.h, z0.h // encoding: [0x00,0x00,0x60,0x04]
22 # CHECK-ERROR: invalid instruction encoding
23 0xb7,0x01,0x28,0x04
24 # CHECK: add z23.b, z13.b, z8.b // encoding: [0xb7,0x01,0x28,0x04]
25 # CHECK-ERROR: invalid instruction encoding
26 0x00,0x00,0xe0,0x04
27 # CHECK: add z0.d, z0.d, z0.d // encoding: [0x00,0x00,0xe0,0x04]
28 # CHECK-ERROR: invalid instruction encoding
29 0xff,0x03,0x7f,0x04
30 # CHECK: add z31.h, z31.h, z31.h // encoding: [0xff,0x03,0x7f,0x04]
31 # CHECK-ERROR: invalid instruction encoding
32 0x00,0x00,0x20,0x04
33 # CHECK: add z0.b, z0.b, z0.b // encoding: [0x00,0x00,0x20,0x04]
34 # CHECK-ERROR: invalid instruction encoding
35 0x55,0x01,0xf5,0x04
36 # CHECK: add z21.d, z10.d, z21.d // encoding: [0x55,0x01,0xf5,0x04]
37 # CHECK-ERROR: invalid instruction encoding
38 0x55,0x01,0x75,0x04
39 # CHECK: add z21.h, z10.h, z21.h // encoding: [0x55,0x01,0x75,0x04]
40 # CHECK-ERROR: invalid instruction encoding
41 0x55,0x01,0xb5,0x04
42 # CHECK: add z21.s, z10.s, z21.s // encoding: [0x55,0x01,0xb5,0x04]
43 # CHECK-ERROR: invalid instruction encoding
44 0xb7,0x01,0x68,0x04
45 # CHECK: add z23.h, z13.h, z8.h // encoding: [0xb7,0x01,0x68,0x04]
46 # CHECK-ERROR: invalid instruction encoding
47 0xb7,0x01,0xa8,0x04
48 # CHECK: add z23.s, z13.s, z8.s // encoding: [0xb7,0x01,0xa8,0x04]
49 # CHECK-ERROR: invalid instruction encoding
0 # RUN: llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -disassemble -mattr=+sve < %s | FileCheck %s
1 # RUN: llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -disassemble -mattr=-sve 2>&1 < %s | FileCheck --check-prefix=CHECK-ERROR %s
2 0x00,0x04,0x60,0x04
3 # CHECK: sub z0.h, z0.h, z0.h // encoding: [0x00,0x04,0x60,0x04]
4 # CHECK-ERROR: invalid instruction encoding
5 0x55,0x05,0x35,0x04
6 # CHECK: sub z21.b, z10.b, z21.b // encoding: [0x55,0x05,0x35,0x04]
7 # CHECK-ERROR: invalid instruction encoding
8 0xff,0x07,0x7f,0x04
9 # CHECK: sub z31.h, z31.h, z31.h // encoding: [0xff,0x07,0x7f,0x04]
10 # CHECK-ERROR: invalid instruction encoding
11 0x55,0x05,0x75,0x04
12 # CHECK: sub z21.h, z10.h, z21.h // encoding: [0x55,0x05,0x75,0x04]
13 # CHECK-ERROR: invalid instruction encoding
14 0xff,0x07,0x3f,0x04
15 # CHECK: sub z31.b, z31.b, z31.b // encoding: [0xff,0x07,0x3f,0x04]
16 # CHECK-ERROR: invalid instruction encoding
17 0x00,0x04,0xa0,0x04
18 # CHECK: sub z0.s, z0.s, z0.s // encoding: [0x00,0x04,0xa0,0x04]
19 # CHECK-ERROR: invalid instruction encoding
20 0xb7,0x05,0x28,0x04
21 # CHECK: sub z23.b, z13.b, z8.b // encoding: [0xb7,0x05,0x28,0x04]
22 # CHECK-ERROR: invalid instruction encoding
23 0x55,0x05,0xf5,0x04
24 # CHECK: sub z21.d, z10.d, z21.d // encoding: [0x55,0x05,0xf5,0x04]
25 # CHECK-ERROR: invalid instruction encoding
26 0x55,0x05,0xb5,0x04
27 # CHECK: sub z21.s, z10.s, z21.s // encoding: [0x55,0x05,0xb5,0x04]
28 # CHECK-ERROR: invalid instruction encoding
29 0x00,0x04,0x20,0x04
30 # CHECK: sub z0.b, z0.b, z0.b // encoding: [0x00,0x04,0x20,0x04]
31 # CHECK-ERROR: invalid instruction encoding
32 0xb7,0x05,0xe8,0x04
33 # CHECK: sub z23.d, z13.d, z8.d // encoding: [0xb7,0x05,0xe8,0x04]
34 # CHECK-ERROR: invalid instruction encoding
35 0xb7,0x05,0xa8,0x04
36 # CHECK: sub z23.s, z13.s, z8.s // encoding: [0xb7,0x05,0xa8,0x04]
37 # CHECK-ERROR: invalid instruction encoding
38 0xff,0x07,0xff,0x04
39 # CHECK: sub z31.d, z31.d, z31.d // encoding: [0xff,0x07,0xff,0x04]
40 # CHECK-ERROR: invalid instruction encoding
41 0xb7,0x05,0x68,0x04
42 # CHECK: sub z23.h, z13.h, z8.h // encoding: [0xb7,0x05,0x68,0x04]
43 # CHECK-ERROR: invalid instruction encoding
44 0x00,0x04,0xe0,0x04
45 # CHECK: sub z0.d, z0.d, z0.d // encoding: [0x00,0x04,0xe0,0x04]
46 # CHECK-ERROR: invalid instruction encoding
47 0xff,0x07,0xbf,0x04
48 # CHECK: sub z31.s, z31.s, z31.s // encoding: [0xff,0x07,0xbf,0x04]
49 # CHECK-ERROR: invalid instruction encoding