Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Removing unnecessary files.
  • Loading branch information
DeepakRajendrakumaran committed Apr 5, 2023
commit dece3ccf44986d243aa9adf32b6850b6fc5067c9
100 changes: 0 additions & 100 deletions 0001-Changes-for-AVX_512_add.patch

This file was deleted.

15 changes: 14 additions & 1 deletion src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool emitter::IsSSEOrAVXInstruction(instruction ins)
// ins - The instruction to check.
//
// Returns:
// `true` if this instruction require K register.
// `true` if this instruction requires K register.
//
bool emitter::IsKInstruction(instruction ins)
{
Expand Down Expand Up @@ -253,6 +253,19 @@ bool emitter::IsDstSrcSrcAVXInstruction(instruction ins) const
return (flags & INS_Flags_IsDstSrcSrcAVXInstruction) != 0;
}

// Returns true if the AVX instruction requires 3 operands and writes result
// to mask register.
bool emitter::IsThreeOperandInstructionMask(instruction ins) const
{
if (!UseSimdEncoding())
{
return false;
}
Comment on lines +258 to +261
Copy link
Member

Choose a reason for hiding this comment

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

Don't expect you to do this here, since this is consistent with the other methods.

But I think we can in general simplify this and several of the other SIMD only flags to something like:

insFlags flags = CodeGenInterface::instInfo[ins];

if ((flags & INS_Flags_Is3OperandInstructionMask) != 0)
{
    assert(UseSimdEncoding());
    return true;
}

return false;

The UseSimdEncoding() is itself a flag check now and we should never be setting these SIMD only flags on non-SIMD instructions.

Copy link
Member

Choose a reason for hiding this comment

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

I'll log an issue for us to look at that as a cleanup item in some follow up PR.


insFlags flags = CodeGenInterface::instInfo[ins];
return (flags & INS_Flags_Is3OperandInstructionMask) != 0;
}

//------------------------------------------------------------------------
// HasRegularWideForm: Many x86/x64 instructions follow a regular encoding scheme where the
// byte-sized version of an instruction has the lowest bit of the opcode cleared
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/emitxarch.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ void SetContains256bitOrMoreAVX(bool value)

bool IsDstDstSrcAVXInstruction(instruction ins) const;
bool IsDstSrcSrcAVXInstruction(instruction ins) const;
bool IsThreeOperandInstructionMask(instruction ins) const;
static bool HasRegularWideForm(instruction ins);
static bool HasRegularWideImmediateForm(instruction ins);
static bool DoesWriteZeroFlag(instruction ins);
Expand Down
29 changes: 15 additions & 14 deletions src/coreclr/jit/instr.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,37 +141,38 @@ enum insFlags : uint64_t
// Avx
INS_Flags_IsDstDstSrcAVXInstruction = 1ULL << 25,
INS_Flags_IsDstSrcSrcAVXInstruction = 1ULL << 26,
INS_Flags_Is3OperandInstructionMask = 1ULL << 27,

// w and s bits
INS_FLAGS_Has_Wbit = 1ULL << 27,
INS_FLAGS_Has_Sbit = 1ULL << 28,
INS_FLAGS_Has_Wbit = 1ULL << 28,
INS_FLAGS_Has_Sbit = 1ULL << 29,

// instruction input size
// if not input size is set, instruction defaults to using
// the emitAttr for size
Input_8Bit = 1ULL << 29,
Input_16Bit = 1ULL << 30,
Input_32Bit = 1ULL << 31,
Input_64Bit = 1ULL << 32,
Input_Mask = (0xFULL) << 29,
Input_8Bit = 1ULL << 30,
Input_16Bit = 1ULL << 31,
Input_32Bit = 1ULL << 32,
Input_64Bit = 1ULL << 33,
Input_Mask = (0xFULL) << 30,

// encoding of the REX.W-bit
REX_W0 = 1ULL << 33,
REX_W1 = 1ULL << 34,
REX_WX = 1ULL << 35,
REX_W0 = 1ULL << 34,
REX_W1 = 1ULL << 35,
REX_WX = 1ULL << 36,

// encoding of the REX.W-bit is considered for EVEX only and W0 or WIG otherwise
REX_W0_EVEX = REX_W0,
REX_W1_EVEX = 1ULL << 36,
REX_W1_EVEX = 1ULL << 37,

// encoding of the REX.W-bit is ignored
REX_WIG = REX_W0,

// whether VEX or EVEX encodings are directly supported
Encoding_VEX = 1ULL << 37,
Encoding_EVEX = 1ULL << 38,
Encoding_VEX = 1ULL << 38,
Encoding_EVEX = 1ULL << 39,

KInstruction = 1ULL << 39,
KInstruction = 1ULL << 40,

// Listed above so it is "inline" with the other Resets_* flags
// Resets_ZF = 1ULL << 39,
Expand Down
Loading