mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
bpf: proper print imm64 expression in inst printer
Fixed an issue in printImm64Operand where if the value is an expression, print out the expression properly. Currently, it will print r1 = <MCOperand Expr:(tx_port)>ll With the patch, the printout will be r1 = tx_port Suggested-by: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Yonghong Song <yhs@fb.com> Acked-by: Alexei Starovoitov <ast@kernel.org> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312833 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -249,7 +249,7 @@ class MOV_RI<string OpcodeStr>
|
||||
|
||||
class LD_IMM64<bits<4> Pseudo, string OpcodeStr>
|
||||
: InstBPF<(outs GPR:$dst), (ins u64imm:$imm),
|
||||
"$dst "#OpcodeStr#" ${imm}ll",
|
||||
"$dst "#OpcodeStr#" ${imm}",
|
||||
[(set GPR:$dst, (i64 imm:$imm))]> {
|
||||
|
||||
bits<3> mode;
|
||||
|
||||
@@ -88,7 +88,9 @@ void BPFInstPrinter::printImm64Operand(const MCInst *MI, unsigned OpNo,
|
||||
raw_ostream &O) {
|
||||
const MCOperand &Op = MI->getOperand(OpNo);
|
||||
if (Op.isImm())
|
||||
O << (uint64_t)Op.getImm();
|
||||
O << (uint64_t)Op.getImm() << "ll";
|
||||
else if (Op.isExpr())
|
||||
printExpr(Op.getExpr(), O);
|
||||
else
|
||||
O << Op;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user