Skip to content

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

Description

@kunalspathak

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  

Activity

  1. changed the title [-]ARM64: Convert Vector64<T> is converted to HVA[/-] [+]ARM64: Vector64<T> is converted to HVA TYP_DOUBLE[/+] on May 7, 2020
  2. added this to the 5.0 milestone on May 11, 2020
  3. removed
    untriagedNew issue has not been triaged by the area owner
    on May 11, 2020
  4. CarolEidt commented on Jun 5, 2020

    @CarolEidt
    Contributor

    This is a dup of #35144

  5. CarolEidt commented on Jun 5, 2020

    @CarolEidt
    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
    
  6. CarolEidt commented on Jun 12, 2020

    @CarolEidt
    Contributor

    Fixed with #37499

  7. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions