| Issue |
177051
|
| Summary |
[clang-format] Range assignments in TableGen are formatted oddly
|
| Labels |
clang-format
|
| Assignees |
|
| Reporter |
lenary
|
The following is some clang-format output of part of `llvm/lib/Target/RISCV/RISCVInstrFormats.td`
```tablegen
class RVInstRBase<bits<3> funct3, RISCVOpcode opcode, dag outs, dag ins,
string opcodestr, string argstr>
: RVInst<outs, ins, opcodestr, argstr, [], InstFormatR> {
bits<5> rs2;
bits<5> rs1;
bits<5> rd;
let Inst{24 -20} = rs2;
let Inst{19 -15} = rs1;
let Inst{14 -12} = funct3;
let Inst{11 -7} = rd;
let Inst{6 -0} = opcode.Value;
}
```
In particular, the formatting of the range assignments here is odd, it's more likely we would prefer the following formatting:
```tablegen
class RVInstRBase<bits<3> funct3, RISCVOpcode opcode, dag outs, dag ins,
string opcodestr, string argstr>
: RVInst<outs, ins, opcodestr, argstr, [], InstFormatR> {
/* ... */
let Inst{24-20} = rs2;
let Inst{19-15} = rs1;
let Inst{14-12} = funct3;
let Inst{11-7} = rd;
let Inst{6-0} = opcode.Value;
}
```
I.e., `let Inst{24 -20} = rs2;` has a space on the left of the `-`, which is strange and I think we'd prefer no spaces.
(We may or may not want the `=` aligned, I believe that's already configurable)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs