From b9ca92661cf145bfb3bd9705e5629fc5f411a42f Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 25 Aug 2006 21:54:44 +0000 Subject: Encode pc-relative conditional branch offset as pc+(num of bytes / 4). The asm printer will print it as offset*4. e.g. bne cr0, $+8. The PPC code emitter was expecting the offset to be number of instructions, not number of bytes. This fixes a whole bunch of JIT failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29885 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCAsmPrinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Target/PowerPC/PPCAsmPrinter.cpp') diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 5850682005..3939d6c357 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -131,7 +131,7 @@ namespace { // Branches can take an immediate operand. This is used by the branch // selection pass to print $+8, an eight byte displacement from the PC. if (MI->getOperand(OpNo).isImmediate()) { - O << "$+" << MI->getOperand(OpNo).getImmedValue(); + O << "$+" << MI->getOperand(OpNo).getImmedValue()*4; } else { printOp(MI->getOperand(OpNo)); } -- cgit v1.2.3-70-g09d2