Skip to content

Commit 4cea127

Browse files
authored
Merge pull request #295 from icedland/erets-update
Update `ERETS` instruction with info from latest Intel docs `346446-003.pdf`
2 parents 9485069 + e4bc017 commit 4cea127

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

src/UnitTests/Intel/InstructionInfo/InstructionInfoTest_64.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19236,7 +19236,7 @@ F2 48 0F00 30, Lkgs_r64m16, Legacy, LKGS, priv op0=r r=rax w=gs rm=ds:rax;UInt16
1923619236
# eretu
1923719237
F3 0F 01 CA, Eretu, Legacy, FRED, priv flow=Return fw=acopszidA w=cs;ss;rsp rw=xsp rm=ss:xsp;UInt64 rm=ss:xsp+8;UInt64 rm=ss:xsp+0x10;UInt64 rm=ss:xsp+0x18;UInt64 rm=ss:xsp+0x20;UInt64 stack=40
1923819238
# erets
19239-
F2 0F 01 CA, Erets, Legacy, FRED, priv flow=Return fw=acopszidA w=rsp rw=xsp rm=ss:xsp;UInt64 rm=ss:xsp+8;UInt64 rm=ss:xsp+0x10;UInt64 rm=ss:xsp+0x18;UInt64 rm=ss:xsp+0x20;UInt64 stack=40
19239+
F2 0F 01 CA, Erets, Legacy, FRED, priv flow=Return fw=acopszidA w=rsp rw=xsp r=cs;ss rm=ss:xsp;UInt64 rm=ss:xsp+8;UInt64 rm=ss:xsp+0x10;UInt64 rm=ss:xsp+0x18;UInt64 rm=ss:xsp+0x20;UInt64 stack=40
1924019240
# vaddph xmm2,xmm6,[rax+10h]
1924119241
62 F54C08 58 50 01, EVEX_Vaddph_xmm_k1z_xmm_xmmm128b16, EVEX, AVX512VL;AVX512_FP16, op0=w op1=r op2=r w=vmm2 r=xmm6 r=rax rm=ds:rax+0x10;Packed128_Float16
1924219242
# vaddph xmm2{k3},xmm6,xmm3

src/csharp/Intel/Generator/Tables/InstructionDefs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30110,7 +30110,7 @@ END
3011030110

3011130111
# Code: Erets
3011230112
INSTRUCTION: F2 0F 01 CA | ERETS | FRED
30113-
implied: pop=5x8 w=rsp
30113+
implied: pop=5x8 w=rsp r=cs;ss
3011430114
rflags: w=oszacpdiA
3011530115
flags: 64 cpl0 sp=pop;40 cflow=ret
3011630116
END

src/csharp/Intel/Iced/Intel/InstructionInfoFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,8 +1658,10 @@ void AddImpliedAccesses(ImpliedAccess impliedAccess, in Instruction instruction,
16581658
}
16591659
CommandPop(instruction, flags, 5, 8);
16601660
break;
1661-
case ImpliedAccess.t_Wrsp_pop5x8:
1661+
case ImpliedAccess.t_Rcs_Rss_Wrsp_pop5x8:
16621662
if ((flags & Flags.NoRegisterUsage) == 0) {
1663+
AddRegister(flags, Register.CS, OpAccess.Read);
1664+
AddRegister(flags, Register.SS, OpAccess.Read);
16631665
AddRegister(flags, Register.RSP, OpAccess.Write);
16641666
}
16651667
CommandPop(instruction, flags, 5, 8);

src/csharp/Intel/Iced/Intel/InstructionInfoInternal/InfoHandlerFlags.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ enum ImpliedAccess {
329329
t_CRmem_CRmem_CRmem_CWmem_CRrax_CRrdx_CRrbx_CRrsi_CRrdi_CRes_CWrsi_CWrdi_RCWrcx,
330330
t_gpr16_Wgs,
331331
t_Wrsp_Wcs_Wss_pop5x8,
332-
t_Wrsp_pop5x8,
332+
t_Rcs_Rss_Wrsp_pop5x8,
333333
t_Reax_Recx_Wedx_Webx,
334334
t_Reax_Recx_Redx_CRebx_CWedx_CWebx,
335335
t_memdisplm64,

src/rust/iced-x86/src/info/enums.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ pub(crate) enum ImpliedAccess {
482482
t_CRmem_CRmem_CRmem_CWmem_CRrax_CRrdx_CRrbx_CRrsi_CRrdi_CRes_CWrsi_CWrdi_RCWrcx,
483483
t_gpr16_Wgs,
484484
t_Wrsp_Wcs_Wss_pop5x8,
485-
t_Wrsp_pop5x8,
485+
t_Rcs_Rss_Wrsp_pop5x8,
486486
t_Reax_Recx_Wedx_Webx,
487487
t_Reax_Recx_Redx_CRebx_CWedx_CWebx,
488488
t_memdisplm64,
@@ -683,7 +683,7 @@ static GEN_DEBUG_IMPLIED_ACCESS: [&str; 197] = [
683683
"t_CRmem_CRmem_CRmem_CWmem_CRrax_CRrdx_CRrbx_CRrsi_CRrdi_CRes_CWrsi_CWrdi_RCWrcx",
684684
"t_gpr16_Wgs",
685685
"t_Wrsp_Wcs_Wss_pop5x8",
686-
"t_Wrsp_pop5x8",
686+
"t_Rcs_Rss_Wrsp_pop5x8",
687687
"t_Reax_Recx_Wedx_Webx",
688688
"t_Reax_Recx_Redx_CRebx_CWedx_CWebx",
689689
"t_memdisplm64",

src/rust/iced-x86/src/info/factory.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1844,8 +1844,10 @@ impl InstructionInfoFactory {
18441844
}
18451845
Self::command_pop(instruction, info, flags, 5, 8);
18461846
}
1847-
ImpliedAccess::t_Wrsp_pop5x8 => {
1847+
ImpliedAccess::t_Rcs_Rss_Wrsp_pop5x8 => {
18481848
if (flags & Flags::NO_REGISTER_USAGE) == 0 {
1849+
Self::add_register(flags, info, Register::CS, OpAccess::Read);
1850+
Self::add_register(flags, info, Register::SS, OpAccess::Read);
18491851
Self::add_register(flags, info, Register::RSP, OpAccess::Write);
18501852
}
18511853
Self::command_pop(instruction, info, flags, 5, 8);

0 commit comments

Comments
 (0)