Emit direction operand in binary insns that stores in memory.

llvm-svn: 91777
This commit is contained in:
Sanjiv Gupta 2009-12-19 13:52:01 +00:00
parent bdef02be69
commit 8ac077df57
2 changed files with 14 additions and 1 deletions

View File

@ -151,7 +151,7 @@ let mayStore = 1 in
class BinOpWF<bits<6> OpCode, string OpcStr, SDNode OpNode>:
ByteFormat<OpCode, (outs),
(ins GPR:$src, i8imm:$offset, i8mem:$ptrlo, i8imm:$ptrhi),
!strconcat(OpcStr, " $ptrlo + $offset"),
!strconcat(OpcStr, " $ptrlo + $offset, F"),
[(PIC16Store (OpNode GPR:$src, (PIC16Load diraddr:$ptrlo,
(i8 imm:$ptrhi),
(i8 imm:$offset))),

View File

@ -0,0 +1,13 @@
; RUN: llvm-as < %s | llc -march=pic16 | FileCheck %s
@a = common global i16 0, align 1 ; <i16*> [#uses=2]
define void @foo() nounwind {
entry:
%tmp = load i16* @a ; <i16> [#uses=1]
%add = add nsw i16 %tmp, 1 ; <i16> [#uses=1]
store i16 %add, i16* @a
;CHECK: movlw 1
;CHECK: addwf @a + 0, F
ret void
}