]> git.lizzy.rs Git - rust.git/blob - copy.clif
Fix filename length for ar files
[rust.git] / copy.clif
1 target x86_64
2
3 ; copy_nonoverlapping
4 function u0:0(i64, i64, i64) fast {
5     ss0 = explicit_slot 8
6     ss1 = explicit_slot 8
7     ss2 = explicit_slot 8
8 ebb0(v0: i64, v1: i64, v2: i64): ; fn(src, dst, count)
9     v99 = iconst.i64 1
10     jump ebb1(v0, v1, v2)
11
12 ebb1(v10: i64, v11: i64, v12: i64):
13     ; if no more bytes to copy, return
14     brz v12, ebb2
15
16     ; copy one byte
17     v20 = uload8.i32 v10
18     istore8.i32 v20, v11
19
20     ; increment src and dst and decrement remaining count
21     v30 = iadd_imm v10, 1
22     v31 = iadd_imm v11, 1
23     v32 = isub v12, v99
24
25     ; loop
26     jump ebb1(v30, v31, v32)
27
28 ebb2:
29     return
30 }
31
32 ; copy
33 function u0:0(i64, i64, i64) fast {
34     ss0 = explicit_slot 8
35     ss1 = explicit_slot 8
36     ss2 = explicit_slot 8
37 ebb0(v0: i64, v1: i64, v2: i64): ; fn(src, dst, count):
38     v98 = iconst.i64 8
39     v99 = iconst.i64 1
40     jump ebb1(v0, v1, v2)
41
42 ; copy eight bytes
43 ebb1(v10: i64, v11: i64, v12: i64):
44     ; if less than eight bytes to copy, goto ebb2
45     v90 = icmp ult v12, v98
46     brz v90, ebb2(v10, v11, v12)
47
48     ; copy one byte
49     v80 = load.i64 v10
50     store.i64 v80, v11
51
52     ; increment src and dst and decrement remaining count
53     v20 = iadd_imm v0, 1
54     v21 = iadd_imm v1, 1
55     v22 = isub v2, v98
56
57     ; loop
58     jump ebb1(v20, v21, v22)
59
60 ; copy one byte
61 ebb2(v30: i64, v31: i64, v32: i64):
62     ; if no more bytes to copy, return
63     brz v32, ebb3
64
65     ; copy one byte
66     v81 = uload8.i32 v30
67     istore8.i32 v81, v31
68
69     ; increment src and dst and decrement remaining count
70     v40 = iadd_imm v30, 1
71     v41 = iadd_imm v31, 1
72     v42 = isub v32, v99
73
74     ; loop
75     jump ebb2(v40, v41, v42)
76
77 ; done
78 ebb3:
79     return
80 }