1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP32
3 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -mattr=+fp64,+mips32r2 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP64
6 define void @ceil_f32() {entry: ret void}
7 define void @ceil_f64() {entry: ret void}
8 define void @floor_f32() {entry: ret void}
9 define void @floor_f64() {entry: ret void}
15 tracksRegLiveness: true
20 ; FP32-LABEL: name: ceil_f32
22 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
23 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
24 ; FP32: $f12 = COPY [[COPY]](s32)
25 ; FP32: JAL &ceilf, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12, implicit-def $f0
26 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY $f0
27 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
28 ; FP32: $f0 = COPY [[COPY1]](s32)
29 ; FP32: RetRA implicit $f0
30 ; FP64-LABEL: name: ceil_f32
32 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
33 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
34 ; FP64: $f12 = COPY [[COPY]](s32)
35 ; FP64: JAL &ceilf, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $f12, implicit-def $f0
36 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY $f0
37 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
38 ; FP64: $f0 = COPY [[COPY1]](s32)
39 ; FP64: RetRA implicit $f0
41 %1:_(s32) = G_FCEIL %0
49 tracksRegLiveness: true
54 ; FP32-LABEL: name: ceil_f64
56 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
57 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
58 ; FP32: $d6 = COPY [[COPY]](s64)
59 ; FP32: JAL &ceil, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit-def $d0
60 ; FP32: [[COPY1:%[0-9]+]]:_(s64) = COPY $d0
61 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
62 ; FP32: $d0 = COPY [[COPY1]](s64)
63 ; FP32: RetRA implicit $d0
64 ; FP64-LABEL: name: ceil_f64
66 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
67 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
68 ; FP64: $d12_64 = COPY [[COPY]](s64)
69 ; FP64: JAL &ceil, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $d12_64, implicit-def $d0_64
70 ; FP64: [[COPY1:%[0-9]+]]:_(s64) = COPY $d0_64
71 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
72 ; FP64: $d0 = COPY [[COPY1]](s64)
73 ; FP64: RetRA implicit $d0
75 %1:_(s64) = G_FCEIL %0
83 tracksRegLiveness: true
88 ; FP32-LABEL: name: floor_f32
90 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
91 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
92 ; FP32: $f12 = COPY [[COPY]](s32)
93 ; FP32: JAL &floorf, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12, implicit-def $f0
94 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY $f0
95 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
96 ; FP32: $f0 = COPY [[COPY1]](s32)
97 ; FP32: RetRA implicit $f0
98 ; FP64-LABEL: name: floor_f32
100 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
101 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
102 ; FP64: $f12 = COPY [[COPY]](s32)
103 ; FP64: JAL &floorf, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $f12, implicit-def $f0
104 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY $f0
105 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
106 ; FP64: $f0 = COPY [[COPY1]](s32)
107 ; FP64: RetRA implicit $f0
108 %0:_(s32) = COPY $f12
109 %1:_(s32) = G_FFLOOR %0
117 tracksRegLiveness: true
122 ; FP32-LABEL: name: floor_f64
124 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
125 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
126 ; FP32: $d6 = COPY [[COPY]](s64)
127 ; FP32: JAL &floor, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit-def $d0
128 ; FP32: [[COPY1:%[0-9]+]]:_(s64) = COPY $d0
129 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
130 ; FP32: $d0 = COPY [[COPY1]](s64)
131 ; FP32: RetRA implicit $d0
132 ; FP64-LABEL: name: floor_f64
134 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
135 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
136 ; FP64: $d12_64 = COPY [[COPY]](s64)
137 ; FP64: JAL &floor, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $d12_64, implicit-def $d0_64
138 ; FP64: [[COPY1:%[0-9]+]]:_(s64) = COPY $d0_64
139 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
140 ; FP64: $d0 = COPY [[COPY1]](s64)
141 ; FP64: RetRA implicit $d0
143 %1:_(s64) = G_FFLOOR %0