1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=armv6-eabi %s -o - | FileCheck %s
3 ; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+dsp %s -o - | FileCheck %s
5 define arm_aapcs_vfpcc i32 @ssat_lsl(i32 %num){
6 ; CHECK-LABEL: ssat_lsl
7 ; CHECK: @ %bb.0: @ %entry
8 ; CHECK-NEXT: ssat r0, #8, r0, lsl #7
11 %shl = shl i32 %num, 7
12 %0 = tail call i32 @llvm.arm.ssat(i32 %shl, i32 8)
16 define arm_aapcs_vfpcc i32 @ssat_asr(i32 %num){
17 ; CHECK-LABEL: ssat_asr
18 ; CHECK: @ %bb.0: @ %entry
19 ; CHECK-NEXT: ssat r0, #8, r0, asr #7
22 %shr = ashr i32 %num, 7
23 %0 = tail call i32 @llvm.arm.ssat(i32 %shr, i32 8)
27 define arm_aapcs_vfpcc i32 @ssat_lsl2(i32 %num){
28 ; CHECK-LABEL: ssat_lsl2:
29 ; CHECK: @ %bb.0: @ %entry
30 ; CHECK-NEXT: ssat r0, #16, r0, lsl #15
33 %shl = shl nsw i32 %num, 15
34 %0 = icmp sgt i32 %shl, -32768
35 %1 = select i1 %0, i32 %shl, i32 -32768
36 %2 = icmp slt i32 %1, 32767
37 %3 = select i1 %2, i32 %1, i32 32767
41 define arm_aapcs_vfpcc i32 @ssat_asr2(i32 %num){
42 ; CHECK-LABEL: ssat_asr2:
43 ; CHECK: @ %bb.0: @ %entry
44 ; CHECK-NEXT: ssat r0, #16, r0, asr #15
47 %shr = ashr i32 %num, 15
48 %0 = icmp sgt i32 %shr, -32768
49 %1 = select i1 %0, i32 %shr, i32 -32768
50 %2 = icmp slt i32 %1, 32767
51 %3 = select i1 %2, i32 %1, i32 32767
55 declare i32 @llvm.arm.ssat(i32, i32)