aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Alpha
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-10-31 19:50:55 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-10-31 19:50:55 +0000
commita54f6b16f9b7a30044a98de79a72dae4f2dcc04c (patch)
tree4a011d0a211f609e27860523876828cd54632c52 /test/CodeGen/Alpha
parent1a60aa7bc1e48150785402e0ae69276f78080d33 (diff)
downloadexternal_llvm-a54f6b16f9b7a30044a98de79a72dae4f2dcc04c.zip
external_llvm-a54f6b16f9b7a30044a98de79a72dae4f2dcc04c.tar.gz
external_llvm-a54f6b16f9b7a30044a98de79a72dae4f2dcc04c.tar.bz2
make one giant add and sub tester
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Alpha')
-rw-r--r--test/CodeGen/Alpha/add.ll183
-rw-r--r--test/CodeGen/Alpha/mul5.ll5
-rw-r--r--test/CodeGen/Alpha/s4addl.ll14
-rw-r--r--test/CodeGen/Alpha/s4addq.ll11
4 files changed, 188 insertions, 25 deletions
diff --git a/test/CodeGen/Alpha/add.ll b/test/CodeGen/Alpha/add.ll
new file mode 100644
index 0000000..ce23434
--- /dev/null
+++ b/test/CodeGen/Alpha/add.ll
@@ -0,0 +1,183 @@
+;test all the shifted and signextending adds and subs with and without consts
+
+; RUN: llvm-as < %s | llc -march=alpha | grep ' addl' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep ' addq' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep ' subl' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep ' subq' |wc -l |grep 1
+; RUN: llvm-as < %s | llc -march=alpha | grep 'lda $0,-100($16)' |wc -l |grep 1
+
+; RUN: llvm-as < %s | llc -march=alpha | grep 's4addl' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep 's8addl' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep 's4addq' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep 's8addq' |wc -l |grep 2
+
+; RUN: llvm-as < %s | llc -march=alpha | grep 's4subl' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep 's8subl' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep 's4subq' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep 's8subq' |wc -l |grep 2
+
+implementation ; Functions:
+
+int %al(int %x, int %y) {
+entry:
+ %tmp.3 = add int %y, %x
+ ret int %tmp.3
+}
+
+int %ali(int %x) {
+entry:
+ %tmp.3 = add int 100, %x
+ ret int %tmp.3
+}
+
+long %aq(long %x, long %y) {
+entry:
+ %tmp.3 = add long %y, %x
+ ret long %tmp.3
+}
+long %aqi(long %x) {
+entry:
+ %tmp.3 = add long 100, %x
+ ret long %tmp.3
+}
+
+int %sl(int %x, int %y) {
+entry:
+ %tmp.3 = sub int %y, %x
+ ret int %tmp.3
+}
+
+int %sli(int %x) {
+entry:
+ %tmp.3 = sub int %x, 100
+ ret int %tmp.3
+}
+
+long %sq(long %x, long %y) {
+entry:
+ %tmp.3 = sub long %y, %x
+ ret long %tmp.3
+}
+long %sqi(long %x) {
+entry:
+ %tmp.3 = sub long %x, 100
+ ret long %tmp.3
+}
+
+
+
+int %a4l(int %x, int %y) {
+entry:
+ %tmp.1 = shl int %y, ubyte 2
+ %tmp.3 = add int %tmp.1, %x
+ ret int %tmp.3
+}
+
+int %a8l(int %x, int %y) {
+entry:
+ %tmp.1 = shl int %y, ubyte 3
+ %tmp.3 = add int %tmp.1, %x
+ ret int %tmp.3
+}
+
+long %a4q(long %x, long %y) {
+entry:
+ %tmp.1 = shl long %y, ubyte 2
+ %tmp.3 = add long %tmp.1, %x
+ ret long %tmp.3
+}
+
+long %a8q(long %x, long %y) {
+entry:
+ %tmp.1 = shl long %y, ubyte 3
+ %tmp.3 = add long %tmp.1, %x
+ ret long %tmp.3
+}
+
+int %a4li(int %y) {
+entry:
+ %tmp.1 = shl int %y, ubyte 2
+ %tmp.3 = add int 100, %tmp.1
+ ret int %tmp.3
+}
+
+int %a8li(int %y) {
+entry:
+ %tmp.1 = shl int %y, ubyte 3
+ %tmp.3 = add int 100, %tmp.1
+ ret int %tmp.3
+}
+
+long %a4qi(long %y) {
+entry:
+ %tmp.1 = shl long %y, ubyte 2
+ %tmp.3 = add long 100, %tmp.1
+ ret long %tmp.3
+}
+
+long %a8qi(long %y) {
+entry:
+ %tmp.1 = shl long %y, ubyte 3
+ %tmp.3 = add long 100, %tmp.1
+ ret long %tmp.3
+}
+
+
+
+
+int %s4l(int %x, int %y) {
+entry:
+ %tmp.1 = shl int %y, ubyte 2
+ %tmp.3 = sub int %tmp.1, %x
+ ret int %tmp.3
+}
+
+int %s8l(int %x, int %y) {
+entry:
+ %tmp.1 = shl int %y, ubyte 3
+ %tmp.3 = sub int %tmp.1, %x
+ ret int %tmp.3
+}
+
+long %s4q(long %x, long %y) {
+entry:
+ %tmp.1 = shl long %y, ubyte 2
+ %tmp.3 = sub long %tmp.1, %x
+ ret long %tmp.3
+}
+
+long %s8q(long %x, long %y) {
+entry:
+ %tmp.1 = shl long %y, ubyte 3
+ %tmp.3 = sub long %tmp.1, %x
+ ret long %tmp.3
+}
+
+int %s4li(int %y) {
+entry:
+ %tmp.1 = shl int %y, ubyte 2
+ %tmp.3 = sub int %tmp.1, 100
+ ret int %tmp.3
+}
+
+int %s8li(int %y) {
+entry:
+ %tmp.1 = shl int %y, ubyte 3
+ %tmp.3 = sub int %tmp.1, 100
+ ret int %tmp.3
+}
+
+long %s4qi(long %y) {
+entry:
+ %tmp.1 = shl long %y, ubyte 2
+ %tmp.3 = sub long %tmp.1, 100
+ ret long %tmp.3
+}
+
+long %s8qi(long %y) {
+entry:
+ %tmp.1 = shl long %y, ubyte 3
+ %tmp.3 = sub long %tmp.1, 100
+ ret long %tmp.3
+}
+
diff --git a/test/CodeGen/Alpha/mul5.ll b/test/CodeGen/Alpha/mul5.ll
index 2c7a358..4f2a4c2 100644
--- a/test/CodeGen/Alpha/mul5.ll
+++ b/test/CodeGen/Alpha/mul5.ll
@@ -22,6 +22,11 @@ entry:
ulong %foo4ln(ulong %x) {
entry:
+ %tmp.1 = mul ulong %x, 508
+ ret ulong %tmp.1
+}
+ulong %foo4ln_more(ulong %x) {
+entry:
%tmp.1 = mul ulong %x, 252
ret ulong %tmp.1
}
diff --git a/test/CodeGen/Alpha/s4addl.ll b/test/CodeGen/Alpha/s4addl.ll
deleted file mode 100644
index 1a92d63..0000000
--- a/test/CodeGen/Alpha/s4addl.ll
+++ /dev/null
@@ -1,14 +0,0 @@
-; Make sure this testcase codegens to the bic instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep 's4addl'
-
-; ModuleID = 'test.o'
-deplibs = [ "c", "crtend" ]
-
-implementation ; Functions:
-
-int %foo(int %x, int %y) {
-entry:
- %tmp.1 = shl int %y, ubyte 2 ; <int> [#uses=1]
- %tmp.3 = add int %tmp.1, %x ; <int> [#uses=1]
- ret int %tmp.3
-}
diff --git a/test/CodeGen/Alpha/s4addq.ll b/test/CodeGen/Alpha/s4addq.ll
deleted file mode 100644
index 7f6ed5c..0000000
--- a/test/CodeGen/Alpha/s4addq.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; Make sure this testcase codegens to the S4ADDQ instruction
-; RUN: llvm-as < %s | llc -march=alpha | grep 's4addq'
-
-implementation ; Functions:
-
-long %bar(long %x, long %y) {
-entry:
- %tmp.1 = shl long %x, ubyte 2 ; <long> [#uses=1]
- %tmp.3 = add long %tmp.1, %y ; <long> [#uses=1]
- ret long %tmp.3
-}