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

ARM64: Vector64<T> is converted to HVA TYP_DOUBLE #35976

Closed
kunalspathak opened this issue May 7, 2020 · 3 comments
Closed

ARM64: Vector64<T> is converted to HVA TYP_DOUBLE #35976

kunalspathak opened this issue May 7, 2020 · 3 comments
Assignees
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@kunalspathak
Copy link
Member

As we found out in #35636 (comment) , we are converting the return type of Vectot64<T> to HVA TYP_DOUBLE. This impacts Vector64.CreateScalar(uint) or byte, short, etc when the result is used.

[MethodImpl(MethodImplOptions.NoInlining)]
public static uint fo1(uint value) {	
	var input = Vector64.CreateScalar(value);
	return AdvSimd.Extract(input, 0);
}

Generated code:

G_M6484_IG02:
        0F000410          movi    v16.2s, #0x00
        4E041C10          ins     v16.s[0], w0
        FD000FB0          str     d16, [fp,#24]
        FD400FB0          ldr     d16, [fp,#24]
        0E043E00          umov    w0, v16.s[0]

Below is the dump of where conversation happens:

impFixupStructReturnType: retyping
               [000039] ------------              *  HWINTRINSIC simd8  uint Insert
               [000038] ------------              \--*  LIST      void  
               [000034] ------------                 +--*  HWINTRINSIC simd8  uint get_Zero
               [000037] ------------                 \--*  LIST      void  
               [000035] ------------                    +--*  CNS_INT   int    0
               [000036] ------------                    \--*  LIST      void  
               [000009] ------------                       \--*  LCL_VAR   int    V00 arg0         

impFixupStructReturnType: result of retyping is
               [000039] ------------              *  HWINTRINSIC double uint Insert
               [000038] ------------              \--*  LIST      void  
               [000034] ------------                 +--*  HWINTRINSIC simd8  uint get_Zero
               [000037] ------------                 \--*  LIST      void  
               [000035] ------------                    +--*  CNS_INT   int    0
               [000036] ------------                    \--*  LIST      void  
               [000009] ------------                       \--*  LCL_VAR   int    V00 arg0         


               [000041] -A----------              *  ASG       double
               [000040] D------N----              +--*  LCL_VAR   double V05 tmp2         
               [000039] ------------              \--*  HWINTRINSIC double uint Insert
               [000038] ------------                 \--*  LIST      void  
               [000034] ------------                    +--*  HWINTRINSIC simd8  uint get_Zero
               [000037] ------------                    \--*  LIST      void  
               [000035] ------------                       +--*  CNS_INT   int    0
               [000036] ------------                       \--*  LIST      void  
               [000009] ------------                          \--*  LCL_VAR   int    V00 arg0  
@kunalspathak kunalspathak added arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels May 7, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label May 7, 2020
@kunalspathak kunalspathak changed the title ARM64: Convert Vector64<T> is converted to HVA ARM64: Vector64<T> is converted to HVA TYP_DOUBLE May 7, 2020
@BruceForstall BruceForstall added this to the 5.0 milestone May 11, 2020
@BruceForstall BruceForstall removed the untriaged New issue has not been triaged by the area owner label May 11, 2020
@CarolEidt
Copy link
Contributor

This is a dup of #35144

@CarolEidt
Copy link
Contributor

I've submitted PR #37499.
With those changes, here's the full code generation for the fo1 method above:

G_M6398_IG01:
        A9BF7BFD          stp     fp, lr, [sp,#-16]!
        910003FD          mov     fp, sp
                                                ;; bbWeight=1    PerfScore 1.50
G_M6398_IG02:
        0F000410          movi    v16.2s, #0x00
        4E041C10          ins     v16.s[0], w0
        0E043E00          umov    w0, v16.s[0]
                                                ;; bbWeight=1    PerfScore 2.50
G_M6398_IG03:
        A8C17BFD          ldp     fp, lr, [sp],#16
        D65F03C0          ret     lr

@CarolEidt
Copy link
Contributor

Fixed with #37499

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

4 participants