mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Properly lower jump tables on MSP430. Patch by Job Noorman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186283 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3c0e8fbd4e
commit
a77f816c4c
@ -987,8 +987,8 @@ SDValue MSP430TargetLowering::LowerJumpTable(SDValue Op,
|
|||||||
SelectionDAG &DAG) const {
|
SelectionDAG &DAG) const {
|
||||||
JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
|
JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
|
||||||
SDValue Result = DAG.getTargetJumpTable(JT->getIndex(), getPointerTy());
|
SDValue Result = DAG.getTargetJumpTable(JT->getIndex(), getPointerTy());
|
||||||
Result.getNode()->setDebugLoc(JT->getDebugLoc());
|
return DAG.getNode(MSP430ISD::Wrapper, SDLoc(JT),
|
||||||
return Result;
|
getPointerTy(), Result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getPostIndexedAddressParts - returns true by value, base pointer and
|
/// getPostIndexedAddressParts - returns true by value, base pointer and
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc -O0 < %s | FileCheck %s
|
; RUN: llc < %s | FileCheck %s
|
||||||
|
|
||||||
target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"
|
target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"
|
||||||
target triple = "msp430---elf"
|
target triple = "msp430---elf"
|
||||||
@ -11,9 +11,9 @@ entry:
|
|||||||
%i.addr = alloca i16, align 2
|
%i.addr = alloca i16, align 2
|
||||||
store i16 %i, i16* %i.addr, align 2
|
store i16 %i, i16* %i.addr, align 2
|
||||||
%0 = load i16* %i.addr, align 2
|
%0 = load i16* %i.addr, align 2
|
||||||
; CHECK: add.w #.LJTI0_0, [[REG1:r[0-9]+]]
|
; CHECK: mov.w #2, r14
|
||||||
; CHECK: mov.w 0([[REG1]]), [[REG2:r[0-9]+]]
|
; CHECK: call #__mulhi3hw_noint
|
||||||
; CHECK: mov.w [[REG2]], pc
|
; CHECK: mov.w .LJTI0_0(r15), pc
|
||||||
switch i16 %0, label %sw.default [
|
switch i16 %0, label %sw.default [
|
||||||
i16 0, label %sw.bb
|
i16 0, label %sw.bb
|
||||||
i16 1, label %sw.bb1
|
i16 1, label %sw.bb1
|
||||||
@ -49,6 +49,6 @@ return: ; preds = %sw.default, %sw.bb3
|
|||||||
|
|
||||||
; CHECK: .LJTI0_0:
|
; CHECK: .LJTI0_0:
|
||||||
; CHECK-NEXT: .short .LBB0_2
|
; CHECK-NEXT: .short .LBB0_2
|
||||||
; CHECK-NEXT: .short .LBB0_3
|
|
||||||
; CHECK-NEXT: .short .LBB0_4
|
; CHECK-NEXT: .short .LBB0_4
|
||||||
|
; CHECK-NEXT: .short .LBB0_3
|
||||||
; CHECK-NEXT: .short .LBB0_5
|
; CHECK-NEXT: .short .LBB0_5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user