xref: /llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/combine-fminimum-fmaximum.mir (revision 29bebb0237965618b6c91fe32f63d13cf9ecabc5)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs -mtriple aarch64-unknown-unknown %s -o - | FileCheck %s
3
4---
5name:            test_combine_nan_rhs_fminimum_half
6body:             |
7  bb.1:
8  liveins:
9    ; CHECK-LABEL: name: test_combine_nan_rhs_fminimum_half
10    ; CHECK: [[C:%[0-9]+]]:_(s16) = G_FCONSTANT half 0xH7C01
11    ; CHECK-NEXT: $h0 = COPY [[C]](s16)
12    %0:_(s16) = COPY $h0
13    %1:_(s16) = G_FCONSTANT half 0xH7C01
14    %2:_(s16) = G_FMINIMUM %0, %1
15    $h0 = COPY %2
16...
17---
18name:            test_combine_nan_rhs_fminimum_float
19body:             |
20  bb.1:
21  liveins:
22    ; CHECK-LABEL: name: test_combine_nan_rhs_fminimum_float
23    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x7FF8000000000000
24    ; CHECK-NEXT: $w0 = COPY [[C]](s32)
25    %0:_(s32) = COPY $w0
26    %1:_(s32) = G_FCONSTANT float 0x7FF8000000000000
27    %2:_(s32) = G_FMINIMUM %0, %1
28    $w0 = COPY %2
29...
30---
31name:            test_combine_nan_rhs_fminimum_double
32body:             |
33  bb.1:
34  liveins:
35    ; CHECK-LABEL: name: test_combine_nan_rhs_fminimum_double
36    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x7FF8000000000000
37    ; CHECK-NEXT: $x0 = COPY [[C]](s64)
38    %0:_(s64) = COPY $x0
39    %1:_(s64) = G_FCONSTANT double 0x7FF8000000000000
40    %2:_(s64) = G_FMINIMUM %0, %1
41    $x0 = COPY %2
42...
43---
44name:            test_combine_nan_lhs_fminimum_half
45body:             |
46  bb.1:
47  liveins:
48    ; CHECK-LABEL: name: test_combine_nan_lhs_fminimum_half
49    ; CHECK: [[C:%[0-9]+]]:_(s16) = G_FCONSTANT half 0xH7C01
50    ; CHECK-NEXT: $h0 = COPY [[C]](s16)
51    %0:_(s16) = COPY $h0
52    %1:_(s16) = G_FCONSTANT half 0xH7C01
53    %2:_(s16) = G_FMINIMUM %1, %0
54    $h0 = COPY %2
55...
56---
57name:            test_combine_nan_lhs_fminimum_float
58body:             |
59  bb.1:
60  liveins:
61    ; CHECK-LABEL: name: test_combine_nan_lhs_fminimum_float
62    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x7FF8000000000000
63    ; CHECK-NEXT: $w0 = COPY [[C]](s32)
64    %0:_(s32) = COPY $w0
65    %1:_(s32) = G_FCONSTANT float 0x7FF8000000000000
66    %2:_(s32) = G_FMINIMUM %1, %0
67    $w0 = COPY %2
68...
69---
70name:            test_combine_nan_lhs_fminimum_double
71body:             |
72  bb.1:
73  liveins:
74    ; CHECK-LABEL: name: test_combine_nan_lhs_fminimum_double
75    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x7FF8000000000000
76    ; CHECK-NEXT: $x0 = COPY [[C]](s64)
77    %0:_(s64) = COPY $x0
78    %1:_(s64) = G_FCONSTANT double 0x7FF8000000000000
79    %2:_(s64) = G_FMINIMUM %1, %0
80    $x0 = COPY %2
81...
82---
83name:            test_combine_nan_rhs_fmaximum_half
84body:             |
85  bb.1:
86  liveins:
87    ; CHECK-LABEL: name: test_combine_nan_rhs_fmaximum_half
88    ; CHECK: [[C:%[0-9]+]]:_(s16) = G_FCONSTANT half 0xH7C01
89    ; CHECK-NEXT: $h0 = COPY [[C]](s16)
90    %0:_(s16) = COPY $h0
91    %1:_(s16) = G_FCONSTANT half 0xH7C01
92    %2:_(s16) = G_FMAXIMUM %0, %1
93    $h0 = COPY %2
94...
95---
96name:            test_combine_nan_rhs_fmaximum_float
97body:             |
98  bb.1:
99  liveins:
100    ; CHECK-LABEL: name: test_combine_nan_rhs_fmaximum_float
101    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x7FF8000000000000
102    ; CHECK-NEXT: $w0 = COPY [[C]](s32)
103    %0:_(s32) = COPY $w0
104    %1:_(s32) = G_FCONSTANT float 0x7FF8000000000000
105    %2:_(s32) = G_FMAXIMUM %0, %1
106    $w0 = COPY %2
107...
108---
109name:            test_combine_nan_rhs_fmaximum_double
110body:             |
111  bb.1:
112  liveins:
113    ; CHECK-LABEL: name: test_combine_nan_rhs_fmaximum_double
114    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x7FF8000000000000
115    ; CHECK-NEXT: $x0 = COPY [[C]](s64)
116    %0:_(s64) = COPY $x0
117    %1:_(s64) = G_FCONSTANT double 0x7FF8000000000000
118    %2:_(s64) = G_FMAXIMUM %0, %1
119    $x0 = COPY %2
120...
121---
122name:            test_combine_nan_lhs_fmaximum_half
123body:             |
124  bb.1:
125  liveins:
126    ; CHECK-LABEL: name: test_combine_nan_lhs_fmaximum_half
127    ; CHECK: [[C:%[0-9]+]]:_(s16) = G_FCONSTANT half 0xH7C01
128    ; CHECK-NEXT: $h0 = COPY [[C]](s16)
129    %0:_(s16) = COPY $h0
130    %1:_(s16) = G_FCONSTANT half 0xH7C01
131    %2:_(s16) = G_FMAXIMUM %1, %0
132    $h0 = COPY %2
133...
134---
135name:            test_combine_nan_lhs_fmaximum_float
136body:             |
137  bb.1:
138  liveins:
139    ; CHECK-LABEL: name: test_combine_nan_lhs_fmaximum_float
140    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x7FF8000000000000
141    ; CHECK-NEXT: $w0 = COPY [[C]](s32)
142    %0:_(s32) = COPY $w0
143    %1:_(s32) = G_FCONSTANT float 0x7FF8000000000000
144    %2:_(s32) = G_FMAXIMUM %1, %0
145    $w0 = COPY %2
146...
147---
148name:            test_combine_nan_lhs_fmaximum_double
149body:             |
150  bb.1:
151  liveins:
152    ; CHECK-LABEL: name: test_combine_nan_lhs_fmaximum_double
153    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x7FF8000000000000
154    ; CHECK-NEXT: $x0 = COPY [[C]](s64)
155    %0:_(s64) = COPY $x0
156    %1:_(s64) = G_FCONSTANT double 0x7FF8000000000000
157    %2:_(s64) = G_FMAXIMUM %1, %0
158    $x0 = COPY %2
159...
160