[LLVMdev] TableGen Style Conventions

Daniel Sanders Daniel.Sanders at imgtec.com
Tue Jun 2 07:57:58 PDT 2015


Hi,

Different targets organize their definitions in different ways. This particular style is from the Mips target.

The creation of this style pre-dates my work on LLVM but readability and de-cluttering are two of the reasons I encouraged its use for new Mips ISA's and ASE's. The main benefit is the ability to pick and choose which types of information you want to see and hide the rest. Disassembler work finds *_FMT and *_ENC more useful, CodeGen work finds *_DESC more useful and finds encodings irrelevant, etc. It's also quite nice for comparing information against the architecture documentation.

> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of mmcco at mykolab.com
> Sent: 31 May 2015 05:08
> To: llvmdev at cs.uiuc.edu
> Subject: [LLVMdev] TableGen Style Conventions
> 
> This probably qualifies as bikeshedding, but how strict are the style
> norms for TableGen? Some aspects of it, like individually and
> consecutively declaring all *_ENC variables in this manner:
> 
>     class ADDU_QB_ENC : ADDU_QB_FMT<0b00000>;
> 
> To be used only once, in this manner:
> 
>     def ADDU_QB : ADDU_QB_ENC, ADDU_QB_DESC;
> 
> Seem like avoidable clutter to me. The files tend to be pretty big, and
> I think that collapsing assignments like that could make them more
> readable.
> 
> I'm new to this, so let me know if I'm missing something.
> 
> Thanks,
> Michael
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list