Skip to content

Commit

Permalink
Improve asm formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Skvortsov committed Mar 17, 2020
1 parent 6c569b4 commit 33f3d55
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions llvm/lib/Target/TVM/TVMAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void TVMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
case TVM::FROM_SLICE_COPY_S:
case TVM::FROM_BUILDER_COPY_S:
case TVM::FROM_CELL_COPY_S:
case TVM::PUSH_GLOBAL_ADDRESS_S:
break;
case TVM::FALLTHROUGH_RETURN:
if (isVerbose()) {
Expand Down
22 changes: 11 additions & 11 deletions llvm/lib/Target/TVM/TVMCellInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ defm LDI : I<(outs I257 : $x, Slice : $sliceo),
(outs), (ins uimm1_256 : $precision),
[(set I257 : $x, Slice : $sliceo,
(int_tvm_ldi Slice : $slicei, uimm1_256 : $precision))],
"LDI\t $precision, $slicei, $x, $sliceo",
"LDI\t $precision", 0xd2>;
"LDI\t$precision, $slicei, $x, $sliceo",
"LDI\t$precision", 0xd2>;

defm LDU : I<(outs I257 : $x, Slice : $sliceo),
(ins Slice : $slicei, uimm1_256 : $precision),
(outs), (ins uimm1_256 : $precision),
[(set I257 : $x, Slice : $sliceo,
(int_tvm_ldu Slice : $slicei, uimm1_256 : $precision))],
"LDU\t $precision, $slicei, $x, $sliceo",
"LDU\t $precision", 0xd3>;
"LDU\t$precision, $slicei, $x, $sliceo",
"LDU\t$precision", 0xd3>;

defm LDIX : I0<(outs I257 : $x, Slice : $sliceo),
(ins Slice : $slicei, I257 : $precision),
Expand All @@ -107,8 +107,8 @@ defm LDUQ : I<(outs I257:$x, Slice:$sliceo, I257:$succ),
(outs), (ins uimm1_256:$precision),
[(set I257:$x, Slice:$sliceo, I257:$succ,
(int_tvm_lduq Slice:$slicei, uimm1_256:$precision))],
"LDUQ\t $precision, $slicei, $x, $sliceo, $succ",
"LDUQ\t $precision NULLROTRIFNOT", 0xd70d>;
"LDUQ\t$precision, $slicei, $x, $sliceo, $succ",
"LDUQ\t$precision NULLROTRIFNOT", 0xd70d>;

defm LDUXQ : I0<(outs I257:$x, Slice:$sliceo, I257:$succ),
(ins Slice:$slicei, I257:$precision),
Expand Down Expand Up @@ -162,16 +162,16 @@ defm PLDI : I<(outs I257:$x),
(outs), (ins uimm1_256:$precision),
[(set I257:$x,
(int_tvm_pldi Slice:$slicei, uimm1_256:$precision))],
"PLDI\t $precision, $slicei, $x",
"PLDI\t $precision", 0xd70a00>;
"PLDI\t$precision, $slicei, $x",
"PLDI\t$precision", 0xd70a00>;

defm PLDU : I<(outs I257:$x),
(ins Slice:$slicei, uimm1_256:$precision),
(outs), (ins uimm1_256:$precision),
[(set I257:$x,
(int_tvm_pldu Slice:$slicei, uimm1_256:$precision))],
"PLDU\t $precision, $slicei, $x",
"PLDU\t $precision", 0xd70b00>;
"PLDU\t$precision, $slicei, $x",
"PLDU\t$precision", 0xd70b00>;

defm PLDIX : I0<(outs I257:$x), (ins Slice:$slicei, I257:$precision),
[(set I257:$x, (int_tvm_pldu Slice:$slicei, I257:$precision))],
Expand All @@ -194,7 +194,7 @@ defm STUXR : I0<(outs Builder : $builder),
defm LDREFRTOS : I<(outs Slice:$cellslice, Slice:$sliceo), (ins Slice:$slicei),
(outs), (ins),
[(set Slice:$cellslice, Slice:$sliceo, (int_tvm_ldrefrtos Slice:$slicei))],
"LDREFRTOS\t $cellslice, $sliceo, $slicei", "LDREFRTOS", 0xd5>;
"LDREFRTOS\t$cellslice, $sliceo, $slicei", "LDREFRTOS", 0xd5>;

let hasSideEffects = 1 in
defm LDREF : I<(outs Cell:$ocell, Slice:$oslice), (ins Slice:$islice),
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/TVM/TVMInstrFormats.td
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TVMInst<bits<32> inst, string asmstr, bit stack> : Instruction {
field bit StackBased = stack;
let Namespace = "TVM";
let Pattern = [];
let AsmString = asmstr;
let AsmString = !subst("\t", " ", asmstr);
}

// Normal instructions. Default instantiation of a TVMInst.
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/TVM/load-store-global.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; RUN: llc < %s -march=tvm | FileCheck %s
; RUN: llc < %s -march=tvm -asm-verbose=0 | FileCheck %s
target triple = "tvm"

@value1 = global i257 1
Expand Down

0 comments on commit 33f3d55

Please sign in to comment.