Skip to content
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9531,7 +9531,7 @@ void CodeGen::genAmd64EmitterUnitTestsAvx10v2()

theEmitter->emitIns_R_R(INS_vcvttps2ibs, EA_16BYTE, REG_XMM0, REG_XMM1);
theEmitter->emitIns_R_R(INS_vcvttps2ibs, EA_32BYTE, REG_XMM0, REG_XMM1);
theEmitter->emitIns_R_R(INS_vcvttps2ibs, EA_32BYTE, REG_XMM0, REG_XMM1, INS_OPTS_EVEX_eb_er_rd);
theEmitter->emitIns_R_R(INS_vcvttps2ibs, EA_32BYTE, REG_XMM0, REG_XMM1, INS_OPTS_EVEX_er_rd);
theEmitter->emitIns_R_R(INS_vcvttps2ibs, EA_64BYTE, REG_XMM0, REG_XMM1);

theEmitter->emitIns_R_R(INS_vcvttps2iubs, EA_16BYTE, REG_XMM0, REG_XMM1);
Expand Down
25 changes: 17 additions & 8 deletions src/coreclr/jit/emit.h
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,7 @@ class emitter
unsigned _idCustom5 : 1;
unsigned _idCustom6 : 1;

#define _idEvexbContext \
(_idCustom6 << 1) | _idCustom5 /* Evex.b: embedded broadcast, embedded rounding, embedded SAE \
*/
#define _idEvexbContext (_idCustom6 << 1) | _idCustom5 /* Evex.b: embedded broadcast, rounding, SAE */
#define _idEvexNdContext _idCustom5 /* bits used for the APX-EVEX.nd context for promoted legacy instructions */
#define _idEvexNfContext _idCustom6 /* bits used for the APX-EVEX.nf context for promoted legacy/vex instructions */

Expand Down Expand Up @@ -1734,10 +1732,21 @@ class emitter
return idGetEvexbContext() != 0;
}

void idSetEvexBroadcastBit()
{
assert(!idIsEvexbContextSet());
_idCustom5 = 1;
}

void idSetEvexCompressedDisplacementBit()
{
assert(_idCustom6 == 0);
_idCustom6 = 1;
}

void idSetEvexbContext(insOpts instOptions)
{
assert(!idIsEvexbContextSet());
assert(idGetEvexbContext() == 0);
unsigned value = static_cast<unsigned>(instOptions & INS_OPTS_EVEX_b_MASK);

_idCustom5 = ((value >> 0) & 1);
Expand Down Expand Up @@ -2388,7 +2397,7 @@ class emitter
ssize_t emitGetInsCIdisp(instrDesc* id) const;
unsigned emitGetInsCIargs(instrDesc* id) const;

inline emitAttr emitGetMemOpSize(instrDesc* id, bool ignoreEmbeddedBroadcast = false) const;
inline emitAttr emitGetMemOpSize(instrDesc* id, bool ignoreEmbeddedBroadcast) const;

// Return the argument count for a direct call "id".
int emitGetInsCDinfo(instrDesc* id);
Expand Down Expand Up @@ -4164,7 +4173,7 @@ emitAttr emitter::emitGetMemOpSize(instrDesc* id, bool ignoreEmbeddedBroadcast)
else if (tupleType == INS_TT_FULL)
{
// Embedded broadcast supported, so either loading scalar or full vector
if (id->idIsEvexbContextSet() && !ignoreEmbeddedBroadcast)
if (!ignoreEmbeddedBroadcast && HasEmbeddedBroadcast(id))
{
memSize = GetInputSizeInBytes(id);
}
Expand All @@ -4183,7 +4192,7 @@ emitAttr emitter::emitGetMemOpSize(instrDesc* id, bool ignoreEmbeddedBroadcast)
{
memSize = 16;
}
else if (id->idIsEvexbContextSet() && !ignoreEmbeddedBroadcast)
else if (!ignoreEmbeddedBroadcast && HasEmbeddedBroadcast(id))
{
memSize = GetInputSizeInBytes(id);
}
Expand All @@ -4195,7 +4204,7 @@ emitAttr emitter::emitGetMemOpSize(instrDesc* id, bool ignoreEmbeddedBroadcast)
else if (tupleType == INS_TT_HALF)
{
// Embedded broadcast supported, so either loading scalar or half vector
if (id->idIsEvexbContextSet() && !ignoreEmbeddedBroadcast)
if (!ignoreEmbeddedBroadcast && HasEmbeddedBroadcast(id))
{
memSize = GetInputSizeInBytes(id);
}
Expand Down
Loading
Loading