diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
commit | 71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch) | |
tree | 5343938942df402b49ec7300a1c25a2d4ccd5821 /test/CodeGen/Thumb2 | |
parent | 31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff) |
Vendor import of llvm trunk r300422:vendor/llvm/llvm-trunk-r300422
Notes
Notes:
svn path=/vendor/llvm/dist/; revision=317017
svn path=/vendor/llvm/llvm-trunk-r300422/; revision=317018; tag=vendor/llvm/llvm-trunk-r300422
Diffstat (limited to 'test/CodeGen/Thumb2')
-rw-r--r-- | test/CodeGen/Thumb2/cbnz.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/float-cmp.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/ifcvt-compare.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/ifcvt-rescan-bug-2016-08-22.ll | 4 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/intrinsics-coprocessor.ll | 93 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/stack_guard_remat.ll | 8 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/tbb-removeadd.mir | 124 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-pack.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-rev.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-smla.ll | 4 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-smul.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-sxt-uxt.ll | 51 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-sxt_rot.ll | 31 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-uxt_rot.ll | 41 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-uxtb.ll | 120 | ||||
-rw-r--r-- | test/CodeGen/Thumb2/v8_IT_4.ll | 5 |
16 files changed, 360 insertions, 147 deletions
diff --git a/test/CodeGen/Thumb2/cbnz.ll b/test/CodeGen/Thumb2/cbnz.ll index 5c0bb5bfe1cd..e11c4038678c 100644 --- a/test/CodeGen/Thumb2/cbnz.ll +++ b/test/CodeGen/Thumb2/cbnz.ll @@ -26,7 +26,7 @@ t: call void @x() call void @x() call void @x() - ; CHECK: cbnz + ; CHECK: cbz %q = icmp eq i32 %y, 0 br i1 %q, label %t2, label %f diff --git a/test/CodeGen/Thumb2/float-cmp.ll b/test/CodeGen/Thumb2/float-cmp.ll index 77b0999337c6..834812cddd6d 100644 --- a/test/CodeGen/Thumb2/float-cmp.ll +++ b/test/CodeGen/Thumb2/float-cmp.ll @@ -15,7 +15,7 @@ define i1 @cmp_f_false(float %a, float %b) { define i1 @cmp_f_oeq(float %a, float %b) { ; CHECK-LABEL: cmp_f_oeq: ; NONE: bl __aeabi_fcmpeq -; HARD: vcmpe.f32 +; HARD: vcmp.f32 ; HARD: moveq r0, #1 %1 = fcmp oeq float %a, %b ret i1 %1 @@ -56,7 +56,7 @@ define i1 @cmp_f_one(float %a, float %b) { ; CHECK-LABEL: cmp_f_one: ; NONE: bl __aeabi_fcmpgt ; NONE: bl __aeabi_fcmplt -; HARD: vcmpe.f32 +; HARD: vcmp.f32 ; HARD: movmi r0, #1 ; HARD: movgt r0, #1 %1 = fcmp one float %a, %b @@ -73,7 +73,7 @@ define i1 @cmp_f_ord(float %a, float %b) { ; CHECK-LABEL: cmp_f_ueq: ; NONE: bl __aeabi_fcmpeq ; NONE: bl __aeabi_fcmpun -; HARD: vcmpe.f32 +; HARD: vcmp.f32 ; HARD: moveq r0, #1 ; HARD: movvs r0, #1 %1 = fcmp ueq float %a, %b @@ -122,7 +122,7 @@ define i1 @cmp_f_ule(float %a, float %b) { define i1 @cmp_f_une(float %a, float %b) { ; CHECK-LABEL: cmp_f_une: ; NONE: bl __aeabi_fcmpeq -; HARD: vcmpe.f32 +; HARD: vcmp.f32 ; HARD: movne r0, #1 %1 = fcmp une float %a, %b ret i1 %1 @@ -154,7 +154,7 @@ define i1 @cmp_d_oeq(double %a, double %b) { ; CHECK-LABEL: cmp_d_oeq: ; NONE: bl __aeabi_dcmpeq ; SP: bl __aeabi_dcmpeq -; DP: vcmpe.f64 +; DP: vcmp.f64 ; DP: moveq r0, #1 %1 = fcmp oeq double %a, %b ret i1 %1 @@ -201,7 +201,7 @@ define i1 @cmp_d_one(double %a, double %b) { ; NONE: bl __aeabi_dcmplt ; SP: bl __aeabi_dcmpgt ; SP: bl __aeabi_dcmplt -; DP: vcmpe.f64 +; DP: vcmp.f64 ; DP: movmi r0, #1 ; DP: movgt r0, #1 %1 = fcmp one double %a, %b @@ -259,7 +259,7 @@ define i1 @cmp_d_ueq(double %a, double %b) { ; NONE: bl __aeabi_dcmpun ; SP: bl __aeabi_dcmpeq ; SP: bl __aeabi_dcmpun -; DP: vcmpe.f64 +; DP: vcmp.f64 ; DP: moveq r0, #1 ; DP: movvs r0, #1 %1 = fcmp ueq double %a, %b @@ -290,7 +290,7 @@ define i1 @cmp_d_une(double %a, double %b) { ; CHECK-LABEL: cmp_d_une: ; NONE: bl __aeabi_dcmpeq ; SP: bl __aeabi_dcmpeq -; DP: vcmpe.f64 +; DP: vcmp.f64 ; DP: movne r0, #1 %1 = fcmp une double %a, %b ret i1 %1 diff --git a/test/CodeGen/Thumb2/ifcvt-compare.ll b/test/CodeGen/Thumb2/ifcvt-compare.ll index 7b5ce4fa3f5f..688195f579eb 100644 --- a/test/CodeGen/Thumb2/ifcvt-compare.ll +++ b/test/CodeGen/Thumb2/ifcvt-compare.ll @@ -4,7 +4,7 @@ declare void @x() define void @f0(i32 %x) optsize { ; CHECK-LABEL: f0: - ; CHECK: cbnz + ; CHECK: cbz %p = icmp eq i32 %x, 0 br i1 %p, label %t, label %f diff --git a/test/CodeGen/Thumb2/ifcvt-rescan-bug-2016-08-22.ll b/test/CodeGen/Thumb2/ifcvt-rescan-bug-2016-08-22.ll index ae3084dcc62e..65ee4283b3f7 100644 --- a/test/CodeGen/Thumb2/ifcvt-rescan-bug-2016-08-22.ll +++ b/test/CodeGen/Thumb2/ifcvt-rescan-bug-2016-08-22.ll @@ -3,7 +3,7 @@ target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "thumbv7-unknown-linux-gnueabihf" ; Function Attrs: argmemonly nounwind -declare void @llvm.lifetime.start(i64, i8* nocapture) #0 +declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #0 ; Function Attrs: nounwind declare void @_ZNSaIcEC2Ev() unnamed_addr #0 align 2 @@ -25,7 +25,7 @@ define hidden void @_ZN4llvm14DOTGraphTraitsIPNS_13ScheduleDAGMIEE17getEdgeAttri br label %3 ; <label>:2: ; preds = %0 - call void @llvm.lifetime.start(i64 1, i8* undef) #0 + call void @llvm.lifetime.start.p0i8(i64 1, i8* undef) #0 call void @_ZNSaIcEC2Ev() #0 br label %3 diff --git a/test/CodeGen/Thumb2/intrinsics-coprocessor.ll b/test/CodeGen/Thumb2/intrinsics-coprocessor.ll new file mode 100644 index 000000000000..248ec223a61e --- /dev/null +++ b/test/CodeGen/Thumb2/intrinsics-coprocessor.ll @@ -0,0 +1,93 @@ +; RUN: llc < %s -march=thumb -mtriple=thumbv7-eabi -mcpu=cortex-a8 -show-mc-encoding | FileCheck %s +define void @coproc(i8* %i) nounwind { +entry: + ; CHECK: mrc p7, #1, r{{[0-9]+}}, c1, c1, #4 + %0 = tail call i32 @llvm.arm.mrc(i32 7, i32 1, i32 1, i32 1, i32 4) nounwind + ; CHECK: mcr p7, #1, r{{[0-9]+}}, c1, c1, #4 + tail call void @llvm.arm.mcr(i32 7, i32 1, i32 %0, i32 1, i32 1, i32 4) nounwind + ; CHECK: mrc2 p7, #1, r{{[0-9]+}}, c1, c1, #4 + %1 = tail call i32 @llvm.arm.mrc2(i32 7, i32 1, i32 1, i32 1, i32 4) nounwind + ; CHECK: mcr2 p7, #1, r{{[0-9]+}}, c1, c1, #4 + tail call void @llvm.arm.mcr2(i32 7, i32 1, i32 %1, i32 1, i32 1, i32 4) nounwind + ; CHECK: mcrr p7, #1, r{{[0-9]+}}, r{{[0-9]+}}, c1 + tail call void @llvm.arm.mcrr(i32 7, i32 1, i32 %0, i32 %1, i32 1) nounwind + ; CHECK: mcrr2 p7, #1, r{{[0-9]+}}, r{{[0-9]+}}, c1 + tail call void @llvm.arm.mcrr2(i32 7, i32 1, i32 %0, i32 %1, i32 1) nounwind + ; CHECK: cdp p7, #3, c1, c1, c1, #5 + tail call void @llvm.arm.cdp(i32 7, i32 3, i32 1, i32 1, i32 1, i32 5) nounwind + ; CHECK: cdp2 p7, #3, c1, c1, c1, #5 + tail call void @llvm.arm.cdp2(i32 7, i32 3, i32 1, i32 1, i32 1, i32 5) nounwind + ; CHECK: ldc p7, c3, [r{{[0-9]+}}] + tail call void @llvm.arm.ldc(i32 7, i32 3, i8* %i) nounwind + ; CHECK: ldcl p7, c3, [r{{[0-9]+}}] + tail call void @llvm.arm.ldcl(i32 7, i32 3, i8* %i) nounwind + ; CHECK: ldc2 p7, c3, [r{{[0-9]+}}] + tail call void @llvm.arm.ldc2(i32 7, i32 3, i8* %i) nounwind + ; CHECK: ldc2l p7, c3, [r{{[0-9]+}}] + tail call void @llvm.arm.ldc2l(i32 7, i32 3, i8* %i) nounwind + ; CHECK: stc p7, c3, [r{{[0-9]+}}] + tail call void @llvm.arm.stc(i32 7, i32 3, i8* %i) nounwind + ; CHECK: stcl p7, c3, [r{{[0-9]+}}] + tail call void @llvm.arm.stcl(i32 7, i32 3, i8* %i) nounwind + ; CHECK: stc2 p7, c3, [r{{[0-9]+}}] + tail call void @llvm.arm.stc2(i32 7, i32 3, i8* %i) nounwind + ; CHECK: stc2l p7, c3, [r{{[0-9]+}}] + tail call void @llvm.arm.stc2l(i32 7, i32 3, i8* %i) nounwind + ; CHECK: mrrc p1, #2, r{{[0-9]+}}, r{{[0-9]+}}, c3 + %2 = tail call { i32, i32 } @llvm.arm.mrrc(i32 1, i32 2, i32 3) nounwind + ; CHECK: mrrc2 p1, #2, r{{[0-9]+}}, r{{[0-9]+}}, c3 + %3 = tail call { i32, i32 } @llvm.arm.mrrc2(i32 1, i32 2, i32 3) nounwind + ret void +} + +define hidden void @cond_cdp(i32 %a) { +; CHECK-LABEL: cond_cdp: +entry: + %tobool = icmp eq i32 %a, 0 + br i1 %tobool, label %if.end, label %if.then + +if.then: +; CHECK: it ne +; CHECK: cdpne p15, #0, c0, c0, c0, #0 @ encoding: [0x00,0xee,0x00,0x0f] + tail call void @llvm.arm.cdp(i32 15, i32 0, i32 0, i32 0, i32 0, i32 0) + br label %if.end + +if.end: + ret void +} + +declare void @llvm.arm.ldc(i32, i32, i8*) nounwind + +declare void @llvm.arm.ldcl(i32, i32, i8*) nounwind + +declare void @llvm.arm.ldc2(i32, i32, i8*) nounwind + +declare void @llvm.arm.ldc2l(i32, i32, i8*) nounwind + +declare void @llvm.arm.stc(i32, i32, i8*) nounwind + +declare void @llvm.arm.stcl(i32, i32, i8*) nounwind + +declare void @llvm.arm.stc2(i32, i32, i8*) nounwind + +declare void @llvm.arm.stc2l(i32, i32, i8*) nounwind + +declare void @llvm.arm.cdp2(i32, i32, i32, i32, i32, i32) nounwind + +declare void @llvm.arm.cdp(i32, i32, i32, i32, i32, i32) nounwind + +declare void @llvm.arm.mcrr2(i32, i32, i32, i32, i32) nounwind + +declare void @llvm.arm.mcrr(i32, i32, i32, i32, i32) nounwind + +declare void @llvm.arm.mcr2(i32, i32, i32, i32, i32, i32) nounwind + +declare i32 @llvm.arm.mrc2(i32, i32, i32, i32, i32) nounwind + +declare void @llvm.arm.mcr(i32, i32, i32, i32, i32, i32) nounwind + +declare i32 @llvm.arm.mrc(i32, i32, i32, i32, i32) nounwind + +declare { i32, i32 } @llvm.arm.mrrc(i32, i32, i32) nounwind + +declare { i32, i32 } @llvm.arm.mrrc2(i32, i32, i32) nounwind diff --git a/test/CodeGen/Thumb2/stack_guard_remat.ll b/test/CodeGen/Thumb2/stack_guard_remat.ll index cf34e8c0c2fb..839a506b35e6 100644 --- a/test/CodeGen/Thumb2/stack_guard_remat.ll +++ b/test/CodeGen/Thumb2/stack_guard_remat.ll @@ -24,20 +24,20 @@ define i32 @test_stack_guard_remat() #0 { %a1 = alloca [256 x i32], align 4 %1 = bitcast [256 x i32]* %a1 to i8* - call void @llvm.lifetime.start(i64 1024, i8* %1) + call void @llvm.lifetime.start.p0i8(i64 1024, i8* %1) %2 = getelementptr inbounds [256 x i32], [256 x i32]* %a1, i32 0, i32 0 call void @foo3(i32* %2) #3 call void asm sideeffect "foo2", "~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{sp},~{lr}"() - call void @llvm.lifetime.end(i64 1024, i8* %1) + call void @llvm.lifetime.end.p0i8(i64 1024, i8* %1) ret i32 0 } ; Function Attrs: nounwind -declare void @llvm.lifetime.start(i64, i8* nocapture) +declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) declare void @foo3(i32*) ; Function Attrs: nounwind -declare void @llvm.lifetime.end(i64, i8* nocapture) +declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) attributes #0 = { nounwind ssp "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } diff --git a/test/CodeGen/Thumb2/tbb-removeadd.mir b/test/CodeGen/Thumb2/tbb-removeadd.mir new file mode 100644 index 000000000000..89ed98720539 --- /dev/null +++ b/test/CodeGen/Thumb2/tbb-removeadd.mir @@ -0,0 +1,124 @@ +#RUN: llc -run-pass arm-cp-islands %s -o - | FileCheck %s + +--- | + ; ModuleID = 'test.ll' + source_filename = "test.c" + target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" + target triple = "thumbv8r-arm-none-eabi" + + define void @Func(i32 %i, i32* nocapture %p) local_unnamed_addr { + entry: + switch i32 %i, label %sw.epilog [ + i32 0, label %sw.bb + i32 1, label %sw.bb1 + i32 2, label %sw.epilog.sink.split + i32 4, label %sw.bb3 + ] + + sw.bb: ; preds = %entry + br label %sw.epilog.sink.split + + sw.bb1: ; preds = %entry + store i32 0, i32* %p, align 4 + br label %sw.epilog.sink.split + + sw.bb3: ; preds = %entry + br label %sw.epilog.sink.split + + sw.epilog.sink.split: ; preds = %sw.bb3, %sw.bb1, %sw.bb, %entry + %.sink = phi i32 [ 2, %sw.bb3 ], [ 0, %sw.bb ], [ 1, %entry ], [ 1, %sw.bb1 ] + store i32 %.sink, i32* %p, align 4 + br label %sw.epilog + + sw.epilog: ; preds = %sw.epilog.sink.split, %entry + ret void + } + +... +--- +name: Func +alignment: 1 +exposesReturnsTwice: false +noVRegs: true +legalized: false +regBankSelected: false +selected: false +tracksRegLiveness: true +liveins: + - { reg: '%r0' } + - { reg: '%r1' } +frameInfo: + isFrameAddressTaken: false + isReturnAddressTaken: false + hasStackMap: false + hasPatchPoint: false + stackSize: 0 + offsetAdjustment: 0 + maxAlignment: 0 + adjustsStack: false + hasCalls: false + maxCallFrameSize: 0 + hasOpaqueSPAdjustment: false + hasVAStart: false + hasMustTailInVarArgFunc: false +jumpTable: + kind: inline + entries: + - id: 0 + blocks: [ '%bb.2.sw.bb', '%bb.3.sw.bb1', '%bb.5.sw.epilog.sink.split', + '%bb.6.sw.epilog', '%bb.4.sw.bb3' ] +# The ADD should be deleted along with the LEA +# CHECK-NOT: t2LEApcrelJT +# CHECK-NOT: t2ADDrs +# CHECK: tMOVi8 +# CHECK: t2TBB_JT + +body: | + bb.0.entry: + successors: %bb.6.sw.epilog(0x0ccccccb), %bb.1.entry(0x73333335) + liveins: %r0, %r1 + + tCMPi8 %r0, 4, 14, _, implicit-def %cpsr + t2Bcc %bb.6.sw.epilog, 8, killed %cpsr + + bb.1.entry: + successors: %bb.2.sw.bb(0x1c71c71c), %bb.3.sw.bb1(0x1c71c71c), %bb.5.sw.epilog.sink.split(0x1c71c71c), %bb.6.sw.epilog(0x0e38e38e), %bb.4.sw.bb3(0x1c71c71c) + liveins: %r0, %r1 + + %r2 = t2LEApcrelJT %jump-table.0, 14, _ + %r3 = t2ADDrs killed %r2, %r0, 18, 14, _, _ + %r2, dead %cpsr = tMOVi8 1, 14, _ + t2BR_JT killed %r3, killed %r0, %jump-table.0 + + bb.2.sw.bb: + successors: %bb.5.sw.epilog.sink.split(0x80000000) + liveins: %r1 + + %r2, dead %cpsr = tMOVi8 0, 14, _ + t2B %bb.5.sw.epilog.sink.split, 14, _ + + bb.3.sw.bb1: + successors: %bb.5.sw.epilog.sink.split(0x80000000) + liveins: %r1 + + %r0, dead %cpsr = tMOVi8 0, 14, _ + %r2, dead %cpsr = tMOVi8 1, 14, _ + tSTRi killed %r0, %r1, 0, 14, _ :: (store 4 into %ir.p) + t2B %bb.5.sw.epilog.sink.split, 14, _ + + bb.4.sw.bb3: + successors: %bb.5.sw.epilog.sink.split(0x80000000) + liveins: %r1 + + %r2, dead %cpsr = tMOVi8 2, 14, _ + + bb.5.sw.epilog.sink.split: + successors: %bb.6.sw.epilog(0x80000000) + liveins: %r1, %r2 + + tSTRi killed %r2, killed %r1, 0, 14, _ :: (store 4 into %ir.p) + + bb.6.sw.epilog: + tBX_RET 14, _ + +... diff --git a/test/CodeGen/Thumb2/thumb2-pack.ll b/test/CodeGen/Thumb2/thumb2-pack.ll index 4825628f3014..26b68ec443b9 100644 --- a/test/CodeGen/Thumb2/thumb2-pack.ll +++ b/test/CodeGen/Thumb2/thumb2-pack.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+t2xtpk %s -o - | FileCheck %s +; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s ; CHECK: test1 ; CHECK: pkhbt r0, r0, r1, lsl #16 diff --git a/test/CodeGen/Thumb2/thumb2-rev.ll b/test/CodeGen/Thumb2/thumb2-rev.ll index 873a2d4cf7de..81d0822d500b 100644 --- a/test/CodeGen/Thumb2/thumb2-rev.ll +++ b/test/CodeGen/Thumb2/thumb2-rev.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+v7,+t2xtpk %s -o - | FileCheck %s +; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+v7 %s -o - | FileCheck %s define i32 @f1(i32 %a) { ; CHECK-LABEL: f1: diff --git a/test/CodeGen/Thumb2/thumb2-smla.ll b/test/CodeGen/Thumb2/thumb2-smla.ll index 5ddaf9353f92..f1850d460928 100644 --- a/test/CodeGen/Thumb2/thumb2-smla.ll +++ b/test/CodeGen/Thumb2/thumb2-smla.ll @@ -1,5 +1,5 @@ -; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+t2xtpk,+dsp %s -o - | FileCheck %s -; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+t2xtpk,+dsp -arm-use-mulops=false %s -o - | FileCheck %s -check-prefix=NO_MULOPS +; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+dsp %s -o - | FileCheck %s +; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+dsp -arm-use-mulops=false %s -o - | FileCheck %s -check-prefix=NO_MULOPS 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 a196a3c79ae9..53fca567af16 100644 --- a/test/CodeGen/Thumb2/thumb2-smul.ll +++ b/test/CodeGen/Thumb2/thumb2-smul.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+t2xtpk,+dsp %s -o - | FileCheck %s +; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+dsp %s -o - | 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-sxt-uxt.ll b/test/CodeGen/Thumb2/thumb2-sxt-uxt.ll index 693a8e4e99f7..c1170137c7fc 100644 --- a/test/CodeGen/Thumb2/thumb2-sxt-uxt.ll +++ b/test/CodeGen/Thumb2/thumb2-sxt-uxt.ll @@ -1,38 +1,45 @@ -; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s -; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m4 %s -o - | FileCheck %s --check-prefix=CHECK-M4 +; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s --check-prefix=CHECK-NO-DSP +; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m4 %s -o - | FileCheck %s --check-prefix=CHECK-DSP +; RUN: llc -mtriple=thumbv7em-eabi %s -o - | FileCheck %s -check-prefix=CHECK-DSP +; RUN: llc -mtriple=thumbv8m.main-none-eabi %s -o - | FileCheck %s -check-prefix=CHECK-NO-DSP +; RUN: llc -mtriple=thumbv8m.main-none-eabi -mattr=+dsp %s -o - | FileCheck %s -check-prefix=CHECK-DSP define i32 @test1(i16 zeroext %z) nounwind { ; CHECK-LABEL: test1: -; CHECK: sxth +; CHECK-DSP: sxth +; CHECK-NO-DSP: sxth %r = sext i16 %z to i32 ret i32 %r } define i32 @test2(i8 zeroext %z) nounwind { ; CHECK-LABEL: test2: -; CHECK: sxtb +; CHECK-DSP: sxtb +; CHECK-NO-DSP: sxtb %r = sext i8 %z to i32 ret i32 %r } define i32 @test3(i16 signext %z) nounwind { ; CHECK-LABEL: test3: -; CHECK: uxth +; CHECK-DSP: uxth +; CHECK-NO-DSP: uxth %r = zext i16 %z to i32 ret i32 %r } define i32 @test4(i8 signext %z) nounwind { ; CHECK-LABEL: test4: -; CHECK: uxtb +; CHECK-DSP: uxtb +; CHECK-NO-DSP: uxtb %r = zext i8 %z to i32 ret i32 %r } define i32 @test5(i32 %a, i8 %b) { ; CHECK-LABEL: test5: -; CHECK-NOT: sxtab -; CHECK-M4: sxtab r0, r0, r1 +; CHECK-DSP: sxtab r0, r0, r1 +; CHECK-NO-DSP-NOT: sxtab %sext = sext i8 %b to i32 %add = add i32 %a, %sext ret i32 %add @@ -40,8 +47,8 @@ define i32 @test5(i32 %a, i8 %b) { define i32 @test6(i32 %a, i32 %b) { ; CHECK-LABEL: test6: -; CHECK-NOT: sxtab -; CHECK-M4: sxtab r0, r0, r1 +; CHECK-DSP: sxtab r0, r0, r1 +; CHECK-NO-DSP-NOT: sxtab %shl = shl i32 %b, 24 %ashr = ashr i32 %shl, 24 %add = add i32 %a, %ashr @@ -50,8 +57,8 @@ define i32 @test6(i32 %a, i32 %b) { define i32 @test7(i32 %a, i16 %b) { ; CHECK-LABEL: test7: -; CHECK-NOT: sxtah -; CHECK-M4: sxtah r0, r0, r1 +; CHECK-DSP: sxtah r0, r0, r1 +; CHECK-NO-DSPNOT: sxtah %sext = sext i16 %b to i32 %add = add i32 %a, %sext ret i32 %add @@ -59,8 +66,8 @@ define i32 @test7(i32 %a, i16 %b) { define i32 @test8(i32 %a, i32 %b) { ; CHECK-LABEL: test8: -; CHECK-NOT: sxtah -; CHECK-M4: sxtah r0, r0, r1 +; CHECK-DSP: sxtah r0, r0, r1 +; CHECK-NO-DSP-NOT: sxtah %shl = shl i32 %b, 16 %ashr = ashr i32 %shl, 16 %add = add i32 %a, %ashr @@ -69,8 +76,8 @@ define i32 @test8(i32 %a, i32 %b) { define i32 @test9(i32 %a, i8 %b) { ; CHECK-LABEL: test9: -; CHECK-NOT: uxtab -; CHECK-M4: uxtab r0, r0, r1 +; CHECK-DSP: uxtab r0, r0, r1 +; CHECK-NO-DSP-NOT: uxtab %zext = zext i8 %b to i32 %add = add i32 %a, %zext ret i32 %add @@ -78,8 +85,8 @@ define i32 @test9(i32 %a, i8 %b) { define i32 @test10(i32 %a, i32 %b) { ;CHECK-LABEL: test10: -;CHECK-NOT: uxtab -;CHECK-M4: uxtab r0, r0, r1 +;CHECK-DSP: uxtab r0, r0, r1 +;CHECK-NO-DSP-NOT: uxtab %and = and i32 %b, 255 %add = add i32 %a, %and ret i32 %add @@ -87,8 +94,8 @@ define i32 @test10(i32 %a, i32 %b) { define i32 @test11(i32 %a, i16 %b) { ; CHECK-LABEL: test11: -; CHECK-NOT: uxtah -; CHECK-M4: uxtah r0, r0, r1 +; CHECK-DSP: uxtah r0, r0, r1 +; CHECK-NO-DSP-NOT: uxtah %zext = zext i16 %b to i32 %add = add i32 %a, %zext ret i32 %add @@ -96,8 +103,8 @@ define i32 @test11(i32 %a, i16 %b) { define i32 @test12(i32 %a, i32 %b) { ;CHECK-LABEL: test12: -;CHECK-NOT: uxtah -;CHECK-M4: uxtah r0, r0, r1 +;CHECK-DSP: uxtah r0, r0, r1 +;CHECK-NO-DSP-NOT: uxtah %and = and i32 %b, 65535 %add = add i32 %a, %and ret i32 %add diff --git a/test/CodeGen/Thumb2/thumb2-sxt_rot.ll b/test/CodeGen/Thumb2/thumb2-sxt_rot.ll index a4f8aa0dbd03..c4af67a2f91d 100644 --- a/test/CodeGen/Thumb2/thumb2-sxt_rot.ll +++ b/test/CodeGen/Thumb2/thumb2-sxt_rot.ll @@ -1,18 +1,21 @@ -; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+t2xtpk %s -o - | FileCheck %s -; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s --check-prefix=CHECK-M3 +; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s %s -o - | FileCheck %s --check-prefix=CHECK-DSP +; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s --check-prefix=CHECK-NO-DSP +; RUN: llc -mtriple=thumbv7em-eabi %s -o - | FileCheck %s -check-prefix=CHECK-DSP +; RUN: llc -mtriple=thumbv8m.main-none-eabi %s -o - | FileCheck %s -check-prefix=CHECK-NO-DSP +; RUN: llc -mtriple=thumbv8m.main-none-eabi -mattr=+dsp %s -o - | FileCheck %s -check-prefix=CHECK-DSP define i32 @test0(i8 %A) { ; CHECK-LABEL: test0: -; CHECK: sxtb r0, r0 -; CHECK-M3: sxtb r0, r0 +; CHECK-DSP: sxtb r0, r0 +; CHECK-NO-DSP: sxtb r0, r0 %B = sext i8 %A to i32 ret i32 %B } define signext i8 @test1(i32 %A) { ; CHECK-LABEL: test1: -; CHECK: sbfx r0, r0, #8, #8 -; CHECK-M3: sbfx r0, r0, #8, #8 +; CHECK-DSP: sbfx r0, r0, #8, #8 +; CHECK-NO-DSP: sbfx r0, r0, #8, #8 %B = lshr i32 %A, 8 %C = shl i32 %A, 24 %D = or i32 %B, %C @@ -22,8 +25,8 @@ define signext i8 @test1(i32 %A) { define signext i32 @test2(i32 %A, i32 %X) { ; CHECK-LABEL: test2: -; CHECK: sxtab r0, r1, r0, ror #8 -; CHECK-M3-NOT: sxtab +; CHECK-DSP: sxtab r0, r1, r0, ror #8 +; CHECK-NO-DSP-NOT: sxtab %B = lshr i32 %A, 8 %C = shl i32 %A, 24 %D = or i32 %B, %C @@ -35,8 +38,8 @@ define signext i32 @test2(i32 %A, i32 %X) { define i32 @test3(i32 %A, i32 %X) { ; CHECK-LABEL: test3: -; CHECK: sxtah r0, r0, r1, ror #8 -; CHECK-M3-NOT: sxtah +; CHECK-DSP: sxtah r0, r0, r1, ror #8 +; CHECK-NO-DSP-NOT: sxtah %X.hi = lshr i32 %X, 8 %X.trunc = trunc i32 %X.hi to i16 %addend = sext i16 %X.trunc to i32 @@ -46,8 +49,8 @@ define i32 @test3(i32 %A, i32 %X) { define signext i32 @test4(i32 %A, i32 %X) { ; CHECK-LABEL: test4: -; CHECK: sxtab r0, r1, r0, ror #16 -; CHECK-M3-NOT: sxtab +; CHECK-DSP: sxtab r0, r1, r0, ror #16 +; CHECK-NO-DSP-NOT: sxtab %B = lshr i32 %A, 16 %C = shl i32 %A, 16 %D = or i32 %B, %C @@ -59,8 +62,8 @@ define signext i32 @test4(i32 %A, i32 %X) { define signext i32 @test5(i32 %A, i32 %X) { ; CHECK-LABEL: test5: -; CHECK: sxtah r0, r1, r0, ror #24 -; CHECK-M3-NOT: sxtah +; CHECK-DSP: sxtah r0, r1, r0, ror #24 +; CHECK-NO-DSP-NOT: sxtah %B = lshr i32 %A, 24 %C = shl i32 %A, 8 %D = or i32 %B, %C diff --git a/test/CodeGen/Thumb2/thumb2-uxt_rot.ll b/test/CodeGen/Thumb2/thumb2-uxt_rot.ll index 891c706972c0..22740b715dcb 100644 --- a/test/CodeGen/Thumb2/thumb2-uxt_rot.ll +++ b/test/CodeGen/Thumb2/thumb2-uxt_rot.ll @@ -1,21 +1,22 @@ -; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s --check-prefix=A8 -; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s --check-prefix=M3 +; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s --check-prefix=CHECK-DSP +; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s --check-prefix=CHECK-NO-DSP +; RUN: llc -mtriple=thumbv7em-eabi %s -o - | FileCheck %s -check-prefix=CHECK-DSP +; RUN: llc -mtriple=thumbv8m.main-none-eabi %s -o - | FileCheck %s -check-prefix=CHECK-NO-DSP +; RUN: llc -mtriple=thumbv8m.main-none-eabi -mattr=+dsp %s -o - | FileCheck %s -check-prefix=CHECK-DSP ; rdar://11318438 define zeroext i8 @test1(i32 %A.u) { ; CHECK-LABEL: test1: -; A8: uxtb r0, r0 +; CHECK-DSP: uxtb r0, r0 +; CHECK-NO-DSP: uxtb r0, r0 %B.u = trunc i32 %A.u to i8 ret i8 %B.u } define zeroext i32 @test2(i32 %A.u, i32 %B.u) { ; CHECK-LABEL: test2: -; A8: uxtab r0, r0, r1 - -; M3: uxtb r1, r1 -; M3-NOT: uxtab -; M3: add r0, r1 +; CHECK-DSP: uxtab r0, r0, r1 +; CHECK-NO-DSP-NOT: uxtab %C.u = trunc i32 %B.u to i8 %D.u = zext i8 %C.u to i32 %E.u = add i32 %A.u, %D.u @@ -24,8 +25,8 @@ define zeroext i32 @test2(i32 %A.u, i32 %B.u) { define zeroext i32 @test3(i32 %A.u) { ; CHECK-LABEL: test3: -; A8: ubfx r0, r0, #8, #16 -; M3: ubfx r0, r0, #8, #16 +; CHECK-DSP: ubfx r0, r0, #8, #16 +; CHECK-NO-DSP: ubfx r0, r0, #8, #16 %B.u = lshr i32 %A.u, 8 %C.u = shl i32 %A.u, 24 %D.u = or i32 %B.u, %C.u @@ -36,8 +37,8 @@ define zeroext i32 @test3(i32 %A.u) { define i32 @test4(i32 %A, i32 %X) { ; CHECK-LABEL: test4: -; A8: uxtab r0, r0, r1, ror #16 -; M3-NOT: uxtab +; CHECK-DSP: uxtab r0, r0, r1, ror #16 +; CHECK-NO-DSP-NOT: uxtab %X.hi = lshr i32 %X, 16 %X.trunc = trunc i32 %X.hi to i8 %addend = zext i8 %X.trunc to i32 @@ -47,8 +48,8 @@ define i32 @test4(i32 %A, i32 %X) { define i32 @test5(i32 %A, i32 %X) { ; CHECK-LABEL: test5: -; A8: uxtah r0, r0, r1, ror #8 -; M3-NOT: uxtah +; CHECK-DSP: uxtah r0, r0, r1, ror #8 +; CHECK-NO-DSP-NOT: uxtah %X.hi = lshr i32 %X, 8 %X.trunc = trunc i32 %X.hi to i16 %addend = zext i16 %X.trunc to i32 @@ -58,8 +59,8 @@ define i32 @test5(i32 %A, i32 %X) { define i32 @test6(i32 %A, i32 %X) { ; CHECK-LABEL: test6: -; A8: uxtab r0, r0, r1, ror #8 -; M3-NOT: uxtab +; CHECK-DSP: uxtab r0, r0, r1, ror #8 +; CHECK-NO-DSP-NOT: uxtab %X.hi = lshr i32 %X, 8 %X.trunc = trunc i32 %X.hi to i8 %addend = zext i8 %X.trunc to i32 @@ -69,8 +70,8 @@ define i32 @test6(i32 %A, i32 %X) { define i32 @test7(i32 %A, i32 %X) { ; CHECK-LABEL: test7: -; A8: uxtah r0, r0, r1, ror #24 -; M3-NOT: uxtah +; CHECK-DSP: uxtah r0, r0, r1, ror #24 +; CHECK-NO-DSP-NOT: uxtah %lshr = lshr i32 %X, 24 %shl = shl i32 %X, 8 %or = or i32 %lshr, %shl @@ -82,8 +83,8 @@ define i32 @test7(i32 %A, i32 %X) { define i32 @test8(i32 %A, i32 %X) { ; CHECK-LABEL: test8: -; A8: uxtah r0, r0, r1, ror #24 -; M3-NOT: uxtah +; CHECK-DSP: uxtah r0, r0, r1, ror #24 +; CHECK-NO-DSP-NOT: uxtah %lshr = lshr i32 %X, 24 %shl = shl i32 %X, 8 %or = or i32 %lshr, %shl diff --git a/test/CodeGen/Thumb2/thumb2-uxtb.ll b/test/CodeGen/Thumb2/thumb2-uxtb.ll index b8b1bc832d96..af4532cf6f3d 100644 --- a/test/CodeGen/Thumb2/thumb2-uxtb.ll +++ b/test/CodeGen/Thumb2/thumb2-uxtb.ll @@ -1,72 +1,63 @@ -; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s -check-prefix=ARMv7A -; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s -check-prefix=ARMv7M +; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s -check-prefix=CHECK-DSP +; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s -check-prefix=CHECK-NO-DSP +; RUN: llc -mtriple=thumbv7em-eabi %s -o - | FileCheck %s -check-prefix=CHECK-DSP +; RUN: llc -mtriple=thumbv8m.main-none-eabi %s -o - | FileCheck %s -check-prefix=CHECK-NO-DSP +; RUN: llc -mtriple=thumbv8m.main-none-eabi -mattr=+dsp %s -o - | FileCheck %s -check-prefix=CHECK-DSP define i32 @test1(i32 %x) { -; ARMv7A: test1 -; ARMv7A: uxtb16 r0, r0 - -; ARMv7M: test1 -; ARMv7M: bic r0, r0, #-16711936 +; CHECK-LABEL: test1 +; CHECK-DSP: uxtb16 r0, r0 +; CHECK-NO-DSP: bic r0, r0, #-16711936 %tmp1 = and i32 %x, 16711935 ; <i32> [#uses=1] ret i32 %tmp1 } ; PR7503 define i32 @test2(i32 %x) { -; ARMv7A: test2 -; ARMv7A: uxtb16 r0, r0, ror #8 - -; ARMv7M: test2 -; ARMv7M: mov.w r1, #16711935 -; ARMv7M: and.w r0, r1, r0, lsr #8 +; CHECK-LABEL: test2 +; CHECK-DSP: uxtb16 r0, r0, ror #8 +; CHECK-NO-DSP: mov.w r1, #16711935 +; CHECK-NO-DSP: and.w r0, r1, r0, lsr #8 %tmp1 = lshr i32 %x, 8 ; <i32> [#uses=1] %tmp2 = and i32 %tmp1, 16711935 ; <i32> [#uses=1] ret i32 %tmp2 } define i32 @test3(i32 %x) { -; ARMv7A: test3 -; ARMv7A: uxtb16 r0, r0, ror #8 - -; ARMv7M: test3 -; ARMv7M: mov.w r1, #16711935 -; ARMv7M: and.w r0, r1, r0, lsr #8 +; CHECK-LABEL: test3 +; CHECK-DSP: uxtb16 r0, r0, ror #8 +; CHECK-NO-DSP: mov.w r1, #16711935 +; CHECK-NO-DSP: and.w r0, r1, r0, lsr #8 %tmp1 = lshr i32 %x, 8 ; <i32> [#uses=1] %tmp2 = and i32 %tmp1, 16711935 ; <i32> [#uses=1] ret i32 %tmp2 } define i32 @test4(i32 %x) { -; ARMv7A: test4 -; ARMv7A: uxtb16 r0, r0, ror #8 - -; ARMv7M: test4 -; ARMv7M: mov.w r1, #16711935 -; ARMv7M: and.w r0, r1, r0, lsr #8 +; CHECK-LABEL: test4 +; CHECK-DSP: uxtb16 r0, r0, ror #8 +; CHECK-NO-DSP: mov.w r1, #16711935 +; CHECK-NO-DSP: and.w r0, r1, r0, lsr #8 %tmp1 = lshr i32 %x, 8 ; <i32> [#uses=1] %tmp6 = and i32 %tmp1, 16711935 ; <i32> [#uses=1] ret i32 %tmp6 } define i32 @test5(i32 %x) { -; ARMv7A: test5 -; ARMv7A: uxtb16 r0, r0, ror #8 - -; ARMv7M: test5 -; ARMv7M: mov.w r1, #16711935 -; ARMv7M: and.w r0, r1, r0, lsr #8 +; CHECK-LABEL: test5 +; CHECK-DSP: uxtb16 r0, r0, ror #8 +; CHECK-NO-DSP: mov.w r1, #16711935 +; CHECK-NO-DSP: and.w r0, r1, r0, lsr #8 %tmp1 = lshr i32 %x, 8 ; <i32> [#uses=1] %tmp2 = and i32 %tmp1, 16711935 ; <i32> [#uses=1] ret i32 %tmp2 } define i32 @test6(i32 %x) { -; ARMv7A: test6 -; ARMv7A: uxtb16 r0, r0, ror #16 - -; ARMv7M: test6 -; ARMv7M: mov.w r1, #16711935 -; ARMv7M: and.w r0, r1, r0, ror #16 +; CHECK-LABEL: test6 +; CHECK-DSP: uxtb16 r0, r0, ror #16 +; CHECK-NO-DSP: mov.w r1, #16711935 +; CHECK-NO-DSP: and.w r0, r1, r0, ror #16 %tmp1 = lshr i32 %x, 16 ; <i32> [#uses=1] %tmp2 = and i32 %tmp1, 255 ; <i32> [#uses=1] %tmp4 = shl i32 %x, 16 ; <i32> [#uses=1] @@ -76,12 +67,10 @@ define i32 @test6(i32 %x) { } define i32 @test7(i32 %x) { -; ARMv7A: test7 -; ARMv7A: uxtb16 r0, r0, ror #16 - -; ARMv7M: test7 -; ARMv7M: mov.w r1, #16711935 -; ARMv7M: and.w r0, r1, r0, ror #16 +; CHECK-LABEL: test7 +; CHECK-DSP: uxtb16 r0, r0, ror #16 +; CHECK-NO-DSP: mov.w r1, #16711935 +; CHECK-NO-DSP: and.w r0, r1, r0, ror #16 %tmp1 = lshr i32 %x, 16 ; <i32> [#uses=1] %tmp2 = and i32 %tmp1, 255 ; <i32> [#uses=1] %tmp4 = shl i32 %x, 16 ; <i32> [#uses=1] @@ -91,12 +80,10 @@ define i32 @test7(i32 %x) { } define i32 @test8(i32 %x) { -; ARMv7A: test8 -; ARMv7A: uxtb16 r0, r0, ror #24 - -; ARMv7M: test8 -; ARMv7M: mov.w r1, #16711935 -; ARMv7M: and.w r0, r1, r0, ror #24 +; CHECK-LABEL: test8 +; CHECK-DSP: uxtb16 r0, r0, ror #24 +; CHECK-NO-DSP: mov.w r1, #16711935 +; CHECK-NO-DSP: and.w r0, r1, r0, ror #24 %tmp1 = shl i32 %x, 8 ; <i32> [#uses=1] %tmp2 = and i32 %tmp1, 16711680 ; <i32> [#uses=1] %tmp5 = lshr i32 %x, 24 ; <i32> [#uses=1] @@ -105,12 +92,10 @@ define i32 @test8(i32 %x) { } define i32 @test9(i32 %x) { -; ARMv7A: test9 -; ARMv7A: uxtb16 r0, r0, ror #24 - -; ARMv7M: test9 -; ARMv7M: mov.w r1, #16711935 -; ARMv7M: and.w r0, r1, r0, ror #24 +; CHECK-LABEL: test9 +; CHECK-DSP: uxtb16 r0, r0, ror #24 +; CHECK-NO-DSP: mov.w r1, #16711935 +; CHECK-NO-DSP: and.w r0, r1, r0, ror #24 %tmp1 = lshr i32 %x, 24 ; <i32> [#uses=1] %tmp4 = shl i32 %x, 8 ; <i32> [#uses=1] %tmp5 = and i32 %tmp4, 16711680 ; <i32> [#uses=1] @@ -119,19 +104,18 @@ define i32 @test9(i32 %x) { } define i32 @test10(i32 %p0) { -; ARMv7A: test10 -; ARMv7A: mov.w r1, #16253176 -; ARMv7A: and.w r0, r1, r0, lsr #7 -; ARMv7A: lsrs r1, r0, #5 -; ARMv7A: uxtb16 r1, r1 -; ARMv7A: orrs r0, r1 - -; ARMv7M: test10 -; ARMv7M: mov.w r1, #16253176 -; ARMv7M: and.w r0, r1, r0, lsr #7 -; ARMv7M: mov.w r1, #458759 -; ARMv7M: and.w r1, r1, r0, lsr #5 -; ARMv7M: orrs r0, r1 +; CHECK-LABEL: test10 +; CHECK-DSP: mov.w r1, #16253176 +; CHECK-DSP: and.w r0, r1, r0, lsr #7 +; CHECK-DSP: lsrs r1, r0, #5 +; CHECK-DSP: uxtb16 r1, r1 +; CHECk-DSP: orrs r0, r1 + +; CHECK-NO-DSP: mov.w r1, #16253176 +; CHECK-NO-DSP: and.w r0, r1, r0, lsr #7 +; CHECK-NO-DSP: mov.w r1, #458759 +; CHECK-NO-DSP: and.w r1, r1, r0, lsr #5 +; CHECK-NO-DSP: orrs r0, r1 %tmp1 = lshr i32 %p0, 7 ; <i32> [#uses=1] %tmp2 = and i32 %tmp1, 16253176 ; <i32> [#uses=2] %tmp4 = lshr i32 %tmp2, 5 ; <i32> [#uses=1] diff --git a/test/CodeGen/Thumb2/v8_IT_4.ll b/test/CodeGen/Thumb2/v8_IT_4.ll index 5a80d8cd7b4e..5901a8e81caf 100644 --- a/test/CodeGen/Thumb2/v8_IT_4.ll +++ b/test/CodeGen/Thumb2/v8_IT_4.ll @@ -12,10 +12,11 @@ define weak arm_aapcs_vfpcc i32 @_ZNKSs7compareERKSs(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %__str) { ; CHECK-LABEL: _ZNKSs7compareERKSs: -; CHECK: cbnz r0, +; CHECK: cbz r0, +; CHECK-NEXT: %bb1 +; CHECK-NEXT: pop.w ; CHECK-NEXT: %bb ; CHECK-NEXT: sub{{(.w)?}} r0, r{{[0-9]+}}, r{{[0-9]+}} -; CHECK-NEXT: %bb1 ; CHECK-NEXT: pop.w entry: %0 = tail call arm_aapcs_vfpcc i32 @_ZNKSs4sizeEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this) ; <i32> [#uses=3] |