File: fpsat.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 (67 lines) | stat: -rw-r--r-- 2,926 bytes parent folder | download | duplicates (2)
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
56
57
58
59
60
61
62
63
64
65
66
67
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=slp-vectorizer -mtriple=aarch64-none-eabi < %s | FileCheck %s

target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"

define void @signed(ptr %x, ptr %y, i32 %n) {
; CHECK-LABEL: @signed(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = load <4 x float>, ptr [[X:%.*]], align 4
; CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i32> @llvm.fptosi.sat.v4i32.v4f32(<4 x float> [[TMP0]])
; CHECK-NEXT:    store <4 x i32> [[TMP1]], ptr [[Y:%.*]], align 4
; CHECK-NEXT:    ret void
;
entry:
  %l0 = load float, ptr %x, align 4
  %arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1
  %l2 = load float, ptr %arrayidx.1, align 4
  %arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2
  %l4 = load float, ptr %arrayidx.2, align 4
  %arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3
  %l6 = load float, ptr %arrayidx.3, align 4
  %l1 = tail call i32 @llvm.fptosi.sat.i32.f32(float %l0)
  %l3 = tail call i32 @llvm.fptosi.sat.i32.f32(float %l2)
  %l5 = tail call i32 @llvm.fptosi.sat.i32.f32(float %l4)
  %l7 = tail call i32 @llvm.fptosi.sat.i32.f32(float %l6)
  store i32 %l1, ptr %y, align 4
  %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 1
  store i32 %l3, ptr %arrayidx2.1, align 4
  %arrayidx2.2 = getelementptr inbounds i32, ptr %y, i64 2
  store i32 %l5, ptr %arrayidx2.2, align 4
  %arrayidx2.3 = getelementptr inbounds i32, ptr %y, i64 3
  store i32 %l7, ptr %arrayidx2.3, align 4
  ret void
}

define void @unsigned(ptr %x, ptr %y, i32 %n) {
; CHECK-LABEL: @unsigned(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = load <4 x float>, ptr [[X:%.*]], align 4
; CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i32> @llvm.fptoui.sat.v4i32.v4f32(<4 x float> [[TMP0]])
; CHECK-NEXT:    store <4 x i32> [[TMP1]], ptr [[Y:%.*]], align 4
; CHECK-NEXT:    ret void
;
entry:
  %l0 = load float, ptr %x, align 4
  %arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1
  %l2 = load float, ptr %arrayidx.1, align 4
  %arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2
  %l4 = load float, ptr %arrayidx.2, align 4
  %arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3
  %l6 = load float, ptr %arrayidx.3, align 4
  %l1 = tail call i32 @llvm.fptoui.sat.i32.f32(float %l0)
  %l3 = tail call i32 @llvm.fptoui.sat.i32.f32(float %l2)
  %l5 = tail call i32 @llvm.fptoui.sat.i32.f32(float %l4)
  %l7 = tail call i32 @llvm.fptoui.sat.i32.f32(float %l6)
  store i32 %l1, ptr %y, align 4
  %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 1
  store i32 %l3, ptr %arrayidx2.1, align 4
  %arrayidx2.2 = getelementptr inbounds i32, ptr %y, i64 2
  store i32 %l5, ptr %arrayidx2.2, align 4
  %arrayidx2.3 = getelementptr inbounds i32, ptr %y, i64 3
  store i32 %l7, ptr %arrayidx2.3, align 4
  ret void
}

declare i32 @llvm.fptosi.sat.i32.f32(float)
declare i32 @llvm.fptoui.sat.i32.f32(float)