Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions zerocopy/benches/ref_from_bytes_dynamic_padding.x86-64
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
bench_ref_from_bytes_dynamic_padding:
test dil, 3
jne .LBB5_3
movabs rax, 9223372036854775804
and rax, rsi
cmp rax, 9
jb .LBB5_3
add rax, -9
jne .LBB5_1
test sil, 3
setne al
cmp rsi, 9
setb cl
or cl, al
je .LBB5_3
.LBB5_1:
xor edi, edi
mov rax, rdi
ret
.LBB5_3:
add rsi, -9
movabs rcx, -6148914691236517205
mov rax, rsi
mul rcx
shr rdx
lea rax, [rdx + 2*rdx]
or rax, 3
add rax, 9
cmp rsi, rax
je .LBB5_4
.LBB5_3:
xor edi, edi
mov rdx, rsi
.LBB5_4:
mov rax, rdi
ret
72 changes: 35 additions & 37 deletions zerocopy/benches/ref_from_bytes_dynamic_padding.x86-64.mca
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Iterations: 100
Instructions: 1900
Total Cycles: 645
Total uOps: 2000
Instructions: 1800
Total Cycles: 607
Total uOps: 1900

Dispatch Width: 4
uOps Per Cycle: 3.10
IPC: 2.95
Block RThroughput: 5.0
uOps Per Cycle: 3.13
IPC: 2.97
Block RThroughput: 4.8


Instruction Info:
Expand All @@ -19,22 +19,21 @@ Instruction Info:

[1] [2] [3] [4] [5] [6] Instructions:
1 1 0.33 test dil, 3
1 1 1.00 jne .LBB5_3
1 1 0.33 movabs rax, 9223372036854775804
1 1 0.33 and rax, rsi
1 1 0.33 cmp rax, 9
1 1 1.00 jb .LBB5_3
1 1 0.33 add rax, -9
1 1 1.00 jne .LBB5_1
1 1 0.33 test sil, 3
1 1 0.50 setne al
1 1 0.33 cmp rsi, 9
1 1 0.50 setb cl
1 1 0.33 or cl, al
1 1 1.00 je .LBB5_3
1 0 0.25 xor edi, edi
1 1 0.33 mov rax, rdi
1 1 1.00 U ret
1 1 0.33 add rsi, -9
1 1 0.33 movabs rcx, -6148914691236517205
1 1 0.33 mov rax, rsi
2 4 1.00 mul rcx
1 1 0.50 shr rdx
1 1 0.50 lea rax, [rdx + 2*rdx]
1 1 0.33 or rax, 3
1 1 0.33 add rax, 9
1 1 0.33 cmp rsi, rax
1 1 1.00 je .LBB5_4
1 0 0.25 xor edi, edi
1 1 0.33 mov rdx, rsi
1 1 0.33 mov rax, rdi
1 1 1.00 U ret

Expand All @@ -52,26 +51,25 @@ Resources:

Resource pressure per iteration:
[0] [1] [2] [3] [4] [5] [6.0] [6.1]
- - 6.32 6.33 - 6.35 - -
- - 6.00 6.00 - 6.00 - -

Resource pressure by instruction:
[0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
- - 0.64 0.35 - 0.01 - - test dil, 3
- - - - - 1.00 - - jne .LBB5_3
- - 0.34 0.65 - 0.01 - - movabs rax, 9223372036854775804
- - 0.35 0.65 - - - - and rax, rsi
- - 0.33 0.34 - 0.33 - - cmp rax, 9
- - - - - 1.00 - - jb .LBB5_3
- - 0.35 - - 0.65 - - add rax, -9
- - 0.97 0.01 - 0.02 - - movabs rcx, -6148914691236517205
- - 1.00 1.00 - - - - mul rcx
- - 0.99 - - 0.01 - - shr rdx
- - 0.33 0.67 - - - - lea rax, [rdx + 2*rdx]
- - 0.34 0.66 - - - - or rax, 3
- - 0.33 0.66 - 0.01 - - add rax, 9
- - 0.01 0.99 - - - - cmp rsi, rax
- - - - - 1.00 - - je .LBB5_4
- - 0.50 0.49 - 0.01 - - test dil, 3
- - - - - 1.00 - - jne .LBB5_1
- - 0.49 0.01 - 0.50 - - test sil, 3
- - 1.00 - - - - - setne al
- - - 1.00 - - - - cmp rsi, 9
- - 0.51 - - 0.49 - - setb cl
- - 0.50 - - 0.50 - - or cl, al
- - - - - 1.00 - - je .LBB5_3
- - - - - - - - xor edi, edi
- - 0.32 0.01 - 0.67 - - mov rdx, rsi
- - 0.02 0.34 - 0.64 - - mov rax, rdi
- - - 0.51 - 0.49 - - mov rax, rdi
- - - - - 1.00 - - ret
- - - 0.99 - 0.01 - - add rsi, -9
- - - 1.00 - - - - movabs rcx, -6148914691236517205
- - 0.51 0.49 - - - - mov rax, rsi
- - 1.00 1.00 - - - - mul rcx
- - 1.00 - - - - - shr rdx
- - 0.49 0.51 - - - - mov rax, rdi
- - - - - 1.00 - - ret
25 changes: 11 additions & 14 deletions zerocopy/benches/ref_from_bytes_dynamic_size.x86-64
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
bench_ref_from_bytes_dynamic_size:
mov rax, rdi
test al, 1
jne .LBB5_1
mov rdx, rsi
cmp rsi, 4
setb al
or al, dil
test al, 1
je .LBB5_2
setb cl
or cl, dl
test cl, 1
je .LBB5_3
.LBB5_1:
xor eax, eax
ret
.LBB5_2:
lea rcx, [rdx - 4]
mov rsi, rcx
and rsi, -2
add rsi, 4
shr rcx
xor eax, eax
cmp rdx, rsi
cmove rdx, rcx
cmove rax, rdi
.LBB5_3:
add rdx, -4
shr rdx
ret
62 changes: 27 additions & 35 deletions zerocopy/benches/ref_from_bytes_dynamic_size.x86-64.mca
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Iterations: 100
Instructions: 1800
Total Cycles: 704
Total uOps: 2000
Instructions: 1400
Total Cycles: 438
Total uOps: 1400

Dispatch Width: 4
uOps Per Cycle: 2.84
IPC: 2.56
Block RThroughput: 5.0
uOps Per Cycle: 3.20
IPC: 3.20
Block RThroughput: 4.0


Instruction Info:
Expand All @@ -18,23 +18,19 @@ Instruction Info:
[6]: HasSideEffects (U)

[1] [2] [3] [4] [5] [6] Instructions:
1 1 0.33 mov rax, rdi
1 1 0.33 test al, 1
1 1 1.00 jne .LBB5_1
1 1 0.33 mov rdx, rsi
1 1 0.33 cmp rsi, 4
1 1 0.50 setb al
1 1 0.33 or al, dil
1 1 0.33 test al, 1
1 1 1.00 je .LBB5_2
1 1 0.50 setb cl
1 1 0.33 or cl, dl
1 1 0.33 test cl, 1
1 1 1.00 je .LBB5_3
1 0 0.25 xor eax, eax
1 1 1.00 U ret
1 1 0.50 lea rcx, [rdx - 4]
1 1 0.33 mov rsi, rcx
1 1 0.33 and rsi, -2
1 1 0.33 add rsi, 4
1 1 0.50 shr rcx
1 0 0.25 xor eax, eax
1 1 0.33 cmp rdx, rsi
2 2 0.67 cmove rdx, rcx
2 2 0.67 cmove rax, rdi
1 1 0.33 add rdx, -4
1 1 0.50 shr rdx
1 1 1.00 U ret


Expand All @@ -51,25 +47,21 @@ Resources:

Resource pressure per iteration:
[0] [1] [2] [3] [4] [5] [6.0] [6.1]
- - 5.97 5.98 - 6.05 - -
- - 4.32 4.33 - 4.35 - -

Resource pressure by instruction:
[0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
- - 0.97 0.01 - 0.02 - - mov rdx, rsi
- - 0.01 0.02 - 0.97 - - cmp rsi, 4
- - 0.03 - - 0.97 - - setb al
- - 0.01 0.02 - 0.97 - - or al, dil
- - - 0.98 - 0.02 - - test al, 1
- - - - - 1.00 - - je .LBB5_2
- - 0.33 0.66 - 0.01 - - mov rax, rdi
- - 0.67 0.33 - - - - test al, 1
- - - - - 1.00 - - jne .LBB5_1
- - 0.33 0.34 - 0.33 - - mov rdx, rsi
- - 0.33 0.66 - 0.01 - - cmp rsi, 4
- - 1.00 - - - - - setb cl
- - - 1.00 - - - - or cl, dl
- - - 1.00 - - - - test cl, 1
- - - - - 1.00 - - je .LBB5_3
- - - - - - - - xor eax, eax
- - - - - 1.00 - - ret
- - 0.98 0.02 - - - - lea rcx, [rdx - 4]
- - 0.01 0.99 - - - - mov rsi, rcx
- - - 0.98 - 0.02 - - and rsi, -2
- - 0.98 0.01 - 0.01 - - add rsi, 4
- - 0.99 - - 0.01 - - shr rcx
- - - - - - - - xor eax, eax
- - 0.02 0.97 - 0.01 - - cmp rdx, rsi
- - 0.99 0.99 - 0.02 - - cmove rdx, rcx
- - 0.98 0.99 - 0.03 - - cmove rax, rdi
- - 0.66 0.34 - - - - add rdx, -4
- - 1.00 - - - - - shr rdx
- - - - - 1.00 - - ret
18 changes: 9 additions & 9 deletions zerocopy/benches/ref_from_prefix_dynamic_padding.x86-64
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
bench_ref_from_prefix_dynamic_padding:
xor edx, edx
mov eax, 0
test dil, 3
je .LBB5_1
ret
.LBB5_1:
jne .LBB5_2
movabs rax, 9223372036854775804
and rsi, rax
cmp rsi, 9
jae .LBB5_3
mov edx, 1
xor eax, eax
cmp rsi, 8
ja .LBB5_3
.LBB5_2:
xor edx, edx
test dil, 3
sete dl
xor edi, edi
mov rax, rdi
ret
.LBB5_3:
add rsi, -9
Expand Down
48 changes: 24 additions & 24 deletions zerocopy/benches/ref_from_prefix_dynamic_padding.x86-64.mca
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Iterations: 100
Instructions: 1900
Total Cycles: 608
Total Cycles: 607
Total uOps: 2000

Dispatch Width: 4
Expand All @@ -18,17 +18,17 @@ Instruction Info:
[6]: HasSideEffects (U)

[1] [2] [3] [4] [5] [6] Instructions:
1 0 0.25 xor edx, edx
1 1 0.33 mov eax, 0
1 1 0.33 test dil, 3
1 1 1.00 je .LBB5_1
1 1 1.00 U ret
1 1 1.00 jne .LBB5_2
1 1 0.33 movabs rax, 9223372036854775804
1 1 0.33 and rsi, rax
1 1 0.33 cmp rsi, 9
1 1 1.00 jae .LBB5_3
1 1 0.33 mov edx, 1
1 0 0.25 xor eax, eax
1 1 0.33 cmp rsi, 8
1 1 1.00 ja .LBB5_3
1 0 0.25 xor edx, edx
1 1 0.33 test dil, 3
1 1 0.50 sete dl
1 0 0.25 xor edi, edi
1 1 0.33 mov rax, rdi
1 1 1.00 U ret
1 1 0.33 add rsi, -9
1 1 0.33 movabs rcx, -6148914691236517205
Expand All @@ -52,26 +52,26 @@ Resources:

Resource pressure per iteration:
[0] [1] [2] [3] [4] [5] [6.0] [6.1]
- - 6.00 6.00 - 6.00 - -
- - 6.00 5.99 - 6.01 - -

Resource pressure by instruction:
[0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
- - 0.01 0.98 - 0.01 - - test dil, 3
- - - - - 1.00 - - jne .LBB5_2
- - 0.98 0.01 - 0.01 - - movabs rax, 9223372036854775804
- - 0.01 0.99 - - - - and rsi, rax
- - 0.01 0.99 - - - - cmp rsi, 8
- - - - - 1.00 - - ja .LBB5_3
- - - - - - - - xor edx, edx
- - 0.01 0.98 - 0.01 - - mov eax, 0
- - 0.98 0.01 - 0.01 - - test dil, 3
- - - - - 1.00 - - je .LBB5_1
- - - - - 1.00 - - ret
- - 0.01 0.99 - - - - movabs rax, 9223372036854775804
- - - 1.00 - - - - and rsi, rax
- - - 1.00 - - - - cmp rsi, 9
- - - - - 1.00 - - jae .LBB5_3
- - 1.00 - - - - - mov edx, 1
- - - - - - - - xor eax, eax
- - 0.99 0.01 - - - - test dil, 3
- - 0.99 - - 0.01 - - sete dl
- - - - - - - - xor edi, edi
- - - 0.01 - 0.99 - - mov rax, rdi
- - - - - 1.00 - - ret
- - 0.02 0.02 - 0.96 - - add rsi, -9
- - 0.99 0.01 - - - - movabs rcx, -6148914691236517205
- - 0.01 0.99 - - - - mov rax, rsi
- - 0.01 0.99 - - - - add rsi, -9
- - - 1.00 - - - - movabs rcx, -6148914691236517205
- - 1.00 - - - - - mov rax, rsi
- - 1.00 1.00 - - - - mul rcx
- - 1.00 - - - - - shr rdx
- - 0.98 - - 0.02 - - mov rax, rdi
- - - 0.01 - 0.99 - - mov rax, rdi
- - - - - 1.00 - - ret
21 changes: 7 additions & 14 deletions zerocopy/benches/ref_from_prefix_dynamic_size.x86-64
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
bench_ref_from_prefix_dynamic_size:
xor edx, edx
mov eax, 0
test dil, 1
jne .LBB5_4
cmp rsi, 4
jae .LBB5_3
mov edx, 1
xor eax, eax
ret
.LBB5_3:
add rsi, -4
shr rsi
mov rdx, rsi
mov rax, rdi
.LBB5_4:
xor eax, eax
sub rdx, 4
mov rcx, rdi
cmovb rcx, rax
shr rdx
test dil, 1
cmove rax, rcx
ret
Loading
Loading