Thumb-2 tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74345 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Goodwin 2009-06-26 22:37:07 +00:00
parent 9a80b459ed
commit 7f98cac93a
27 changed files with 318 additions and 15 deletions

View File

@ -1,6 +1,4 @@
; RUN: llvm-as < %s | llc | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#510} | count 5
target triple = "thumbv7-apple-darwin"
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#510} | count 5
; 171 = 0x000000ab
define i32 @f1(i32 %a) {

View File

@ -1,6 +1,4 @@
; RUN: llvm-as < %s | llc | grep {addw\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#4095} | count 1
target triple = "thumbv7-apple-darwin"
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {addw\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#4095} | count 1
define i32 @f1(i32 %a) {
%tmp = add i32 %a, 4095

View File

@ -1,6 +1,4 @@
; RUN: llvm-as < %s | llc | grep {adds\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
target triple = "thumbv7-apple-darwin"
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adds\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
; 171 = 0x000000ab
define i64 @f1(i64 %a) {

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = and i32 %a, %b
ret i32 %tmp
}

View File

@ -0,0 +1,31 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {and\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
; 171 = 0x000000ab
define i32 @f1(i32 %a) {
%tmp = and i32 %a, 171
ret i32 %tmp
}
; 1179666 = 0x00120012
define i32 @f2(i32 %a) {
%tmp = and i32 %a, 1179666
ret i32 %tmp
}
; 872428544 = 0x34003400
define i32 @f3(i32 %a) {
%tmp = and i32 %a, 872428544
ret i32 %tmp
}
; 1448498774 = 0x56565656
define i32 @f4(i32 %a) {
%tmp = and i32 %a, 1448498774
ret i32 %tmp
}
; 66846720 = 0x03fc0000
define i32 @f5(i32 %a) {
%tmp = and i32 %a, 66846720
ret i32 %tmp
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {asr\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = ashr i32 %a, %b
ret i32 %tmp
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {asr\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#17} | count 1
define i32 @f1(i32 %a) {
%tmp = ashr i32 %a, 17
ret i32 %tmp
}

View File

@ -0,0 +1,19 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "bfc " | count 3
; 4278190095 = 0xff00000f
define i32 @f1(i32 %a) {
%tmp = and i32 %a, 4278190095
ret i32 %tmp
}
; 4286578688 = 0xff800000
define i32 @f2(i32 %a) {
%tmp = and i32 %a, 4286578688
ret i32 %tmp
}
; 4095 = 0x00000fff
define i32 @f3(i32 %a) {
%tmp = and i32 %a, 4095
ret i32 %tmp
}

View File

@ -0,0 +1,25 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "bic " | grep {#187\\|#11141290\\|#3422604288\\|#1114112} | count 4
; ~0x000000bb = 4294967108
define i32 @f1(i32 %a) {
%tmp = and i32 %a, 4294967108
ret i32 %tmp
}
; ~0x00aa00aa = 4283826005
define i32 @f2(i32 %a) {
%tmp = and i32 %a, 4283826005
ret i32 %tmp
}
; ~0xcc00cc00 = 872363007
define i32 @f3(i32 %a) {
%tmp = and i32 %a, 872363007
ret i32 %tmp
}
; ~0x00110000 = 4293853183
define i32 @f4(i32 %a) {
%tmp = and i32 %a, 4293853183
ret i32 %tmp
}

View File

@ -0,0 +1,25 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "cmn " | grep {#187\\|#11141290\\|#3422604288\\|#1114112} | count 4
; -0x000000bb = 4294967109
define i1 @f1(i32 %a) {
%tmp = icmp ne i32 %a, 4294967109
ret i1 %tmp
}
; -0x00aa00aa = 4283826006
define i1 @f2(i32 %a) {
%tmp = icmp eq i32 %a, 4283826006
ret i1 %tmp
}
; -0xcc00cc00 = 872363008
define i1 @f3(i32 %a) {
%tmp = icmp ne i32 %a, 872363008
ret i1 %tmp
}
; -0x00110000 = 4293853184
define i1 @f4(i32 %a) {
%tmp = icmp eq i32 %a, 4293853184
ret i1 %tmp
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {eor\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = xor i32 %a, %b
ret i32 %tmp
}

View File

@ -0,0 +1,31 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "eor " | grep {#187\\|#11141290\\|#3422604288\\|#1114112\\|#3722304989} | count 5
; 0x000000bb = 187
define i32 @f1(i32 %a) {
%tmp = xor i32 %a, 187
ret i32 %tmp
}
; 0x00aa00aa = 11141290
define i32 @f2(i32 %a) {
%tmp = xor i32 %a, 11141290
ret i32 %tmp
}
; 0xcc00cc00 = 3422604288
define i32 @f3(i32 %a) {
%tmp = xor i32 %a, 3422604288
ret i32 %tmp
}
; 0xdddddddd = 3722304989
define i32 @f4(i32 %a) {
%tmp = xor i32 %a, 3722304989
ret i32 %tmp
}
; 0x00110000 = 1114112
define i32 @f5(i32 %a) {
%tmp = xor i32 %a, 1114112
ret i32 %tmp
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsl\\W*r\[0-9\],\\W*r\[0-9\],\\W*\[0-9\]} | count 1
define i32 @f1(i32 %a) {
%tmp = shl i32 %a, 5
ret i32 %tmp
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsl\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = shl i32 %a, %b
ret i32 %tmp
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsr\\W*r\[0-9\],\\W*r\[0-9\],\\W*\[0-9\]} | count 1
define i32 @f1(i32 %a) {
%tmp = lshr i32 %a, 13
ret i32 %tmp
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {lsr\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp = lshr i32 %a, %b
ret i32 %tmp
}

View File

@ -1,6 +1,4 @@
; RUN: llvm-as < %s | llc | grep {mov\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
target triple = "thumbv7-apple-darwin"
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mov\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
; 171 = 0x000000ab
define i32 @f1(i32 %a) {

View File

@ -1,6 +1,4 @@
; RUN: llvm-as < %s | llc | grep {movw\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#65535} | count 1
target triple = "thumbv7-apple-darwin"
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {movw\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#65535} | count 1
define i32 @f6(i32 %a) {
%tmp = add i32 0, 65535

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mul\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | count 1
define i32 @f1(i32 %a, i32 %b, i32 %c) {
%tmp = mul i32 %a, %b
ret i32 %tmp
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {rsb\\W*r\[0-9\],\\W*r\[0-9\],\\W*#0} | count 1
define i32 @f1(i32 %a) {
%tmp = sub i32 0, %a
ret i32 %tmp
}

View File

@ -0,0 +1,29 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*#\[0-9\]*} | grep {#187\\|#11141290\\|#3422604288\\|#1114112} | count 4
; 0x000000bb = 187
define i32 @f1(i32 %a) {
%tmp1 = xor i32 4294967295, 187
%tmp2 = or i32 %a, %tmp1
ret i32 %tmp2
}
; 0x00aa00aa = 11141290
define i32 @f2(i32 %a) {
%tmp1 = xor i32 4294967295, 11141290
%tmp2 = or i32 %a, %tmp1
ret i32 %tmp2
}
; 0xcc00cc00 = 3422604288
define i32 @f3(i32 %a) {
%tmp1 = xor i32 4294967295, 3422604288
%tmp2 = or i32 %a, %tmp1
ret i32 %tmp2
}
; 0x00110000 = 1114112
define i32 @f5(i32 %a) {
%tmp1 = xor i32 4294967295, 1114112
%tmp2 = or i32 %a, %tmp1
ret i32 %tmp2
}

View File

@ -0,0 +1,6 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
define i32 @f1(i32 %a, i32 %b) {
%tmp2 = or i32 %a, %b
ret i32 %tmp2
}

View File

@ -0,0 +1,31 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orr\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*#\[0-9\]*} | grep {#187\\|#11141290\\|#3422604288\\|#1145324612\\|#1114112} | count 5
; 0x000000bb = 187
define i32 @f1(i32 %a) {
%tmp2 = or i32 %a, 187
ret i32 %tmp2
}
; 0x00aa00aa = 11141290
define i32 @f2(i32 %a) {
%tmp2 = or i32 %a, 11141290
ret i32 %tmp2
}
; 0xcc00cc00 = 3422604288
define i32 @f3(i32 %a) {
%tmp2 = or i32 %a, 3422604288
ret i32 %tmp2
}
; 0x44444444 = 1145324612
define i32 @f4(i32 %a) {
%tmp2 = or i32 %a, 1145324612
ret i32 %tmp2
}
; 0x00110000 = 1114112
define i32 @f5(i32 %a) {
%tmp2 = or i32 %a, 1114112
ret i32 %tmp2
}

View File

@ -0,0 +1,8 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2,+v7a | grep {rev\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
define i32 @f1(i32 %a) {
%tmp = tail call i32 @llvm.bswap.i32(i32 %a)
ret i32 %tmp
}
declare i32 @llvm.bswap.i32(i32) nounwind readnone

View File

@ -0,0 +1,8 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ror\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*#\[0-9\]*} | grep 22 | count 1
define i32 @f1(i32 %a) {
%l8 = shl i32 %a, 10
%r8 = lshr i32 %a, 22
%tmp = or i32 %l8, %r8
ret i32 %tmp
}

View File

@ -0,0 +1,9 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ror\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
define i32 @f1(i32 %a, i32 %b) {
%db = sub i32 32, %b
%l8 = shl i32 %a, %b
%r8 = lshr i32 %a, %db
%tmp = or i32 %l8, %r8
ret i32 %tmp
}

View File

@ -0,0 +1,31 @@
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {rsb\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | count 5
; 171 = 0x000000ab
define i32 @f1(i32 %a) {
%tmp = sub i32 171, %a
ret i32 %tmp
}
; 1179666 = 0x00120012
define i32 @f2(i32 %a) {
%tmp = sub i32 1179666, %a
ret i32 %tmp
}
; 872428544 = 0x34003400
define i32 @f3(i32 %a) {
%tmp = sub i32 872428544, %a
ret i32 %tmp
}
; 1448498774 = 0x56565656
define i32 @f4(i32 %a) {
%tmp = sub i32 1448498774, %a
ret i32 %tmp
}
; 66846720 = 0x03fc0000
define i32 @f5(i32 %a) {
%tmp = sub i32 66846720, %a
ret i32 %tmp
}