File: arm64-ldur.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (65 lines) | stat: -rw-r--r-- 1,554 bytes parent folder | download | duplicates (14)
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
57
58
59
60
61
62
63
64
65
; RUN: llc < %s -mtriple=arm64-eabi | FileCheck %s

define i64 @_f0(ptr %p) {
; CHECK: f0:
; CHECK: ldur x0, [x0, #-8]
; CHECK-NEXT: ret
  %tmp = getelementptr inbounds i64, ptr %p, i64 -1
  %ret = load i64, ptr %tmp, align 2
  ret i64 %ret
}
define i32 @_f1(ptr %p) {
; CHECK: f1:
; CHECK: ldur w0, [x0, #-4]
; CHECK-NEXT: ret
  %tmp = getelementptr inbounds i32, ptr %p, i64 -1
  %ret = load i32, ptr %tmp, align 2
  ret i32 %ret
}
define i16 @_f2(ptr %p) {
; CHECK: f2:
; CHECK: ldurh w0, [x0, #-2]
; CHECK-NEXT: ret
  %tmp = getelementptr inbounds i16, ptr %p, i64 -1
  %ret = load i16, ptr %tmp, align 2
  ret i16 %ret
}
define i8 @_f3(ptr %p) {
; CHECK: f3:
; CHECK: ldurb w0, [x0, #-1]
; CHECK-NEXT: ret
  %tmp = getelementptr inbounds i8, ptr %p, i64 -1
  %ret = load i8, ptr %tmp, align 2
  ret i8 %ret
}

define i64 @zext32(ptr %a) nounwind ssp {
; CHECK-LABEL: zext32:
; CHECK: ldur w0, [x0, #-12]
; CHECK-NEXT: ret
  %p = getelementptr inbounds i8, ptr %a, i64 -12
  %tmp2 = load i32, ptr %p, align 4
  %ret = zext i32 %tmp2 to i64

  ret i64 %ret
}
define i64 @zext16(ptr %a) nounwind ssp {
; CHECK-LABEL: zext16:
; CHECK: ldurh w0, [x0, #-12]
; CHECK-NEXT: ret
  %p = getelementptr inbounds i8, ptr %a, i64 -12
  %tmp2 = load i16, ptr %p, align 2
  %ret = zext i16 %tmp2 to i64

  ret i64 %ret
}
define i64 @zext8(ptr %a) nounwind ssp {
; CHECK-LABEL: zext8:
; CHECK: ldurb w0, [x0, #-12]
; CHECK-NEXT: ret
  %p = getelementptr inbounds i8, ptr %a, i64 -12
  %tmp2 = load i8, ptr %p, align 1
  %ret = zext i8 %tmp2 to i64

  ret i64 %ret
}