irtranslator-fp-min-max-intrinsics.ll
3.19 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
; RUN: llc -mtriple=aarch64-- -verify-machineinstrs -global-isel -stop-after=irtranslator -o - %s | FileCheck %s
define float @test_minnum(float %x, float %y) {
; CHECK-LABEL: name: test_minnum
; CHECK: bb.1 (%ir-block.0):
; CHECK: liveins: $s0, $s1
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s1
; CHECK: [[FMINNUM:%[0-9]+]]:_(s32) = G_FMINNUM [[COPY]], [[COPY1]]
; CHECK: $s0 = COPY [[FMINNUM]](s32)
; CHECK: RET_ReallyLR implicit $s0
%val = call float @llvm.minnum.f32(float %x, float %y)
ret float %val
}
define float @test_minnum_nnan(float %x, float %y) {
; CHECK-LABEL: name: test_minnum_nnan
; CHECK: bb.1 (%ir-block.0):
; CHECK: liveins: $s0, $s1
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s1
; CHECK: %2:_(s32) = nnan G_FMINNUM [[COPY]], [[COPY1]]
; CHECK: $s0 = COPY %2(s32)
; CHECK: RET_ReallyLR implicit $s0
%val = call nnan float @llvm.minnum.f32(float %x, float %y)
ret float %val
}
define float @test_maxnum(float %x, float %y) {
; CHECK-LABEL: name: test_maxnum
; CHECK: bb.1 (%ir-block.0):
; CHECK: liveins: $s0, $s1
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s1
; CHECK: [[FMAXNUM:%[0-9]+]]:_(s32) = G_FMAXNUM [[COPY]], [[COPY1]]
; CHECK: $s0 = COPY [[FMAXNUM]](s32)
; CHECK: RET_ReallyLR implicit $s0
%val = call float @llvm.maxnum.f32(float %x, float %y)
ret float %val
}
define float @test_minimum(float %x, float %y) {
; CHECK-LABEL: name: test_minimum
; CHECK: bb.1 (%ir-block.0):
; CHECK: liveins: $s0, $s1
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s1
; CHECK: [[FMINIMUM:%[0-9]+]]:_(s32) = G_FMINIMUM [[COPY]], [[COPY1]]
; CHECK: $s0 = COPY [[FMINIMUM]](s32)
; CHECK: RET_ReallyLR implicit $s0
%val = call float @llvm.minimum.f32(float %x, float %y)
ret float %val
}
define float @test_minimum_nnan(float %x, float %y) {
; CHECK-LABEL: name: test_minimum_nnan
; CHECK: bb.1 (%ir-block.0):
; CHECK: liveins: $s0, $s1
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s1
; CHECK: %2:_(s32) = nnan G_FMINIMUM [[COPY]], [[COPY1]]
; CHECK: $s0 = COPY %2(s32)
; CHECK: RET_ReallyLR implicit $s0
%val = call nnan float @llvm.minimum.f32(float %x, float %y)
ret float %val
}
define float @test_maximum(float %x, float %y) {
; CHECK-LABEL: name: test_maximum
; CHECK: bb.1 (%ir-block.0):
; CHECK: liveins: $s0, $s1
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $s1
; CHECK: [[FMAXIMUM:%[0-9]+]]:_(s32) = G_FMAXIMUM [[COPY]], [[COPY1]]
; CHECK: $s0 = COPY [[FMAXIMUM]](s32)
; CHECK: RET_ReallyLR implicit $s0
%val = call float @llvm.maximum.f32(float %x, float %y)
ret float %val
}
declare float @llvm.minnum.f32(float, float) #0
declare float @llvm.maxnum.f32(float, float) #0
declare float @llvm.minimum.f32(float, float) #0
declare float @llvm.maximum.f32(float, float) #0
attributes #0 = { nounwind readnone speculatable }