diff options
Diffstat (limited to 'test/CodeGen/Thumb2')
-rw-r--r-- | test/CodeGen/Thumb2/2010-05-24-rsbs.ll | 9 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/div.ll | 45 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/machine-licm.ll | 45 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/sign_extend_inreg.ll | 22 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-pack.ll | 4 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-rev.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-shifter.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-smla.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-smul.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-spill-q.ll | 3 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-sxt_rot.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-uxt_rot.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-uxtb.ll | 2 |
13 files changed, 126 insertions, 16 deletions
diff --git a/test/CodeGen/Thumb2/2010-05-24-rsbs.ll b/test/CodeGen/Thumb2/2010-05-24-rsbs.ll new file mode 100644 index 0000000..7a40aa9 --- /dev/null +++ b/test/CodeGen/Thumb2/2010-05-24-rsbs.ll @@ -0,0 +1,9 @@ +; RUN: llc < %s -mtriple=thumbv7-apple-darwin | FileCheck %s +; Radar 8017376: Missing 's' suffix for t2RSBS instructions. +; CHECK: rsbs + +define arm_apcscc i64 @test(i64 %x) nounwind readnone { +entry: + %0 = sub nsw i64 1, %x ; <i64> [#uses=1] + ret i64 %0 +} diff --git a/test/CodeGen/Thumb2/div.ll b/test/CodeGen/Thumb2/div.ll new file mode 100644 index 0000000..0cddd48 --- /dev/null +++ b/test/CodeGen/Thumb2/div.ll @@ -0,0 +1,45 @@ +; RUN: llc < %s -march=thumb -mattr=+thumb2 \ +; RUN: | FileCheck %s -check-prefix=CHECK-THUMB +; RUN: llc < %s -march=arm -mcpu=cortex-m3 -mattr=+thumb2 \ +; RUN: | FileCheck %s -check-prefix=CHECK-THUMBV7M + +define i32 @f1(i32 %a, i32 %b) { +entry: +; CHECK-THUMB: f1 +; CHECK-THUMB: __divsi3 +; CHECK-THUMBV7M: f1 +; CHECK-THUMBV7M: sdiv + %tmp1 = sdiv i32 %a, %b ; <i32> [#uses=1] + ret i32 %tmp1 +} + +define i32 @f2(i32 %a, i32 %b) { +entry: +; CHECK-THUMB: f2 +; CHECK-THUMB: __udivsi3 +; CHECK-THUMBV7M: f2 +; CHECK-THUMBV7M: udiv + %tmp1 = udiv i32 %a, %b ; <i32> [#uses=1] + ret i32 %tmp1 +} + +define i32 @f3(i32 %a, i32 %b) { +entry: +; CHECK-THUMB: f3 +; CHECK-THUMB: __modsi3 +; CHECK-THUMBV7M: f3 +; CHECK-THUMBV7M: sdiv + %tmp1 = srem i32 %a, %b ; <i32> [#uses=1] + ret i32 %tmp1 +} + +define i32 @f4(i32 %a, i32 %b) { +entry: +; CHECK-THUMB: f4 +; CHECK-THUMB: __umodsi3 +; CHECK-THUMBV7M: f4 +; CHECK-THUMBV7M: udiv + %tmp1 = urem i32 %a, %b ; <i32> [#uses=1] + ret i32 %tmp1 +} + diff --git a/test/CodeGen/Thumb2/machine-licm.ll b/test/CodeGen/Thumb2/machine-licm.ll index c298aa2..98acc28 100644 --- a/test/CodeGen/Thumb2/machine-licm.ll +++ b/test/CodeGen/Thumb2/machine-licm.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -mtriple=thumbv7-apple-darwin -disable-fp-elim | FileCheck %s -; RUN: llc < %s -mtriple=thumbv7-apple-darwin -relocation-model=pic -disable-fp-elim | FileCheck %s --check-prefix=PIC +; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -disable-fp-elim | FileCheck %s +; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim | FileCheck %s --check-prefix=PIC ; rdar://7353541 ; rdar://7354376 @@ -8,9 +8,9 @@ @GV = external global i32 ; <i32*> [#uses=2] -define arm_apcscc void @t(i32* nocapture %vals, i32 %c) nounwind { +define arm_apcscc void @t1(i32* nocapture %vals, i32 %c) nounwind { entry: -; CHECK: t: +; CHECK: t1: ; CHECK: cbz %0 = icmp eq i32 %c, 0 ; <i1> [#uses=1] br i1 %0, label %return, label %bb.nph @@ -22,8 +22,7 @@ bb.nph: ; preds = %entry ; CHECK: ldr r3, [r2] ; CHECK: LBB0_2 ; CHECK: LCPI0_0: -; CHECK-NOT: LCPI1_1: -; CHECK: .section +; CHECK-NOT: LCPI0_1: ; PIC: BB#1 ; PIC: ldr.n r2, LCPI0_0 @@ -51,3 +50,37 @@ bb: ; preds = %bb, %bb.nph return: ; preds = %bb, %entry ret void } + +; rdar://8001136 +define arm_apcscc void @t2(i8* %ptr1, i8* %ptr2) nounwind { +entry: +; CHECK: t2: +; CHECK: adr r{{.}}, #LCPI1_0 +; CHECK: vldmia r3, {d0,d1} + br i1 undef, label %bb1, label %bb2 + +bb1: +; CHECK-NEXT: %bb1 + %indvar = phi i32 [ %indvar.next, %bb1 ], [ 0, %entry ] + %tmp1 = shl i32 %indvar, 2 + %gep1 = getelementptr i8* %ptr1, i32 %tmp1 + %tmp2 = call <4 x float> @llvm.arm.neon.vld1.v4f32(i8* %gep1) + %tmp3 = call <4 x float> @llvm.arm.neon.vmaxs.v4f32(<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float> %tmp2) + %gep2 = getelementptr i8* %ptr2, i32 %tmp1 + call void @llvm.arm.neon.vst1.v4f32(i8* %gep2, <4 x float> %tmp3) + %indvar.next = add i32 %indvar, 1 + %cond = icmp eq i32 %indvar.next, 10 + br i1 %cond, label %bb2, label %bb1 + +bb2: + ret void +} + +; CHECK: LCPI1_0: +; CHECK: .section + +declare <4 x float> @llvm.arm.neon.vld1.v4f32(i8*) nounwind readonly + +declare void @llvm.arm.neon.vst1.v4f32(i8*, <4 x float>) nounwind + +declare <4 x float> @llvm.arm.neon.vmaxs.v4f32(<4 x float>, <4 x float>) nounwind readnone diff --git a/test/CodeGen/Thumb2/sign_extend_inreg.ll b/test/CodeGen/Thumb2/sign_extend_inreg.ll new file mode 100644 index 0000000..9a02c1c --- /dev/null +++ b/test/CodeGen/Thumb2/sign_extend_inreg.ll @@ -0,0 +1,22 @@ +; RUN: llc < %s -mcpu=cortex-a8 | FileCheck %s -check-prefix=CHECK-A8 +; RUN: llc < %s -mcpu=cortex-m3 | FileCheck %s -check-prefix=CHECK-M3 + +target triple = "thumbv7-apple-darwin10" + +define arm_apcscc i32 @f1(i16* %ptr) nounwind { +; CHECK-A8: f1 +; CHECK-A8: sxth +; CHECK-M3: f1 +; CHECK-M3-NOT: sxth +; CHECK-M3: bx lr + %1 = load i16* %ptr + %2 = icmp eq i16 %1, 1 + %3 = sext i16 %1 to i32 + br i1 %2, label %.next, label %.exit + +.next: + br label %.exit + +.exit: + ret i32 %3 +} diff --git a/test/CodeGen/Thumb2/thumb2-pack.ll b/test/CodeGen/Thumb2/thumb2-pack.ll index a982249..c8302df 100644 --- a/test/CodeGen/Thumb2/thumb2-pack.ll +++ b/test/CodeGen/Thumb2/thumb2-pack.ll @@ -1,6 +1,6 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2 | \ +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | \ ; RUN: grep pkhbt | count 5 -; RUN: llc < %s -march=thumb -mattr=+thumb2 | \ +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | \ ; RUN: grep pkhtb | count 4 define i32 @test1(i32 %X, i32 %Y) { diff --git a/test/CodeGen/Thumb2/thumb2-rev.ll b/test/CodeGen/Thumb2/thumb2-rev.ll index 27b1672..2cee2e3 100644 --- a/test/CodeGen/Thumb2/thumb2-rev.ll +++ b/test/CodeGen/Thumb2/thumb2-rev.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2,+v7a | FileCheck %s +; RUN: llc < %s -march=thumb -mattr=+thumb2,+v7a,+t2xtpk | FileCheck %s define i32 @f1(i32 %a) { ; CHECK: f1: diff --git a/test/CodeGen/Thumb2/thumb2-shifter.ll b/test/CodeGen/Thumb2/thumb2-shifter.ll index b106ced..98854a1 100644 --- a/test/CodeGen/Thumb2/thumb2-shifter.ll +++ b/test/CodeGen/Thumb2/thumb2-shifter.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | FileCheck %s define i32 @t2ADDrs_lsl(i32 %X, i32 %Y) { ; CHECK: t2ADDrs_lsl diff --git a/test/CodeGen/Thumb2/thumb2-smla.ll b/test/CodeGen/Thumb2/thumb2-smla.ll index 092ec27..bd4dcbe 100644 --- a/test/CodeGen/Thumb2/thumb2-smla.ll +++ b/test/CodeGen/Thumb2/thumb2-smla.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | FileCheck %s define i32 @f3(i32 %a, i16 %x, i32 %y) { ; CHECK: f3 diff --git a/test/CodeGen/Thumb2/thumb2-smul.ll b/test/CodeGen/Thumb2/thumb2-smul.ll index 16ea85d..ae17535 100644 --- a/test/CodeGen/Thumb2/thumb2-smul.ll +++ b/test/CodeGen/Thumb2/thumb2-smul.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | FileCheck %s @x = weak global i16 0 ; <i16*> [#uses=1] @y = weak global i16 0 ; <i16*> [#uses=0] diff --git a/test/CodeGen/Thumb2/thumb2-spill-q.ll b/test/CodeGen/Thumb2/thumb2-spill-q.ll index ff178b4..bf9c052 100644 --- a/test/CodeGen/Thumb2/thumb2-spill-q.ll +++ b/test/CodeGen/Thumb2/thumb2-spill-q.ll @@ -46,7 +46,8 @@ bb4: ; preds = %bb193, %entry %20 = shufflevector <2 x float> %19, <2 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1] %21 = fadd <4 x float> zeroinitializer, %20 ; <<4 x float>> [#uses=2] %22 = fcmp ogt <4 x float> %besterror.0.2264, %21 ; <<4 x i1>> [#uses=0] - br i1 undef, label %bb193, label %bb186 + %tmp = extractelement <4 x i1> %22, i32 0 + br i1 %tmp, label %bb193, label %bb186 bb186: ; preds = %bb4 br label %bb193 diff --git a/test/CodeGen/Thumb2/thumb2-sxt_rot.ll b/test/CodeGen/Thumb2/thumb2-sxt_rot.ll index 054d5df..4b685a8 100644 --- a/test/CodeGen/Thumb2/thumb2-sxt_rot.ll +++ b/test/CodeGen/Thumb2/thumb2-sxt_rot.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | FileCheck %s define i32 @test0(i8 %A) { ; CHECK: test0 diff --git a/test/CodeGen/Thumb2/thumb2-uxt_rot.ll b/test/CodeGen/Thumb2/thumb2-uxt_rot.ll index 75e1d70..b8e4381 100644 --- a/test/CodeGen/Thumb2/thumb2-uxt_rot.ll +++ b/test/CodeGen/Thumb2/thumb2-uxt_rot.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | FileCheck %s define i8 @test1(i32 %A.u) zeroext { ; CHECK: test1 diff --git a/test/CodeGen/Thumb2/thumb2-uxtb.ll b/test/CodeGen/Thumb2/thumb2-uxtb.ll index 91598cd..5411914 100644 --- a/test/CodeGen/Thumb2/thumb2-uxtb.ll +++ b/test/CodeGen/Thumb2/thumb2-uxtb.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -march=thumb -mattr=+thumb2 | FileCheck %s +; RUN: llc < %s -march=thumb -mattr=+thumb2,+t2xtpk | FileCheck %s define i32 @test1(i32 %x) { ; CHECK: test1 |