Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9331,6 +9331,13 @@ class Compiler
simdType = TYP_SIMD64;
}
#endif // TARGET_XARCH
#if defined(TARGET_ARM64)
else if (size == SIZE_UNKNOWN)
{
assert(JitConfig.JitUseScalableVectorT());
simdType = TYP_SIMD;
}
#endif
else
{
noway_assert(!"Unexpected size for SIMD type");
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ var_types Compiler::impNormStructType(CORINFO_CLASS_HANDLE structHnd, CorInfoTyp
CorInfoType simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType(structHnd, &sizeBytes);
if (simdBaseJitType != CORINFO_TYPE_UNDEF)
{
assert(sizeBytes == originalSize);
assert(sizeBytes == originalSize || sizeBytes == SIZE_UNKNOWN);
structType = getSIMDTypeForSize(sizeBytes);
if (pSimdBaseJitType != nullptr)
{
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/jit/jitconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,9 @@ CONFIG_STRING(JitRawHexCodeFile, "JitRawHexCodeFile")
// 3: force all frames to use the frame types that save FP/LR registers with the callee-saved registers (at the top
// of the frame) and also force using the large funclet frame variation (frame 5) if possible.
CONFIG_INTEGER(JitSaveFpLrWithCalleeSavedRegisters, "JitSaveFpLrWithCalleeSavedRegisters", 0)

// Experimental support for vector length agnostic implementation of Vector<T>
RELEASE_CONFIG_INTEGER(JitUseScalableVectorT, "JitUseScalableVectorT", 0)
#endif // defined(TARGET_ARM64)

#if defined(TARGET_LOONGARCH64)
Expand Down
10 changes: 9 additions & 1 deletion src/coreclr/jit/simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ CorInfoType Compiler::getBaseJitTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeH
}

JITDUMP(" Found Vector<%s>\n", varTypeName(JitType2PreciseVarType(simdBaseJitType)));

#ifdef TARGET_ARM64
if (compExactlyDependsOn(InstructionSet_Sve_Arm64) && JitConfig.JitUseScalableVectorT())
{
size = SIZE_UNKNOWN;
break;
}
#endif
size = getVectorTByteLength();

if (size == 0)
Expand Down Expand Up @@ -463,7 +471,7 @@ CorInfoType Compiler::getBaseJitTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeH

if (simdBaseJitType != CORINFO_TYPE_UNDEF)
{
assert(size == info.compCompHnd->getClassSize(typeHnd));
assert(size == info.compCompHnd->getClassSize(typeHnd) || size == SIZE_UNKNOWN);
setUsesSIMDTypes(true);
}

Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/jit/simd.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#ifndef _SIMD_H_
#define _SIMD_H_

#define SIZE_UNKNOWN UINT8_MAX

template <typename T>
static bool ElementsAreSame(T* array, size_t size)
{
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/jit/typelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#define GCS EA_GCREF
#define BRS EA_BYREF
#define EPS EA_PTRSIZE
#define EAU EA_UNKNOWN
#define SZU SIZE_UNKNOWN
#define PS TARGET_POINTER_SIZE
#define PST (TARGET_POINTER_SIZE / sizeof(int))

Expand Down Expand Up @@ -63,6 +65,8 @@ DEF_TP(SIMD16 ,"simd16" , TYP_SIMD16, 16,16, 16, 4,16, VTR_FLOAT, available
#if defined(TARGET_XARCH)
DEF_TP(SIMD32 ,"simd32" , TYP_SIMD32, 32,32, 32, 8,16, VTR_FLOAT, availableDoubleRegs, RBM_FLT_CALLEE_SAVED, RBM_FLT_CALLEE_TRASH, VTF_S|VTF_VEC)
DEF_TP(SIMD64 ,"simd64" , TYP_SIMD64, 64,64, 64, 16,16, VTR_FLOAT, availableDoubleRegs, RBM_FLT_CALLEE_SAVED, RBM_FLT_CALLEE_TRASH, VTF_S|VTF_VEC)
#elif defined(TARGET_ARM64)
DEF_TP(SIMD ,"simd" , TYP_SIMD, SZU,EAU,EAU, 0,16, VTR_FLOAT, availableDoubleRegs, RBM_FLT_CALLEE_SAVED, RBM_FLT_CALLEE_TRASH, VTF_VEC)
#endif // TARGET_XARCH
#if defined(FEATURE_MASKED_HW_INTRINSICS)
DEF_TP(MASK ,"mask" , TYP_MASK, 8, 8, 8, 2, 8, VTR_MASK, availableMaskRegs, RBM_MSK_CALLEE_SAVED, RBM_MSK_CALLEE_TRASH, VTF_S)
Expand Down
Loading