Skip to content
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

"null" in icc output #1220

Closed
sirzooro opened this issue Dec 12, 2018 · 9 comments
Closed

"null" in icc output #1220

sirzooro opened this issue Dec 12, 2018 · 9 comments
Labels
question waiting Waiting for something

Comments

@sirzooro
Copy link

I do not know if it is problem with Compiler Explorer at https://godbolt.org/ or bug in icc. I tried to compile this code using x86_64 icc 19.0.1 with options -O3 -march=skylake-avx512:

#include <immintrin.h>

__mmask8 test(__mmask8 m)
{
    __mmask8 m2 = _kand_mask8(m, 3);
    return m2;
}

It generated this assembly code:

test(unsigned char):
        vkmovb    k0, edi                                       #5.19
        null      k1, 3                                         #5.19
        kandb     k2, k0, k1                                    #5.19
        vkmovb    eax, k2                                       #5.19
        ret                                                     #6.12

There is strange null instruction there. Please take a look on this.

@mattgodbolt
Copy link
Member

https://godbolt.org/z/GKv7nb is an example demonstrating this. if we dump the binary (see the bottom window):

test(unsigned char):
 kmovd %edi,%k0
 roll $0x0,(%rbx)
 kandb %k1,%k0,%k2
 kmovd %k2,%eax
 retq 

@mattgodbolt
Copy link
Member

Seems it's an icc bug:

ubuntu@admin-node ~> cat > /tmp/test.cc
#include <immintrin.h>

__mmask8 test(__mmask8 m)
{
    __mmask8 m2 = _kand_mask8(m, 3);
    return m2;
}
ubuntu@admin-node ~> /opt/compiler-explorer/intel-2019.1/bin/icc -S /tmp/test.cc -O3 -march=skylake-avx512 -o -
        .file "test.cc"
        .text
..TXTST0:
.L_2__routine_start__Z4testh_0:
# -- Begin  _Z4testh
        .text
       .align    16,0x90
        .globl _Z4testh
_Z4testh:
# parameter 1: %edi
..B1.1:
        .cfi_startproc
        .cfi_personality 0x3,__gxx_personality_v0
..___tag_value__Z4testh.1:
..L2:

        vkmovb    %edi, %k0
        null      $3, %k1
        kandb     %k1, %k0, %k2
        vkmovb    %k2, %eax
        ret       
        .align    16,0x90
        .cfi_endproc
        .type   _Z4testh,@function
        .size   _Z4testh,.-_Z4testh
..LN_Z4testh.0:
        .data
# -- End  _Z4testh
        .data
        .section .note.GNU-stack, ""
# End

@mattgodbolt
Copy link
Member

I filed a bug with Intel: ref 03997020

@sirzooro
Copy link
Author

Thanks for reporting it to Intel.

@mattgodbolt
Copy link
Member

From Intel:

I have reproduced this bug and escalated (CMPLRIL0-30914). Should be corrected in the upcoming compiler updates.

I will notify you once it is fixed.

@mattgodbolt
Copy link
Member

I've pinged Intel on this again, I've not heard anything.

@RubenRBS RubenRBS added waiting Waiting for something and removed tracking labels Jun 23, 2020
@jeremy-rifkin
Copy link
Member

Looks like this is fixed in newer versions of ICC. Do we want to leave this open?

@mattgodbolt
Copy link
Member

I'm delighted to close anything where we can...please do!

@jeremy-rifkin
Copy link
Member

Will go ahead and close for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question waiting Waiting for something
Projects
None yet
Development

No branches or pull requests

4 participants