File: usat-with-shift.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (55 lines) | stat: -rw-r--r-- 1,514 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=armv6-eabi %s -o - | FileCheck %s
; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+dsp %s -o - | FileCheck %s

define arm_aapcs_vfpcc i32 @usat_lsl(i32 %num){
; CHECK-LABEL:  usat_lsl
; CHECK:        @ %bb.0: @ %entry
; CHECK-NEXT: 	usat	r0, #7, r0, lsl #2
; CHECK-NEXT:   bx	lr
entry:
  %shl = shl i32 %num, 2
  %0 = tail call i32 @llvm.arm.usat(i32 %shl, i32 7)
  ret i32 %0
}

define arm_aapcs_vfpcc i32 @usat_asr(i32 %num){
; CHECK-LABEL:  usat_asr
; CHECK:        @ %bb.0: @ %entry
; CHECK-NEXT:   usat	r0, #7, r0, asr #2
; CHECK-NEXT:   bx	lr
entry:
  %shr = ashr i32 %num, 2
  %0 = tail call i32 @llvm.arm.usat(i32 %shr, i32 7)
  ret i32 %0
}

define arm_aapcs_vfpcc i32 @usat_lsl2(i32 %num){
; CHECK-LABEL: usat_lsl2:
; CHECK:       @ %bb.0: @ %entry
; CHECK-NEXT:    usat r0, #15, r0, lsl #15
; CHECK-NEXT:    bx lr
entry:
  %shl = shl nsw i32 %num, 15
  %0 = icmp sgt i32 %shl, 0
  %1 = select i1 %0, i32 %shl, i32 0
  %2 = icmp slt i32 %1, 32767
  %3 = select i1 %2, i32 %1, i32 32767
  ret i32 %3
}

define arm_aapcs_vfpcc i32 @usat_asr2(i32 %num){
; CHECK-LABEL: usat_asr2:
; CHECK:       @ %bb.0: @ %entry
; CHECK-NEXT:    usat r0, #15, r0, asr #15
; CHECK-NEXT:    bx lr
entry:
  %shr = ashr i32 %num, 15
  %0 = icmp sgt i32 %shr, 0
  %1 = select i1 %0, i32 %shr, i32 0
  %2 = icmp slt i32 %1, 32767
  %3 = select i1 %2, i32 %1, i32 32767
  ret i32 %3
}

declare i32 @llvm.arm.usat(i32, i32)