Skip to content

use explicit simd for iszero check on partials #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2021
Merged

Conversation

KristofferC
Copy link
Collaborator

Now:

julia> code_native(ForwardDiff.iszero_tuple, Tuple{NTuple{4, Float64}}; debuginfo=:none)
        .section        __TEXT,__text,regular,pure_instructions
        vxorpd  %xmm0, %xmm0, %xmm0
        vcmpneqpd       (%rdi), %ymm0, %ymm0
        vmovmskpd       %ymm0, %eax
        testb   %al, %al
        sete    %al
        vzeroupper
        retq
        nopw    %cs:(%rax,%rax)

On master:

julia> code_native(ForwardDiff.iszero_tuple, Tuple{NTuple{4, Float64}}; debuginfo=:none)
        .section        __TEXT,__text,regular,pure_instructions
        vmovsd  (%rdi), %xmm1                   ## xmm1 = mem[0],zero
        vxorpd  %xmm0, %xmm0, %xmm0
        vucomisd        %xmm0, %xmm1
        jne     L46
        jp      L46
        vmovsd  8(%rdi), %xmm1                  ## xmm1 = mem[0],zero
        vucomisd        %xmm0, %xmm1
        jne     L46
        jp      L46
        vmovsd  16(%rdi), %xmm1                 ## xmm1 = mem[0],zero
        vxorpd  %xmm0, %xmm0, %xmm0
        vucomisd        %xmm0, %xmm1
        jne     L46
        jnp     L49
L46:
        xorl    %eax, %eax
        retq
L49:
        vcmpeqsd        24(%rdi), %xmm0, %xmm0
        vmovq   %xmm0, %rax
        andl    $1, %eax
        retq

@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2021

Codecov Report

Merging #559 (4469639) into master (d033d2a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #559      +/-   ##
==========================================
+ Coverage   84.95%   84.97%   +0.01%     
==========================================
  Files           9        9              
  Lines         844      845       +1     
==========================================
+ Hits          717      718       +1     
  Misses        127      127              
Impacted Files Coverage Δ
src/partials.jl 84.48% <100.00%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d033d2a...4469639. Read the comment docs.

@KristofferC KristofferC merged commit 5bb4546 into master Nov 22, 2021
@KristofferC KristofferC deleted the kc/iszero_simd branch November 22, 2021 08:48
KristofferC added a commit that referenced this pull request Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants