PreAllocator: Check if instruction supports a Vex prefix in IsVexSameOperandDestSrc1 (#3587)
This commit is contained in:
parent
e87e8b012c
commit
6dfb6ccf8c
2 changed files with 10 additions and 1 deletions
|
@ -4,6 +4,11 @@ namespace ARMeilleure.CodeGen.X86
|
||||||
{
|
{
|
||||||
partial class Assembler
|
partial class Assembler
|
||||||
{
|
{
|
||||||
|
public static bool SupportsVexPrefix(X86Instruction inst)
|
||||||
|
{
|
||||||
|
return _instTable[(int)inst].Flags.HasFlag(InstructionFlags.Vex);
|
||||||
|
}
|
||||||
|
|
||||||
private const int BadOp = 0;
|
private const int BadOp = 0;
|
||||||
|
|
||||||
[Flags]
|
[Flags]
|
||||||
|
|
|
@ -1297,11 +1297,15 @@ namespace ARMeilleure.CodeGen.X86
|
||||||
{
|
{
|
||||||
if (IsIntrinsic(operation.Instruction))
|
if (IsIntrinsic(operation.Instruction))
|
||||||
{
|
{
|
||||||
|
IntrinsicInfo info = IntrinsicTable.GetInfo(operation.Intrinsic);
|
||||||
|
|
||||||
|
bool hasVex = HardwareCapabilities.SupportsVexEncoding && Assembler.SupportsVexPrefix(info.Inst);
|
||||||
|
|
||||||
bool isUnary = operation.SourcesCount < 2;
|
bool isUnary = operation.SourcesCount < 2;
|
||||||
|
|
||||||
bool hasVecDest = operation.Destination != default && operation.Destination.Type == OperandType.V128;
|
bool hasVecDest = operation.Destination != default && operation.Destination.Type == OperandType.V128;
|
||||||
|
|
||||||
return !HardwareCapabilities.SupportsVexEncoding && !isUnary && hasVecDest;
|
return !hasVex && !isUnary && hasVecDest;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Reference in a new issue