1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=mipsisa32r6 < %s | FileCheck %s --check-prefix=MIPS32R6
4 declare float @llvm.maximumnum.f32(float, float)
5 declare double @llvm.maximumnum.f64(double, double)
6 declare float @llvm.minimumnum.f32(float, float)
7 declare double @llvm.minimumnum.f64(double, double)
9 define float @maximumnum_float(float %x, float %y) {
10 ; MIPS32R6-LABEL: maximumnum_float:
12 ; MIPS32R6-NEXT: min.s $f0, $f14, $f14
13 ; MIPS32R6-NEXT: min.s $f1, $f12, $f12
14 ; MIPS32R6-NEXT: jr $ra
15 ; MIPS32R6-NEXT: max.s $f0, $f1, $f0
16 %z = call float @llvm.maximumnum.f32(float %x, float %y)
20 define float @maximumnum_float_nsz(float %x, float %y) {
21 ; MIPS32R6-LABEL: maximumnum_float_nsz:
23 ; MIPS32R6-NEXT: min.s $f0, $f14, $f14
24 ; MIPS32R6-NEXT: min.s $f1, $f12, $f12
25 ; MIPS32R6-NEXT: jr $ra
26 ; MIPS32R6-NEXT: max.s $f0, $f1, $f0
27 %z = call nsz float @llvm.maximumnum.f32(float %x, float %y)
31 define float @maximumnum_float_nnan(float %x, float %y) {
32 ; MIPS32R6-LABEL: maximumnum_float_nnan:
34 ; MIPS32R6-NEXT: jr $ra
35 ; MIPS32R6-NEXT: max.s $f0, $f12, $f14
36 %z = call nnan float @llvm.maximumnum.f32(float %x, float %y)
41 define double @maximumnum_double(double %x, double %y) {
42 ; MIPS32R6-LABEL: maximumnum_double:
44 ; MIPS32R6-NEXT: min.d $f0, $f14, $f14
45 ; MIPS32R6-NEXT: min.d $f1, $f12, $f12
46 ; MIPS32R6-NEXT: jr $ra
47 ; MIPS32R6-NEXT: max.d $f0, $f1, $f0
48 %z = call double @llvm.maximumnum.f64(double %x, double %y)
52 define double @maximumnum_double_nsz(double %x, double %y) {
53 ; MIPS32R6-LABEL: maximumnum_double_nsz:
55 ; MIPS32R6-NEXT: min.d $f0, $f14, $f14
56 ; MIPS32R6-NEXT: min.d $f1, $f12, $f12
57 ; MIPS32R6-NEXT: jr $ra
58 ; MIPS32R6-NEXT: max.d $f0, $f1, $f0
59 %z = call nsz double @llvm.maximumnum.f64(double %x, double %y)
63 define double @maximumnum_double_nnan(double %x, double %y) {
64 ; MIPS32R6-LABEL: maximumnum_double_nnan:
66 ; MIPS32R6-NEXT: jr $ra
67 ; MIPS32R6-NEXT: max.d $f0, $f12, $f14
68 %z = call nnan double @llvm.maximumnum.f64(double %x, double %y)
72 define float @minimumnum_float(float %x, float %y) {
73 ; MIPS32R6-LABEL: minimumnum_float:
75 ; MIPS32R6-NEXT: min.s $f0, $f14, $f14
76 ; MIPS32R6-NEXT: min.s $f1, $f12, $f12
77 ; MIPS32R6-NEXT: jr $ra
78 ; MIPS32R6-NEXT: min.s $f0, $f1, $f0
79 %z = call float @llvm.minimumnum.f32(float %x, float %y)
83 define float @minimumnum_float_nsz(float %x, float %y) {
84 ; MIPS32R6-LABEL: minimumnum_float_nsz:
86 ; MIPS32R6-NEXT: min.s $f0, $f14, $f14
87 ; MIPS32R6-NEXT: min.s $f1, $f12, $f12
88 ; MIPS32R6-NEXT: jr $ra
89 ; MIPS32R6-NEXT: min.s $f0, $f1, $f0
90 %z = call nsz float @llvm.minimumnum.f32(float %x, float %y)
94 define float @minimumnum_float_nnan(float %x, float %y) {
95 ; MIPS32R6-LABEL: minimumnum_float_nnan:
97 ; MIPS32R6-NEXT: jr $ra
98 ; MIPS32R6-NEXT: min.s $f0, $f12, $f14
99 %z = call nnan float @llvm.minimumnum.f32(float %x, float %y)
103 define double @minimumnum_double(double %x, double %y) {
104 ; MIPS32R6-LABEL: minimumnum_double:
106 ; MIPS32R6-NEXT: min.d $f0, $f14, $f14
107 ; MIPS32R6-NEXT: min.d $f1, $f12, $f12
108 ; MIPS32R6-NEXT: jr $ra
109 ; MIPS32R6-NEXT: min.d $f0, $f1, $f0
110 %z = call double @llvm.minimumnum.f64(double %x, double %y)
114 define double @minimumnum_double_nsz(double %x, double %y) {
115 ; MIPS32R6-LABEL: minimumnum_double_nsz:
117 ; MIPS32R6-NEXT: min.d $f0, $f14, $f14
118 ; MIPS32R6-NEXT: min.d $f1, $f12, $f12
119 ; MIPS32R6-NEXT: jr $ra
120 ; MIPS32R6-NEXT: min.d $f0, $f1, $f0
121 %z = call nsz double @llvm.minimumnum.f64(double %x, double %y)
125 define double @minimumnum_double_nnan(double %x, double %y) {
126 ; MIPS32R6-LABEL: minimumnum_double_nnan:
128 ; MIPS32R6-NEXT: jr $ra
129 ; MIPS32R6-NEXT: min.d $f0, $f12, $f14
130 %z = call nnan double @llvm.minimumnum.f64(double %x, double %y)