-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathx86-avx512.asm
68 lines (62 loc) · 1.05 KB
/
x86-avx512.asm
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
66
67
68
%include "x86-helpers.asm"
nasm_util_assert_boilerplate
thunk_boilerplate
; AVX-512 specific x86 tests
define_bench kreg_lat
xor eax, eax
kxorb k0, k0, k0
.top:
%rep 128
kmovb k0, eax
kmovb eax, k0
%endrep
dec rdi
jnz .top
ret
; these next two tests test whether kxorb same, same, same
; is dependency breaking. The only differences between the
; nz and z variants is that the former uses different
; registers for xor input (not zeroing), while z uses the
; same registers, so is in principle a zeroing idiom
define_bench kreg_lat_nz
xor eax, eax
kxorb k0, k0, k0
kxorb k1, k1, k1
.top:
%rep 128
kmovb k0, eax
kxorb k0, k0, k1
kmovb eax, k0
%endrep
dec rdi
jnz .top
ret
; variant with zeroing kxor
define_bench kreg_lat_z
xor eax, eax
kxorb k0, k0, k0
kxorb k1, k1, k1
.top:
%rep 128
kmovb k0, eax
kxorb k0, k0, k0
kmovb eax, k0
%endrep
dec rdi
jnz .top
ret
; variant with dep-breaking move from GP
define_bench kreg_lat_mov
xor eax, eax
xor ecx, ecx
kxorb k0, k0, k0
kxorb k1, k1, k1
.top:
%rep 128
kmovb k0, eax
kmovb k0, ecx
kmovb eax, k0
%endrep
dec rdi
jnz .top
ret