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

How to run CoreCLR with the AVX support? #4241

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

How to run CoreCLR with the AVX support? #4241

AndreyAkinshin opened this issue May 11, 2015 · 4 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI tenet-performance Performance related issue

Comments

@AndreyAkinshin
Copy link
Member

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
Copy link
Member

@CarolEidt Is this something you fixed recently?

@CarolEidt
Copy link
Contributor

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 How to run CoreCLR with the AVX support How to run CoreCLR with the AVX support? May 12, 2015
@CarolEidt
Copy link
Contributor

Fixed with PR dotnet/coreclr#981

@AndreyAkinshin
Copy link
Member Author

Now it works, thanks!

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

3 participants