1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=i386-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
6 define i1 @ptrtoint_s1_p0(i64* %p) {
8 %0 = ptrtoint i64* %p to i1
12 define i8 @ptrtoint_s8_p0(i64* %p) {
14 %0 = ptrtoint i64* %p to i8
18 define i16 @ptrtoint_s16_p0(i64* %p) {
20 %0 = ptrtoint i64* %p to i16
24 define i32 @ptrtoint_s32_p0(i64* %p) {
26 %0 = ptrtoint i64* %p to i32
36 tracksRegLiveness: true
38 - { id: 0, class: gpr }
39 - { id: 1, class: gpr }
40 - { id: 2, class: gpr }
41 - { id: 3, class: gpr }
45 - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
48 ; CHECK-LABEL: name: ptrtoint_s1_p0
49 ; CHECK: [[MOV32rm:%[0-9]+]]:gr32_abcd = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
50 ; CHECK: [[COPY:%[0-9]+]]:gr8 = COPY [[MOV32rm]].sub_8bit
51 ; CHECK: $al = COPY [[COPY]]
52 ; CHECK: RET 0, implicit $al
53 %1:gpr(p0) = G_FRAME_INDEX %fixed-stack.0
54 %0:gpr(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
55 %2:gpr(s1) = G_PTRTOINT %0(p0)
56 %3:gpr(s8) = G_ANYEXT %2(s1)
66 tracksRegLiveness: true
68 - { id: 0, class: gpr }
69 - { id: 1, class: gpr }
70 - { id: 2, class: gpr }
74 - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
77 ; CHECK-LABEL: name: ptrtoint_s8_p0
78 ; CHECK: [[MOV32rm:%[0-9]+]]:gr32_abcd = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
79 ; CHECK: [[COPY:%[0-9]+]]:gr8 = COPY [[MOV32rm]].sub_8bit
80 ; CHECK: $al = COPY [[COPY]]
81 ; CHECK: RET 0, implicit $al
82 %1:gpr(p0) = G_FRAME_INDEX %fixed-stack.0
83 %0:gpr(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
84 %2:gpr(s8) = G_PTRTOINT %0(p0)
94 tracksRegLiveness: true
96 - { id: 0, class: gpr }
97 - { id: 1, class: gpr }
98 - { id: 2, class: gpr }
102 - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
105 ; CHECK-LABEL: name: ptrtoint_s16_p0
106 ; CHECK: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
107 ; CHECK: [[COPY:%[0-9]+]]:gr16 = COPY [[MOV32rm]].sub_16bit
108 ; CHECK: $ax = COPY [[COPY]]
109 ; CHECK: RET 0, implicit $ax
110 %1:gpr(p0) = G_FRAME_INDEX %fixed-stack.0
111 %0:gpr(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
112 %2:gpr(s16) = G_PTRTOINT %0(p0)
118 name: ptrtoint_s32_p0
121 regBankSelected: true
122 tracksRegLiveness: true
124 - { id: 0, class: gpr }
125 - { id: 1, class: gpr }
126 - { id: 2, class: gpr }
130 - { id: 0, size: 4, alignment: 16, stack-id: default, isImmutable: true }
133 ; CHECK-LABEL: name: ptrtoint_s32_p0
134 ; CHECK: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16)
135 ; CHECK: $eax = COPY [[MOV32rm]]
136 ; CHECK: RET 0, implicit $eax
137 %1:gpr(p0) = G_FRAME_INDEX %fixed-stack.0
138 %0:gpr(p0) = G_LOAD %1(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
139 %2:gpr(s32) = G_PTRTOINT %0(p0)