summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Hexagon/adde.ll
diff options
context:
space:
mode:
authorJyotsna Verma <jverma@codeaurora.org>2013-03-05 19:04:47 +0000
committerJyotsna Verma <jverma@codeaurora.org>2013-03-05 19:04:47 +0000
commit0eeea14e3e7b8e5107ed05f999673e5760ca5688 (patch)
tree641bf0161bf198b8484cdc363a1fff86f01eeb2f /llvm/test/CodeGen/Hexagon/adde.ll
parenta96569c6409195214240923996c04e54fc9352a0 (diff)
downloadbcm5719-llvm-0eeea14e3e7b8e5107ed05f999673e5760ca5688.tar.gz
bcm5719-llvm-0eeea14e3e7b8e5107ed05f999673e5760ca5688.zip
Hexagon: Expand addc, adde, subc and sube.
llvm-svn: 176505
Diffstat (limited to 'llvm/test/CodeGen/Hexagon/adde.ll')
-rw-r--r--llvm/test/CodeGen/Hexagon/adde.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Hexagon/adde.ll b/llvm/test/CodeGen/Hexagon/adde.ll
new file mode 100644
index 00000000000..9cee3e215d6
--- /dev/null
+++ b/llvm/test/CodeGen/Hexagon/adde.ll
@@ -0,0 +1,34 @@
+; RUN: llc -march=hexagon < %s | FileCheck %s
+
+; CHECK: r{{[0-9]+:[0-9]+}} = #0
+; CHECK: r{{[0-9]+:[0-9]+}} = #1
+; CHECK: r{{[0-9]+:[0-9]+}} = add(r{{[0-9]+:[0-9]+}}, r{{[0-9]+:[0-9]+}})
+; CHECK: p{{[0-9]+}} = cmp.gtu(r{{[0-9]+:[0-9]+}}, r{{[0-9]+:[0-9]+}})
+; CHECK: p{{[0-9]+}} = cmp.gtu(r{{[0-9]+:[0-9]+}}, r{{[0-9]+:[0-9]+}})
+; CHECK: r{{[0-9]+}} = mux(p{{[0-9]+}}, r{{[0-9]+}}, r{{[0-9]+}})
+; CHECK: r{{[0-9]+}} = mux(p{{[0-9]+}}, r{{[0-9]+}}, r{{[0-9]+}})
+; CHECK: r{{[0-9]+:[0-9]+}} = combine(r{{[0-9]+}}, r{{[0-9]+}})
+; CHECK: r{{[0-9]+}} = mux(p{{[0-9]+}}, r{{[0-9]+}}, r{{[0-9]+}})
+; CHECK: r{{[0-9]+}} = mux(p{{[0-9]+}}, r{{[0-9]+}}, r{{[0-9]+}})
+; CHECK: r{{[0-9]+:[0-9]+}} = combine(r{{[0-9]+}}, r{{[0-9]+}})
+; CHECK: r{{[0-9]+:[0-9]+}} = add(r{{[0-9]+:[0-9]+}}, r{{[0-9]+:[0-9]+}})
+
+
+define void @check_adde_addc (i64 %AL, i64 %AH, i64 %BL, i64 %BH, i64* %RL, i64* %RH) {
+entry:
+ %tmp1 = zext i64 %AL to i128
+ %tmp23 = zext i64 %AH to i128
+ %tmp4 = shl i128 %tmp23, 64
+ %tmp5 = or i128 %tmp4, %tmp1
+ %tmp67 = zext i64 %BL to i128
+ %tmp89 = zext i64 %BH to i128
+ %tmp11 = shl i128 %tmp89, 64
+ %tmp12 = or i128 %tmp11, %tmp67
+ %tmp15 = add i128 %tmp12, %tmp5
+ %tmp1617 = trunc i128 %tmp15 to i64
+ store i64 %tmp1617, i64* %RL
+ %tmp21 = lshr i128 %tmp15, 64
+ %tmp2122 = trunc i128 %tmp21 to i64
+ store i64 %tmp2122, i64* %RH
+ ret void
+} \ No newline at end of file
OpenPOWER on IntegriCloud