1 ; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m3 %s -o - | FileCheck %s --check-prefix=CHECK-NO-DSP
2 ; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-m4 %s -o - | FileCheck %s --check-prefix=CHECK-DSP
3 ; RUN: llc -mtriple=thumbv7em-eabi %s -o - | FileCheck %s -check-prefix=CHECK-DSP
4 ; RUN: llc -mtriple=thumbv8m.main-none-eabi %s -o - | FileCheck %s -check-prefix=CHECK-NO-DSP
5 ; RUN: llc -mtriple=thumbv8m.main-none-eabi -mattr=+dsp %s -o - | FileCheck %s -check-prefix=CHECK-DSP
7 define i32 @test1(i16 zeroext %z) nounwind {
11 %r = sext i16 %z to i32
15 define i32 @test2(i8 zeroext %z) nounwind {
19 %r = sext i8 %z to i32
23 define i32 @test3(i16 signext %z) nounwind {
27 %r = zext i16 %z to i32
31 define i32 @test4(i8 signext %z) nounwind {
35 %r = zext i8 %z to i32
39 define i32 @test5(i32 %a, i8 %b) {
41 ; CHECK-DSP: sxtab r0, r0, r1
42 ; CHECK-NO-DSP-NOT: sxtab
43 %sext = sext i8 %b to i32
44 %add = add i32 %a, %sext
48 define i32 @test6(i32 %a, i32 %b) {
50 ; CHECK-DSP: sxtab r0, r0, r1
51 ; CHECK-NO-DSP-NOT: sxtab
53 %ashr = ashr i32 %shl, 24
54 %add = add i32 %a, %ashr
58 define i32 @test7(i32 %a, i16 %b) {
60 ; CHECK-DSP: sxtah r0, r0, r1
61 ; CHECK-NO-DSPNOT: sxtah
62 %sext = sext i16 %b to i32
63 %add = add i32 %a, %sext
67 define i32 @test8(i32 %a, i32 %b) {
69 ; CHECK-DSP: sxtah r0, r0, r1
70 ; CHECK-NO-DSP-NOT: sxtah
72 %ashr = ashr i32 %shl, 16
73 %add = add i32 %a, %ashr
77 define i32 @test9(i32 %a, i8 %b) {
79 ; CHECK-DSP: uxtab r0, r0, r1
80 ; CHECK-NO-DSP-NOT: uxtab
81 %zext = zext i8 %b to i32
82 %add = add i32 %a, %zext
86 define i32 @test10(i32 %a, i32 %b) {
88 ;CHECK-DSP: uxtab r0, r0, r1
89 ;CHECK-NO-DSP-NOT: uxtab
90 %and = and i32 %b, 255
91 %add = add i32 %a, %and
95 define i32 @test11(i32 %a, i16 %b) {
96 ; CHECK-LABEL: test11:
97 ; CHECK-DSP: uxtah r0, r0, r1
98 ; CHECK-NO-DSP-NOT: uxtah
99 %zext = zext i16 %b to i32
100 %add = add i32 %a, %zext
104 define i32 @test12(i32 %a, i32 %b) {
105 ;CHECK-LABEL: test12:
106 ;CHECK-DSP: uxtah r0, r0, r1
107 ;CHECK-NO-DSP-NOT: uxtah
108 %and = and i32 %b, 65535
109 %add = add i32 %a, %and