summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-12-19 13:52:01 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-12-19 13:52:01 +0000
commit8ac077df57ee31e89e727c0f218492e1ae0cc730 (patch)
treeb41f7f5fda6664da603af6d55c85bb60a13428a0
parentbdef02be691864c5b2308d1ca1a836fe1612a949 (diff)
downloadbcm5719-llvm-8ac077df57ee31e89e727c0f218492e1ae0cc730.tar.gz
bcm5719-llvm-8ac077df57ee31e89e727c0f218492e1ae0cc730.zip
Emit direction operand in binary insns that stores in memory.
llvm-svn: 91777
-rw-r--r--llvm/lib/Target/PIC16/PIC16InstrInfo.td2
-rw-r--r--llvm/test/CodeGen/PIC16/result_direction.ll13
2 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16InstrInfo.td b/llvm/lib/Target/PIC16/PIC16InstrInfo.td
index 5eec6c4e66b..bf4baf39402 100644
--- a/llvm/lib/Target/PIC16/PIC16InstrInfo.td
+++ b/llvm/lib/Target/PIC16/PIC16InstrInfo.td
@@ -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))),
diff --git a/llvm/test/CodeGen/PIC16/result_direction.ll b/llvm/test/CodeGen/PIC16/result_direction.ll
new file mode 100644
index 00000000000..8549e21b333
--- /dev/null
+++ b/llvm/test/CodeGen/PIC16/result_direction.ll
@@ -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
+}
OpenPOWER on IntegriCloud