]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AArch64/SVEInstrFormats.td
MFV r336950: 9290 device removal reduces redundancy of mirrors
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AArch64 / SVEInstrFormats.td
1 //=-- SVEInstrFormats.td -  AArch64 SVE Instruction classes -*- tablegen -*--=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // AArch64 Scalable Vector Extension (SVE) Instruction Class Definitions.
11 //
12 //===----------------------------------------------------------------------===//
13
14 //===----------------------------------------------------------------------===//
15 // SVE Integer Arithmetic -  Unpredicated Group.
16 //===----------------------------------------------------------------------===//
17
18 class sve_int_bin_cons_arit_0<bits<2> sz8_64, bits<3> opc, string asm,
19                               ZPRRegOp zprty>
20 : I<(outs zprty:$Zd), (ins zprty:$Zn, zprty:$Zm),
21   asm, "\t$Zd, $Zn, $Zm",
22   "", []>, Sched<[]> {
23   bits<5> Zd;
24   bits<5> Zm;
25   bits<5> Zn;
26   let Inst{31-24} = 0b00000100;
27   let Inst{23-22} = sz8_64;
28   let Inst{21}    = 0b1;
29   let Inst{20-16} = Zm;
30   let Inst{15-13} = 0b000;
31   let Inst{12-10} = opc;
32   let Inst{9-5}   = Zn;
33   let Inst{4-0}   = Zd;
34 }
35
36 multiclass sve_int_bin_cons_arit_0<bits<3> opc, string asm> {
37   def _B : sve_int_bin_cons_arit_0<0b00, opc, asm, ZPR8>;
38   def _H : sve_int_bin_cons_arit_0<0b01, opc, asm, ZPR16>;
39   def _S : sve_int_bin_cons_arit_0<0b10, opc, asm, ZPR32>;
40   def _D : sve_int_bin_cons_arit_0<0b11, opc, asm, ZPR64>;
41 }
42
43 //===----------------------------------------------------------------------===//
44 // SVE Permute - In Lane Group
45 //===----------------------------------------------------------------------===//
46
47 class sve_int_perm_bin_perm_zz<bits<3> opc, bits<2> sz8_64, string asm,
48                                ZPRRegOp zprty>
49 : I<(outs zprty:$Zd), (ins zprty:$Zn, zprty:$Zm),
50   asm, "\t$Zd, $Zn, $Zm",
51   "",
52   []>, Sched<[]> {
53   bits<5> Zd;
54   bits<5> Zm;
55   bits<5> Zn;
56   let Inst{31-24} = 0b00000101;
57   let Inst{23-22} = sz8_64;
58   let Inst{21}    = 0b1;
59   let Inst{20-16} = Zm;
60   let Inst{15-13} = 0b011;
61   let Inst{12-10} = opc;
62   let Inst{9-5}   = Zn;
63   let Inst{4-0}   = Zd;
64 }
65
66 multiclass sve_int_perm_bin_perm_zz<bits<3> opc, string asm> {
67   def _B : sve_int_perm_bin_perm_zz<opc, 0b00, asm, ZPR8>;
68   def _H : sve_int_perm_bin_perm_zz<opc, 0b01, asm, ZPR16>;
69   def _S : sve_int_perm_bin_perm_zz<opc, 0b10, asm, ZPR32>;
70   def _D : sve_int_perm_bin_perm_zz<opc, 0b11, asm, ZPR64>;
71 }
72
73 //===----------------------------------------------------------------------===//
74 // SVE Permute - Predicates Group
75 //===----------------------------------------------------------------------===//
76
77 class sve_int_perm_bin_perm_pp<bits<3> opc, bits<2> sz8_64, string asm,
78                                PPRRegOp pprty>
79 : I<(outs pprty:$Pd), (ins pprty:$Pn, pprty:$Pm),
80   asm, "\t$Pd, $Pn, $Pm",
81   "",
82   []>, Sched<[]> {
83   bits<4> Pd;
84   bits<4> Pm;
85   bits<4> Pn;
86   let Inst{31-24} = 0b00000101;
87   let Inst{23-22} = sz8_64;
88   let Inst{21-20} = 0b10;
89   let Inst{19-16} = Pm;
90   let Inst{15-13} = 0b010;
91   let Inst{12-10} = opc;
92   let Inst{9}     = 0b0;
93   let Inst{8-5}   = Pn;
94   let Inst{4}     = 0b0;
95   let Inst{3-0}   = Pd;
96 }
97
98 multiclass sve_int_perm_bin_perm_pp<bits<3> opc, string asm> {
99   def _B : sve_int_perm_bin_perm_pp<opc, 0b00, asm, PPR8>;
100   def _H : sve_int_perm_bin_perm_pp<opc, 0b01, asm, PPR16>;
101   def _S : sve_int_perm_bin_perm_pp<opc, 0b10, asm, PPR32>;
102   def _D : sve_int_perm_bin_perm_pp<opc, 0b11, asm, PPR64>;
103 }