1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -run-pass=legalizer %s -o - -verify-machineinstrs | FileCheck %s
9 ; CHECK-LABEL: name: test_extload
10 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
11 ; CHECK: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
12 ; CHECK: $w0 = COPY [[LOAD]](s32)
14 %1:_(s32) = G_LOAD %0 :: (load (s8))
23 ; CHECK-LABEL: name: sext_i32_i64
24 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
25 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s32))
26 ; CHECK: $x0 = COPY [[SEXTLOAD]](s64)
27 ; CHECK: RET_ReallyLR implicit $x0
29 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load (s32))
31 RET_ReallyLR implicit $x0
40 ; CHECK-LABEL: name: sext_i16_i64
41 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
42 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
43 ; CHECK: $x0 = COPY [[SEXTLOAD]](s64)
44 ; CHECK: RET_ReallyLR implicit $x0
46 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load (s16))
48 RET_ReallyLR implicit $x0
57 ; CHECK-LABEL: name: sext_i8_i64
58 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
59 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
60 ; CHECK: $x0 = COPY [[SEXTLOAD]](s64)
61 ; CHECK: RET_ReallyLR implicit $x0
63 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load (s8))
65 RET_ReallyLR implicit $x0
74 ; CHECK-LABEL: name: zext_i32_i64
75 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
76 ; CHECK: [[ZEXTLOAD:%[0-9]+]]:_(s64) = G_ZEXTLOAD [[COPY]](p0) :: (load (s32))
77 ; CHECK: $x0 = COPY [[ZEXTLOAD]](s64)
78 ; CHECK: RET_ReallyLR implicit $x0
80 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s32))
82 RET_ReallyLR implicit $x0
91 ; CHECK-LABEL: name: zext_i16_i64
92 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
93 ; CHECK: [[ZEXTLOAD:%[0-9]+]]:_(s64) = G_ZEXTLOAD [[COPY]](p0) :: (load (s16))
94 ; CHECK: $x0 = COPY [[ZEXTLOAD]](s64)
95 ; CHECK: RET_ReallyLR implicit $x0
97 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s16))
99 RET_ReallyLR implicit $x0
108 ; CHECK-LABEL: name: zext_i8_i64
109 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
110 ; CHECK: [[ZEXTLOAD:%[0-9]+]]:_(s64) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8))
111 ; CHECK: $x0 = COPY [[ZEXTLOAD]](s64)
112 ; CHECK: RET_ReallyLR implicit $x0
114 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s8))
116 RET_ReallyLR implicit $x0
124 ; CHECK-LABEL: name: zext_i8_i88
125 ; CHECK: %ptr:_(p0) = COPY $x0
126 ; CHECK: [[ZEXTLOAD:%[0-9]+]]:_(s64) = G_ZEXTLOAD %ptr(p0) :: (load (s8))
127 ; CHECK: $x0 = COPY [[ZEXTLOAD]](s64)
128 ; CHECK: RET_ReallyLR implicit $x0
129 %ptr:_(p0) = COPY $x0
130 %load:_(s88) = G_ZEXTLOAD %ptr(p0) :: (load (s8))
131 %trunc:_(s64) = G_TRUNC %load
132 $x0 = COPY %trunc(s64)
133 RET_ReallyLR implicit $x0
141 ; CHECK-LABEL: name: sext_i8_i88
142 ; CHECK: %ptr:_(p0) = COPY $x0
143 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD %ptr(p0) :: (load (s8))
144 ; CHECK: $x0 = COPY [[SEXTLOAD]](s64)
145 ; CHECK: RET_ReallyLR implicit $x0
146 %ptr:_(p0) = COPY $x0
147 %load:_(s88) = G_SEXTLOAD %ptr(p0) :: (load (s8))
148 %trunc:_(s64) = G_TRUNC %load
149 $x0 = COPY %trunc(s64)
150 RET_ReallyLR implicit $x0