Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions src/coreclr/jit/codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,11 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

instruction ins_Copy(var_types dstType);
instruction ins_Copy(regNumber srcReg, var_types dstType);
#if defined(TARGET_XARCH)
instruction ins_FloatConv(var_types to, var_types from, emitAttr attr);
#elif defined(TARGET_ARM)
instruction ins_FloatConv(var_types to, var_types from);
#endif
instruction ins_MathOp(genTreeOps oper, var_types type);

void instGen_Return(unsigned stkArgSize);
Expand Down
16 changes: 5 additions & 11 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6911,7 +6911,7 @@ void CodeGen::genFloatToFloatCast(GenTree* treeNode)
}
else
{
instruction ins = ins_FloatConv(dstType, srcType);
instruction ins = ins_FloatConv(dstType, srcType, emitTypeSize(dstType));
GetEmitter()->emitInsBinary(ins, emitTypeSize(dstType), treeNode, op1);
}

Expand Down Expand Up @@ -7005,7 +7005,7 @@ void CodeGen::genIntToFloatCast(GenTree* treeNode)

// Note that here we need to specify srcType that will determine
// the size of source reg/mem operand and rex.w prefix.
instruction ins = ins_FloatConv(dstType, TYP_INT);
instruction ins = ins_FloatConv(dstType, TYP_INT, emitTypeSize(srcType));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other cases use emitTypeSize(dstType) but this uses srcType?

Copy link
Copy Markdown
Contributor Author

@DeepakRajendrakumaran DeepakRajendrakumaran Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah.. should be srcType . We are trying to differentiate between VCVTSI2SS xmm1, xmm2, m32 and VCVTSI2SS xmm1, xmm2, m64

GetEmitter()->emitInsBinary(ins, emitTypeSize(srcType), treeNode, op1);

// Handle the case of srcType = TYP_ULONG. SSE2 conversion instruction
Expand Down Expand Up @@ -7110,7 +7110,7 @@ void CodeGen::genFloatToIntCast(GenTree* treeNode)
// Note that we need to specify dstType here so that it will determine
// the size of destination integer register and also the rex.w prefix.
genConsumeOperands(treeNode->AsOp());
instruction ins = ins_FloatConv(TYP_INT, srcType);
instruction ins = ins_FloatConv(TYP_INT, srcType, emitTypeSize(srcType));
GetEmitter()->emitInsBinary(ins, emitTypeSize(dstType), treeNode, op1);
genProduceReg(treeNode);
}
Expand Down Expand Up @@ -10713,10 +10713,7 @@ void CodeGen::genPreserveCalleeSavedFltRegs(unsigned lclFrameSize)
if ((regBit & regMask) != 0)
{
// ABI requires us to preserve lower 128-bits of YMM register.
GetEmitter()->emitIns_AR_R(copyIns,
EA_8BYTE, // TODO-XArch-Cleanup: size specified here doesn't matter but should be
// EA_16BYTE
reg, REG_SPBASE, offset);
GetEmitter()->emitIns_AR_R(copyIns, EA_16BYTE, reg, REG_SPBASE, offset);
compiler->unwindSaveReg(reg, offset);
regMask &= ~regBit;
offset -= XMM_REGSIZE_BYTES;
Expand Down Expand Up @@ -10780,10 +10777,7 @@ void CodeGen::genRestoreCalleeSavedFltRegs(unsigned lclFrameSize)
if ((regBit & regMask) != 0)
{
// ABI requires us to restore lower 128-bits of YMM register.
GetEmitter()->emitIns_R_AR(copyIns,
EA_8BYTE, // TODO-XArch-Cleanup: size specified here doesn't matter but should be
// EA_16BYTE
reg, regBase, offset);
GetEmitter()->emitIns_R_AR(copyIns, EA_16BYTE, reg, regBase, offset);
regMask &= ~regBit;
offset -= XMM_REGSIZE_BYTES;
}
Expand Down
18 changes: 11 additions & 7 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -8993,7 +8993,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// canUseEvexEncoding - Answer the question: Is Evex encoding supported on this target.
//
// Returns:
// TRUE if Evex encoding is supported, FALSE if not.
// `true` if Evex encoding is supported, `false` if not.
//
bool canUseEvexEncoding() const
{
#ifdef TARGET_XARCH
Expand All @@ -9007,18 +9008,21 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// DoJitStressEvexEncoding- Answer the question: Do we force EVEX encoding.
//
// Returns:
// TRUE if user requests EVEX encoding and it's safe, FALSE if not.
// `true` if user requests EVEX encoding and it's safe, `false` if not.
//
bool DoJitStressEvexEncoding() const
{
#ifdef TARGET_XARCH
// Using JitStressEVEXEncoding flag will force instructions which would
// otherwise use VEX encoding but can be EVEX encoded to use EVEX encoding
// This requires AVX512VL support.
if (JitConfig.JitStressEVEXEncoding() && compOpportunisticallyDependsOn(InstructionSet_AVX512F_VL))
// Using JitStressEvexEncoding flag will force instructions which would
// otherwise use VEX encoding but can be EVEX encoded to use EVEX encoding
// This requires AVX512VL support.
#ifdef DEBUG
if (JitConfig.JitStressEvexEncoding() && compOpportunisticallyDependsOn(InstructionSet_AVX512F_VL))
{
return true;
}
#endif
#endif // DEBUG
#endif // TARGET_XARCH
return false;
}

Expand Down
Loading