Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DCPU16: Fixed issue 34, relative offset

This little tweak should be sufficent to use the word sized
addressing for now.

Signed-off-by: Nils Hasenbanck <nils@hasenbanck.de>
  • Loading branch information...
commit ca2769909bbb606266f2e82c2881216af113db05 1 parent 1429c62
@hasenbanck hasenbanck authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Target/DCPU16/InstPrinter/DCPU16InstPrinter.cpp
View
4 lib/Target/DCPU16/InstPrinter/DCPU16InstPrinter.cpp
@@ -35,7 +35,7 @@ void DCPU16InstPrinter::printPCRelImmOperand(const MCInst *MI, unsigned OpNo,
raw_ostream &O) {
const MCOperand &Op = MI->getOperand(OpNo);
if (Op.isImm())
- O << Op.getImm();
+ O << Op.getImm() / 2; // FIXME: I think this is safe
else {
assert(Op.isExpr() && "unknown pcrel immediate operand");
O << *Op.getExpr();
@@ -77,7 +77,7 @@ void DCPU16InstPrinter::printSrcMemOperand(const MCInst *MI, unsigned OpNo,
else {
assert(Disp.isImm() && "Expected immediate in displacement field");
if(Disp.getImm() != 0) {
- O << Disp.getImm();
+ O << Disp.getImm() / 2;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.