1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

print negative 64 bit immediates as negative numbers, makes things a little

easier on the eyes, not that numbers like 18446744073709541376 are bad or
anything

llvm-svn: 21300
This commit is contained in:
Duraid Madina 2005-04-14 10:08:01 +00:00
parent b8dfae92e9
commit 0c40c548c0
2 changed files with 9 additions and 2 deletions

View File

@ -247,7 +247,11 @@ namespace {
MVT::ValueType VT) {
O << (uint64_t)MI->getOperand(OpNo).getImmedValue();
}
void printS64ImmOperand(const MachineInstr *MI, unsigned OpNo,
MVT::ValueType VT) {
O << (int64_t)MI->getOperand(OpNo).getImmedValue();
}
void printCallOperand(const MachineInstr *MI, unsigned OpNo,
MVT::ValueType VT) {
printOp(MI->getOperand(OpNo), true); // this is a br.call instruction

View File

@ -28,6 +28,9 @@ def s22imm : Operand<i32> {
def u64imm : Operand<i64> {
let PrintMethod = "printU64ImmOperand";
}
def s64imm : Operand<i64> {
let PrintMethod = "printS64ImmOperand";
}
// the asmprinter needs to know about calls
let PrintMethod = "printCallOperand" in
@ -89,7 +92,7 @@ def MOVSIMM14 : AForm<0x03, 0x0b, (ops GR:$dst, s14imm:$imm),
"mov $dst = $imm;;">;
def MOVSIMM22 : AForm<0x03, 0x0b, (ops GR:$dst, s22imm:$imm),
"mov $dst = $imm;;">;
def MOVLIMM64 : AForm<0x03, 0x0b, (ops GR:$dst, u64imm:$imm),
def MOVLIMM64 : AForm<0x03, 0x0b, (ops GR:$dst, s64imm:$imm),
"movl $dst = $imm;;">;
def AND : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),