.set pc relative displacement bug: label should be moved down one instruction

to just before the add r1, pc:

Before:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
LPCRELL0:
        mov r1, #PCRELV0
        add r1, pc

Now:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
        mov r1, #PCRELV0
LPCRELL0:
        add r1, pc

llvm-svn: 33744
This commit is contained in:
Evan Cheng 2007-02-01 03:04:49 +00:00
parent 0df1536173
commit 06736d0f88
1 changed files with 6 additions and 6 deletions

View File

@ -480,17 +480,17 @@ let usesCustomDAGSchedInserter = 1 in // Expanded by the scheduler.
// assembler. // assembler.
def tLEApcrel : TIx2<(ops GPR:$dst, i32imm:$label), def tLEApcrel : TIx2<(ops GPR:$dst, i32imm:$label),
!strconcat(!strconcat(".set PCRELV${:uid}, ($label-(", !strconcat(!strconcat(".set PCRELV${:uid}, ($label-(",
"${:private}PCRELL${:uid}+4))\n"), "${:private}PCRELL${:uid}+6))\n"),
!strconcat("${:private}PCRELL${:uid}:\n\t", !strconcat("\tmov $dst, #PCRELV${:uid}\n",
"mov $dst, #PCRELV${:uid}\n\tadd $dst, pc")), "${:private}PCRELL${:uid}:\n\tadd $dst, pc")),
[]>; []>;
def tLEApcrelJT : TIx2<(ops GPR:$dst, i32imm:$label, i32imm:$id), def tLEApcrelJT : TIx2<(ops GPR:$dst, i32imm:$label, i32imm:$id),
!strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(", !strconcat(!strconcat(".set PCRELV${:uid}, (${label}_${id:no_hash}-(",
"${:private}PCRELL${:uid}+4))\n"), "${:private}PCRELL${:uid}+4))\n"),
!strconcat("${:private}PCRELL${:uid}:\n\t", !strconcat("\tmov $dst, #PCRELV${:uid}\n",
"mov $dst, #PCRELV${:uid}\n\tadd $dst, pc")), "${:private}PCRELL${:uid}:\n\tadd $dst, pc")),
[]>; []>;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Non-Instruction Patterns // Non-Instruction Patterns