1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define i8 @const_s8() { ret i8 42 }
8 define i16 @const_s16() { ret i16 42 }
9 define i32 @const_s32() { ret i32 42 }
10 define i64 @const_s64() { ret i64 1234567890123 }
12 define i32 @fconst_s32() { ret i32 42 }
13 define i64 @fconst_s64() { ret i64 1234567890123 }
14 define float @fconst_s32_0() { ret float 0.0 }
15 define double @fconst_s64_0() { ret double 0.0 }
17 define void @optnone_i64() optnone noinline { ret void }
18 define void @opt_i64() { ret void }
27 ; CHECK-LABEL: name: const_s8
28 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42
29 ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY [[MOVi32imm]]
30 ; CHECK: $w0 = COPY [[COPY]]
31 %0:gpr(s8) = G_CONSTANT i8 42
32 %1:gpr(s32) = G_ANYEXT %0(s8)
42 ; CHECK-LABEL: name: const_s16
43 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42
44 ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY [[MOVi32imm]]
45 ; CHECK: $w0 = COPY [[COPY]]
46 %0:gpr(s16) = G_CONSTANT i16 42
47 %1:gpr(s32) = G_ANYEXT %0(s16)
56 - { id: 0, class: gpr }
60 ; CHECK-LABEL: name: const_s32
61 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42
62 ; CHECK: $w0 = COPY [[MOVi32imm]]
63 %0(s32) = G_CONSTANT i32 42
72 - { id: 0, class: gpr }
76 ; CHECK-LABEL: name: const_s64
77 ; CHECK: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm 1234567890123
78 ; CHECK: $x0 = COPY [[MOVi64imm]]
79 %0(s64) = G_CONSTANT i64 1234567890123
88 - { id: 0, class: fpr }
92 ; CHECK-LABEL: name: fconst_s32
93 ; CHECK: [[FMOVSi:%[0-9]+]]:fpr32 = FMOVSi 12
94 ; CHECK: $s0 = COPY [[FMOVSi]]
95 %0(s32) = G_FCONSTANT float 3.5
102 regBankSelected: true
104 - { id: 0, class: fpr }
108 ; CHECK-LABEL: name: fconst_s64
109 ; CHECK: [[FMOVDi:%[0-9]+]]:fpr64 = FMOVDi 112
110 ; CHECK: $d0 = COPY [[FMOVDi]]
111 %0(s64) = G_FCONSTANT double 1.0
118 regBankSelected: true
120 - { id: 0, class: fpr }
124 ; CHECK-LABEL: name: fconst_s32_0
125 ; CHECK: [[FMOVS0_:%[0-9]+]]:fpr32 = FMOVS0
126 ; CHECK: $s0 = COPY [[FMOVS0_]]
127 %0(s32) = G_FCONSTANT float 0.0
134 regBankSelected: true
136 - { id: 0, class: fpr }
140 ; CHECK-LABEL: name: fconst_s64_0
141 ; CHECK: [[FMOVD0_:%[0-9]+]]:fpr64 = FMOVD0
142 ; CHECK: $x0 = COPY [[FMOVD0_]]
143 %0(s64) = G_FCONSTANT double 0.0
149 regBankSelected: true
152 ; CHECK-LABEL: name: optnone_i64
153 ; CHECK: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm 42
154 ; CHECK: $x0 = COPY [[MOVi64imm]]
155 ; CHECK: RET_ReallyLR implicit $x0
156 %0:gpr(s64) = G_CONSTANT i64 42
158 RET_ReallyLR implicit $x0
163 regBankSelected: true
166 ; CHECK-LABEL: name: opt_i64
167 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42
168 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64all = SUBREG_TO_REG 0, [[MOVi32imm]], %subreg.sub_32
169 ; CHECK: $x0 = COPY [[SUBREG_TO_REG]]
170 ; CHECK: RET_ReallyLR implicit $x0
171 %0:gpr(s64) = G_CONSTANT i64 42
173 RET_ReallyLR implicit $x0