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

How to run CoreCLR with the AVX support? #977

Closed
AndreyAkinshin opened this Issue May 11, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@AndreyAkinshin
Member

AndreyAkinshin commented May 11, 2015

Let's consider the following method:

[MethodImpl(MethodImplOptions.NoInlining)]
public double Run()
{
    return Math.Sqrt(1);
}

I have the following asm code from Visual Studio 2015 RC (x64, useLegacyJit=0, Release mode):

        return Math.Sqrt(1);
00007FF94F9B4A50  vsqrtsd     xmm0,xmm0,mmword ptr [7FF94F9B4A60h]  
00007FF94F9B4A59  ret  

But if I run this method with CoreCLR (SET COMPLUS_JitDisasm=Run), I have the following log:

; Assembly listing for method Program:Run():double:this
; Emitting BLENDED_CODE for X64 CPU with SSE2
; optimized code
; rsp based frame
; partially interruptible
; Final local variable assignments
;
;* V00 this         [V00    ] (  0,   0  )     ref  ->  zero ref    this
;# V01 OutArgs      [V01    ] (  1,   1  )  lclBlk ( 0) [rsp+0x00]
;
; Lcl frame size = 0

G_M43239_IG01:

G_M43239_IG02:
       F20F510508000000     sqrtsd   xmm0, qword ptr [@RWD00]

G_M43239_IG03:
       C3                   ret

; Total bytes of code 9, prolog size 0 for method Program:Run():double:this
; ============================================================

But I want see a log with AVX support and the vsqrtsd instruction. How I can do it?

@BruceForstall

This comment has been minimized.

Show comment
Hide comment
@BruceForstall

BruceForstall May 12, 2015

Contributor

@CarolEidt Is this something you fixed recently?

Contributor

BruceForstall commented May 12, 2015

@CarolEidt Is this something you fixed recently?

@CarolEidt

This comment has been minimized.

Show comment
Hide comment
@CarolEidt

CarolEidt May 12, 2015

Member

In an odd coincidence, I have just today discovered that neither FEATURE_SIMD or FEATURE_AVX_SUPPORT are enabled for CoreCLR. I'm actually working on enabling it now. If you want to turn it on, you can add the following line to the CMakeLists.txt in the jit directory:
add_definitions(-FEATURE_AVX_SUPPORT)
but be forewarned that I've just starting looking at this, so I'm not sure what issues I may encounter (and I still need to track down how to enable that only for amd64).

Member

CarolEidt commented May 12, 2015

In an odd coincidence, I have just today discovered that neither FEATURE_SIMD or FEATURE_AVX_SUPPORT are enabled for CoreCLR. I'm actually working on enabling it now. If you want to turn it on, you can add the following line to the CMakeLists.txt in the jit directory:
add_definitions(-FEATURE_AVX_SUPPORT)
but be forewarned that I've just starting looking at this, so I'm not sure what issues I may encounter (and I still need to track down how to enable that only for amd64).

@AndreyAkinshin AndreyAkinshin changed the title from How to run CoreCLR with the AVX support to How to run CoreCLR with the AVX support? May 12, 2015

@CarolEidt

This comment has been minimized.

Show comment
Hide comment
@CarolEidt

CarolEidt May 12, 2015

Member

Fixed with PR #981

Member

CarolEidt commented May 12, 2015

Fixed with PR #981

@CarolEidt CarolEidt closed this May 12, 2015

@AndreyAkinshin

This comment has been minimized.

Show comment
Hide comment
@AndreyAkinshin

AndreyAkinshin May 12, 2015

Member

Now it works, thanks!

Member

AndreyAkinshin commented May 12, 2015

Now it works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment