Alexei Starovoitov via llvm-dev
2016-Jun-16 05:23 UTC
[llvm-dev] [iovisor-dev] [PATCH, BPF 2/5] BPF: Rearrange instruction classes
On Wed, Jun 15, 2016 at 2:37 PM, Richard Henderson via iovisor-dev <iovisor-dev at lists.iovisor.org> wrote:> Avoid duplicating lots of field definitions. > > Signed-off-by: Richard Henderson <rth at twiddle.net> > --- > lib/Target/BPF/BPFInstrFormats.td | 45 +++- > lib/Target/BPF/BPFInstrInfo.td | 536 +++++++++++++++----------------------- > 2 files changed, 247 insertions(+), 334 deletions(-) > > diff --git a/lib/Target/BPF/BPFInstrFormats.td b/lib/Target/BPF/BPFInstrFormats.td > index 53f3ad6..79479e6 100644 > --- a/lib/Target/BPF/BPFInstrFormats.td > +++ b/lib/Target/BPF/BPFInstrFormats.td > @@ -8,7 +8,8 @@ > //===----------------------------------------------------------------------===// > > class InstBPF<dag outs, dag ins, string asmstr, list<dag> pattern> > - : Instruction { > + : Instruction > +{please keep original llvm coding style.> // Pseudo instructions > class Pseudo<dag outs, dag ins, string asmstr, list<dag> pattern> > - : InstBPF<outs, ins, asmstr, pattern> { > + : InstBPF<outs, ins, asmstr, pattern> > +{same here> let Inst{63-0} = 0; > let isPseudo = 1; > } > + > +class F_CMS<bits<3> cls, bits<3> mode, bits<2> sz,...> +class F_COF<bits<3> cls, bits<4> op, bits<1> srcf,what F_CMS and F_COF abbreviations mean? overall removal of duplicated code is very nice.
Richard Henderson via llvm-dev
2016-Jun-16 17:00 UTC
[llvm-dev] [iovisor-dev] [PATCH, BPF 2/5] BPF: Rearrange instruction classes
On 06/15/2016 10:23 PM, Alexei Starovoitov wrote:>> +class F_CMS<bits<3> cls, bits<3> mode, bits<2> sz, > ... >> +class F_COF<bits<3> cls, bits<4> op, bits<1> srcf, > > what F_CMS and F_COF abbreviations mean?"Code, Mode, Size" and "Code, Op, source Flag" which are the two field tuples. A comment would have been handy, I admit. r~