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 void @inttoptr_p0_s64() { ret void }
8 define void @ptrtoint_s64_p0() { ret void }
9 define void @ptrtoint_s32_p0() { ret void }
10 define void @ptrtoint_s16_p0() { ret void }
11 define void @ptrtoint_s8_p0() { ret void }
12 define void @ptrtoint_s1_p0() { ret void }
13 define void @inttoptr_v2p0_v2s64() { ret void }
22 - { id: 0, class: gpr }
23 - { id: 1, class: gpr }
27 ; CHECK-LABEL: name: inttoptr_p0_s64
28 ; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x0
29 ; CHECK: $x0 = COPY [[COPY]]
31 %1(p0) = G_INTTOPTR %0
41 - { id: 0, class: gpr }
42 - { id: 1, class: gpr }
46 ; CHECK-LABEL: name: ptrtoint_s64_p0
47 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
48 ; CHECK: $x0 = COPY [[COPY]]
50 %1(s64) = G_PTRTOINT %0
60 - { id: 0, class: gpr }
61 - { id: 1, class: gpr }
65 ; CHECK-LABEL: name: ptrtoint_s32_p0
66 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
67 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]].sub_32
68 ; CHECK: $w0 = COPY [[COPY1]]
70 %1(s32) = G_PTRTOINT %0
80 - { id: 0, class: gpr }
81 - { id: 1, class: gpr }
85 ; CHECK-LABEL: name: ptrtoint_s16_p0
86 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
87 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]].sub_32
88 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY1]]
89 ; CHECK: $w0 = COPY [[COPY2]]
91 %1(s16) = G_PTRTOINT %0
92 %2:gpr(s32) = G_ANYEXT %1
102 - { id: 0, class: gpr }
103 - { id: 1, class: gpr }
107 ; CHECK-LABEL: name: ptrtoint_s8_p0
108 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
109 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]].sub_32
110 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY1]]
111 ; CHECK: $w0 = COPY [[COPY2]]
113 %1(s8) = G_PTRTOINT %0
114 %2:gpr(s32) = G_ANYEXT %1
121 regBankSelected: true
124 - { id: 0, class: gpr }
125 - { id: 1, class: gpr }
129 ; CHECK-LABEL: name: ptrtoint_s1_p0
130 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
131 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]].sub_32
132 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY1]]
133 ; CHECK: $w0 = COPY [[COPY2]]
135 %1(s1) = G_PTRTOINT %0
136 %2:gpr(s32) = G_ANYEXT %1
141 name: inttoptr_v2p0_v2s64
143 regBankSelected: true
144 tracksRegLiveness: true
148 ; CHECK-LABEL: name: inttoptr_v2p0_v2s64
149 ; CHECK: liveins: $q0, $x0
150 ; CHECK: [[COPY:%[0-9]+]]:fpr128 = COPY $q0
151 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY [[COPY]].dsub
152 ; CHECK: $x0 = COPY [[COPY1]]
153 ; CHECK: RET_ReallyLR implicit $x0
154 %1:fpr(<2 x s64>) = COPY $q0
155 %2:fpr(<2 x p0>) = G_INTTOPTR %1(<2 x s64>)
156 %4:gpr(s64) = G_CONSTANT i64 0
157 %3:fpr(p0) = G_EXTRACT_VECTOR_ELT %2(<2 x p0>), %4(s64)
159 RET_ReallyLR implicit $x0