未验证 提交 54fdd260 编写于 作者: K Kunal Pathak 提交者: GitHub

Update instruction table to capture the correct state of EFlags (#53806)

* Update instruction table with accurate EFlags information

* Revert "Add issues.targets entry for the GitHub_13822 test to make CI green (#53789)"

This reverts commit bd9ba598.

* minor fixup

* Fix some more instructions

* review comments
上级 d7375214
......@@ -161,7 +161,7 @@ bool emitter::IsDstSrcSrcAVXInstruction(instruction ins)
//
bool emitter::DoesWriteZeroFlag(instruction ins)
{
return (CodeGenInterface::instInfo[ins] & INS_FLAGS_WritesZF) != 0;
return (CodeGenInterface::instInfo[ins] & Writes_ZF) != 0;
}
//------------------------------------------------------------------------
......@@ -176,7 +176,7 @@ bool emitter::DoesWriteZeroFlag(instruction ins)
//
bool emitter::DoesResetOverflowAndCarryFlags(instruction ins)
{
return (CodeGenInterface::instInfo[ins] & INS_FLAGS_Resets_CF_OF_Flags) != 0;
return (CodeGenInterface::instInfo[ins] & (Resets_OF | Resets_CF)) == (Resets_OF | Resets_CF);
}
//------------------------------------------------------------------------
......
......@@ -86,52 +86,56 @@ enum GCtype : unsigned
};
#if defined(TARGET_XARCH)
enum insFlags : uint32_t
{
INS_FLAGS_None = 0,
// Reads EFLAGS
INS_FLAGS_ReadsCF = 1 << 0,
INS_FLAGS_ReadsPF = 1 << 1,
INS_FLAGS_ReadsAF = 1 << 2,
INS_FLAGS_ReadsZF = 1 << 3,
INS_FLAGS_ReadsSF = 1 << 4,
INS_FLAGS_ReadsDF = 1 << 5,
INS_FLAGS_ReadsOF = 1 << 6,
INS_FLAGS_ReadsAllFlagsExceptAF = INS_FLAGS_ReadsCF | INS_FLAGS_ReadsPF | INS_FLAGS_ReadsZF | INS_FLAGS_ReadsSF | INS_FLAGS_ReadsOF,
INS_FLAGS_Reads_CF_ZF_Flags = INS_FLAGS_ReadsCF | INS_FLAGS_ReadsZF,
INS_FLAGS_Reads_OF_SF_Flags = INS_FLAGS_ReadsOF | INS_FLAGS_ReadsSF,
INS_FLAGS_Reads_OF_SF_ZF_Flags = INS_FLAGS_ReadsOF | INS_FLAGS_ReadsSF | INS_FLAGS_ReadsZF,
INS_FLAGS_ReadsAllFlags = INS_FLAGS_ReadsAF | INS_FLAGS_ReadsAllFlagsExceptAF,
// Writes EFLAGS
INS_FLAGS_WritesCF = 1 << 7,
INS_FLAGS_WritesPF = 1 << 8,
INS_FLAGS_WritesAF = 1 << 9,
INS_FLAGS_WritesZF = 1 << 10,
INS_FLAGS_WritesSF = 1 << 11,
INS_FLAGS_WritesDF = 1 << 12,
INS_FLAGS_WritesOF = 1 << 13,
INS_FLAGS_WritesAllFlagsExceptCF = INS_FLAGS_WritesPF | INS_FLAGS_WritesAF | INS_FLAGS_WritesZF | INS_FLAGS_WritesSF | INS_FLAGS_WritesOF,
INS_FLAGS_WritesAllFlagsExceptOF = INS_FLAGS_WritesCF | INS_FLAGS_WritesPF | INS_FLAGS_WritesAF | INS_FLAGS_WritesZF | INS_FLAGS_WritesSF,
INS_FLAGS_WritesAllFlags = INS_FLAGS_WritesCF | INS_FLAGS_WritesAllFlagsExceptCF,
// Resets EFLAGS
INS_FLAGS_Resets_OF_Flags = 1 << 14,
INS_FLAGS_Resets_CF_OF_Flags = 1 << 15,
INS_FLAGS_Resets_OF_SF_PF_Flags = 1 << 16,
INS_FLAGS_ResetsAllFlagsExceptZF = 1 << 17,
// Reads
Reads_OF = 1 << 0,
Reads_SF = 1 << 1,
Reads_ZF = 1 << 2,
Reads_PF = 1 << 3,
Reads_CF = 1 << 4,
Reads_DF = 1 << 5,
// Writes
Writes_OF = 1 << 6,
Writes_SF = 1 << 7,
Writes_ZF = 1 << 8,
Writes_AF = 1 << 9,
Writes_PF = 1 << 10,
Writes_CF = 1 << 11,
// Resets
Resets_OF = 1 << 12,
Resets_SF = 1 << 13,
Resets_AF = 1 << 14,
Resets_PF = 1 << 15,
Resets_CF = 1 << 16,
// Undefined
Undefined_OF = 1 << 17,
Undefined_SF = 1 << 18,
Undefined_ZF = 1 << 19,
Undefined_AF = 1 << 20,
Undefined_PF = 1 << 21,
Undefined_CF = 1 << 22,
// Restore
Restore_SF_ZF_AF_PF_CF = 1 << 23,
// x87 instruction
INS_FLAGS_x87Instr = 1 << 18,
INS_FLAGS_x87Instr = 1 << 24,
// Avx
INS_Flags_IsDstDstSrcAVXInstruction = 1 << 19,
INS_Flags_IsDstSrcSrcAVXInstruction = 1 << 20,
INS_Flags_IsDstDstSrcAVXInstruction = 1 << 25,
INS_Flags_IsDstSrcSrcAVXInstruction = 1 << 26,
// TODO-Cleanup: Remove this flag and its usage from TARGET_XARCH
INS_FLAGS_DONT_CARE = 0x00,
};
#elif defined(TARGET_ARM) || defined(TARGET_ARM64)
// TODO-Cleanup: Move 'insFlags' under TARGET_ARM
enum insFlags: unsigned
......
此差异已折叠。
......@@ -117,9 +117,6 @@
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294/*">
<Issue>https://github.com/dotnet/runtime/issues/44341</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822/*">
<Issue>https://github.com/dotnet/runtime/issues/53781</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Interop/COM/NativeClients/Dispatch/*">
<Issue>https://github.com/dotnet/runtime/issues/44186</Issue>
</ExcludeList>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册