1 ; RUN: llc -mtriple=thumb-eabi -mcpu=cortex-a8 %s -o - | FileCheck %s --check-prefix=A8
2 ; RUN: llc -mtriple=thumb-eabi -mcpu=swift %s -o - | FileCheck %s --check-prefix=SWIFT
6 define i32 @t2ADDrs_lsl(i32 %X, i32 %Y) {
8 ; A8: add.w r0, r0, r1, lsl #16
14 define i32 @t2ADDrs_lsr(i32 %X, i32 %Y) {
16 ; A8: add.w r0, r0, r1, lsr #16
22 define i32 @t2ADDrs_asr(i32 %X, i32 %Y) {
24 ; A8: add.w r0, r0, r1, asr #16
30 ; i32 ror(n) = (x >> n) | (x << (32 - n))
31 define i32 @t2ADDrs_ror(i32 %X, i32 %Y) {
33 ; A8: add.w r0, r0, r1, ror #16
41 define i32 @t2ADDrs_noRegShift(i32 %X, i32 %Y, i8 %sh) {
42 ; A8: t2ADDrs_noRegShift
47 ; SWIFT: t2ADDrs_noRegShift
50 %shift.upgrd.1 = zext i8 %sh to i32
51 %A = shl i32 %Y, %shift.upgrd.1
56 define i32 @t2ADDrs_noRegShift2(i32 %X, i32 %Y, i8 %sh) {
57 ; A8: t2ADDrs_noRegShift2
62 ; SWIFT: t2ADDrs_noRegShift2
65 %shift.upgrd.1 = zext i8 %sh to i32
66 %A = lshr i32 %Y, %shift.upgrd.1
71 define i32 @t2ADDrs_noRegShift3(i32 %X, i32 %Y, i8 %sh) {
72 ; A8: t2ADDrs_noRegShift3
77 ; SWIFT: t2ADDrs_noRegShift3
80 %shift.upgrd.1 = zext i8 %sh to i32
81 %A = ashr i32 %Y, %shift.upgrd.1
86 define i32 @t2ADDrs_optsize(i32 %X, i32 %Y, i8 %sh) optsize {
87 ; SWIFT: t2ADDrs_optsize
90 %shift.upgrd.1 = zext i8 %sh to i32
91 %A = shl i32 %Y, %shift.upgrd.1
96 define i32 @t2ADDrs_minsize(i32 %X, i32 %Y, i8 %sh) minsize {
97 ; SWIFT: t2ADDrs_minsize
100 %shift.upgrd.1 = zext i8 %sh to i32
101 %A = lshr i32 %Y, %shift.upgrd.1