mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-11 13:29:36 +00:00
teach asmprinter to print s8/s14 operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21131 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f55e403ef9
commit
e6a0b6cbda
@ -233,6 +233,18 @@ namespace {
|
|||||||
MVT::ValueType VT) {
|
MVT::ValueType VT) {
|
||||||
O << (unsigned short)MI->getOperand(OpNo).getImmedValue();
|
O << (unsigned short)MI->getOperand(OpNo).getImmedValue();
|
||||||
}
|
}
|
||||||
|
void printS8ImmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
MVT::ValueType VT) {
|
||||||
|
int val=(unsigned int)MI->getOperand(OpNo).getImmedValue();
|
||||||
|
if(val>=128) val=val-256; // if negative, flip sign
|
||||||
|
O << val;
|
||||||
|
}
|
||||||
|
void printS14ImmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
MVT::ValueType VT) {
|
||||||
|
int val=(unsigned int)MI->getOperand(OpNo).getImmedValue();
|
||||||
|
if(val>=8192) val=val-16384; // if negative, flip sign
|
||||||
|
O << val;
|
||||||
|
}
|
||||||
void printS21ImmOperand(const MachineInstr *MI, unsigned OpNo,
|
void printS21ImmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
MVT::ValueType VT) {
|
MVT::ValueType VT) {
|
||||||
O << (int)MI->getOperand(OpNo).getImmedValue(); // FIXME (21, not 32!)
|
O << (int)MI->getOperand(OpNo).getImmedValue(); // FIXME (21, not 32!)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user