summaryrefslogtreecommitdiff
path: root/1/repair_avx.asm
blob: 7271138abca420d4d4081672937897a0ade25cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
global repair_avx_inner

section .text

repair_avx_inner:
;    vpbroadcastd    ymm1, edi                 ; AVX512VL AVX512F
    vmovd           xmm1, edi
    vpbroadcastd    ymm1, xmm1
    vpsubd          ymm1, ymm0, ymm1
%assign i 0
%rep    25
    vpcmpeqd        ymm2, ymm1, [rsi + i]
    vpmovmskb       eax, ymm2
    test            eax, eax
    jne             .found
%assign i i+32
%endrep
    xor             eax, eax                ; not found, return 0
    vzeroupper                              ; eliminate performance penalties caused by false dependencies when transitioning between AVX and legacy SSE instructions
    ret
.found:
    vzeroupper                              ; eliminate performance penalties caused by false dependencies when transitioning between AVX and legacy SSE instructions
    movd            eax, xmm1
    ret