ptrtoint.ll
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=CHECK
define i1 @ptrtoint_s1_p0(i64* %p) {
; CHECK-LABEL: ptrtoint_s1_p0:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movq %rdi, %rax
; CHECK-NEXT: # kill: def $al killed $al killed $rax
; CHECK-NEXT: retq
entry:
%0 = ptrtoint i64* %p to i1
ret i1 %0
}
define i8 @ptrtoint_s8_p0(i64* %p) {
; CHECK-LABEL: ptrtoint_s8_p0:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movq %rdi, %rax
; CHECK-NEXT: # kill: def $al killed $al killed $rax
; CHECK-NEXT: retq
entry:
%0 = ptrtoint i64* %p to i8
ret i8 %0
}
define i16 @ptrtoint_s16_p0(i64* %p) {
; CHECK-LABEL: ptrtoint_s16_p0:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movq %rdi, %rax
; CHECK-NEXT: # kill: def $ax killed $ax killed $rax
; CHECK-NEXT: retq
entry:
%0 = ptrtoint i64* %p to i16
ret i16 %0
}
define i32 @ptrtoint_s32_p0(i64* %p) {
; CHECK-LABEL: ptrtoint_s32_p0:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movq %rdi, %rax
; CHECK-NEXT: # kill: def $eax killed $eax killed $rax
; CHECK-NEXT: retq
entry:
%0 = ptrtoint i64* %p to i32
ret i32 %0
}
define i64 @ptrtoint_s64_p0(i64* %p) {
; CHECK-LABEL: ptrtoint_s64_p0:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movq %rdi, %rax
; CHECK-NEXT: retq
entry:
%0 = ptrtoint i64* %p to i64
ret i64 %0
}