@@ -2249,8 +2249,7 @@ class emitter
2249
2249
ssize_t emitGetInsCIdisp (instrDesc* id);
2250
2250
unsigned emitGetInsCIargs (instrDesc* id);
2251
2251
2252
- inline emitAttr emitGetMemOpSize (instrDesc* id) const ;
2253
- inline emitAttr emitGetBaseMemOpSize (instrDesc*) const ;
2252
+ inline emitAttr emitGetMemOpSize (instrDesc* id, bool ignoreEmbeddedBroadcast = false ) const ;
2254
2253
2255
2254
// Return the argument count for a direct call "id".
2256
2255
int emitGetInsCDinfo (instrDesc* id);
@@ -3962,51 +3961,11 @@ inline unsigned emitter::emitGetInsCIargs(instrDesc* id)
3962
3961
// -----------------------------------------------------------------------------
3963
3962
// emitGetMemOpSize: Get the memory operand size of instrDesc.
3964
3963
//
3965
- // Note: there are cases when embedded broadcast is enabled, so the memory operand
3966
- // size is different from the intrinsic simd size, we will check here if emitter is
3967
- // emiting a embedded broadcast enabled instruction.
3968
-
3969
- // Arguments:
3970
- // id - Instruction descriptor
3971
- //
3972
- emitAttr emitter::emitGetMemOpSize (instrDesc* id) const
3973
- {
3974
- if (id->idIsEvexbContextSet ())
3975
- {
3976
- // should have the assumption that Evex.b now stands for the embedded broadcast context.
3977
- // reference: Section 2.7.5 in Intel 64 and ia-32 architectures software developer's manual volume 2.
3978
- ssize_t inputSize = GetInputSizeInBytes (id);
3979
- switch (inputSize)
3980
- {
3981
- case 4 :
3982
- return EA_4BYTE;
3983
- case 8 :
3984
- return EA_8BYTE;
3985
-
3986
- default :
3987
- unreached ();
3988
- }
3989
- }
3990
- else
3991
- {
3992
- return emitGetBaseMemOpSize (id);
3993
- }
3994
- }
3995
-
3996
- // -----------------------------------------------------------------------------
3997
- // emitGetMemOpSize: Get the memory operand size of instrDesc.
3998
- //
3999
- // Note: vextractf128 has a 128-bit output (register or memory) but a 256-bit input (register).
4000
- // vinsertf128 is the inverse with a 256-bit output (register), a 256-bit input(register),
4001
- // and a 128-bit input (register or memory).
4002
- // Similarly, vextractf64x4 has a 256-bit output and 128-bit input and vinsertf64x4 the inverse
4003
- // This method is mainly used for such instructions to return the appropriate memory operand
4004
- // size, otherwise returns the regular operand size of the instruction.
4005
-
4006
3964
// Arguments:
4007
- // id - Instruction descriptor
3965
+ // id - Instruction descriptor
3966
+ // ignoreEmbeddedBroadcast - true to get the non-embedded operand size; otherwise false
4008
3967
//
4009
- emitAttr emitter::emitGetBaseMemOpSize (instrDesc* id) const
3968
+ emitAttr emitter::emitGetMemOpSize (instrDesc* id, bool ignoreEmbeddedBroadcast ) const
4010
3969
{
4011
3970
ssize_t memSize = 0 ;
4012
3971
@@ -4022,7 +3981,7 @@ emitAttr emitter::emitGetBaseMemOpSize(instrDesc* id) const
4022
3981
else if (tupleType == INS_TT_FULL)
4023
3982
{
4024
3983
// Embedded broadcast supported, so either loading scalar or full vector
4025
- if (id->idIsEvexbContextSet ())
3984
+ if (id->idIsEvexbContextSet () && !ignoreEmbeddedBroadcast )
4026
3985
{
4027
3986
memSize = GetInputSizeInBytes (id);
4028
3987
}
@@ -4044,7 +4003,7 @@ emitAttr emitter::emitGetBaseMemOpSize(instrDesc* id) const
4044
4003
{
4045
4004
memSize = 16 ;
4046
4005
}
4047
- else if (id->idIsEvexbContextSet ())
4006
+ else if (id->idIsEvexbContextSet () && !ignoreEmbeddedBroadcast )
4048
4007
{
4049
4008
memSize = GetInputSizeInBytes (id);
4050
4009
}
@@ -4056,7 +4015,7 @@ emitAttr emitter::emitGetBaseMemOpSize(instrDesc* id) const
4056
4015
else if (tupleType == INS_TT_HALF)
4057
4016
{
4058
4017
// Embedded broadcast supported, so either loading scalar or half vector
4059
- if (id->idIsEvexbContextSet ())
4018
+ if (id->idIsEvexbContextSet () && !ignoreEmbeddedBroadcast )
4060
4019
{
4061
4020
memSize = GetInputSizeInBytes (id);
4062
4021
}
0 commit comments