Skip to content

Commit

Permalink
Adding support for aes instruction set extension
Browse files Browse the repository at this point in the history
  • Loading branch information
John Detter committed Jul 6, 2016
1 parent 3a6ad66 commit 16fce86
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 6 deletions.
14 changes: 14 additions & 0 deletions common/h/entryIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ enum entryID {
e_cvttss2si,
e_cwd,
e_cwde,
e_aesenc,
e_aesenclast,
e_aesdec,
e_aesdeclast,
e_vaesenc,
e_vaesenclast,
e_vaesdec,
e_vaesdeclast,
e_aeskeygenassist,
e_vaeskeygenassist,
e_aesimc,
e_vaesimc,
e_pclmullqlqdq,
e_vpclmullqlqdq,
e_daa,
e_das,
e_dec,
Expand Down
81 changes: 75 additions & 6 deletions common/src/arch-x86.C
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ SSEB00 = 0, SSEB01, SSEB02, SSEB03, SSEB04, SSEB05, SSEB06, SSEB07,
SSEBB8, SSEBB9, SSEBBA, SSEBBB, SSEBBC, SSEBBD, SSEBBE, SSEBBF,
SSEBC4, SSEBC6, SSEBC7,
SSEBC8, SSEBCA, SSEBCB, SSEBCC, SSEBCD,
SSEBDB, SSEBDC, SSEBDD, SSEBDE, SSEBDF,
SSEBF0, SSEBF1, SSEBF2, SSEBF5, SSEBF6, SSEBF7
};
/** END_DYNINST_TABLE_DEF */
Expand Down Expand Up @@ -399,6 +400,11 @@ enum { /** AUTOGENERATED */
SSEBCB_66,
SSEBCC_66,
SSEBCD_66,
SSEBDB_66,
SSEBDC_66,
SSEBDD_66,
SSEBDE_66,
SSEBDF_66,
SSEBF2_NO,
SSEBF5_F2, SSEBF5_F3, SSEBF5_NO,
SSEBF6_F2, SSEBF6_F3,
Expand Down Expand Up @@ -745,6 +751,13 @@ COMMON_EXPORT dyn_hash_map<entryID, std::string> entryNames_IAPI = map_list_of
(e_addss, "addss")
(e_addsubpd, "addsubpd")
(e_addsubps, "addsubps")
(e_aesenc, "aesenc")
(e_aesenclast, "aesenclast")
(e_aesdec, "aesdec")
(e_aesdeclast, "aesdeclast")
(e_aeskeygenassist, "aeskeygenassist")
(e_aesimc, "aesimc")
(e_pclmullqlqdq, "pclmullqlqdq")
(e_and, "and")
(e_andnpd, "andnpd")
(e_andnps, "andnps")
Expand Down Expand Up @@ -1283,7 +1296,13 @@ COMMON_EXPORT dyn_hash_map<entryID, std::string> entryNames_IAPI = map_list_of
(e_xor, "xor")
(e_xorpd, "xorpd")
(e_xorps, "xorps")

(e_vaesenc, "vaesenc")
(e_vaesenclast, "vaesenclast")
(e_vaesdec, "vaesdec")
(e_vaesdeclast, "vaesdeclast")
(e_vaeskeygenassist, "vaeskeygenassist")
(e_vaesimc, "vaesimc")
(e_vpclmullqlqdq, "vpclmullqlqdq")
(e_vmpsadbw, "vmpsadbw")
(e_vmwrite, "vmwrite")
(e_vmread, "vmread")
Expand Down Expand Up @@ -2923,11 +2942,11 @@ static ia32_entry threeByteMap[256] = {
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_sse_bis, SSEBDB, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_sse_bis, SSEBDC, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_sse_bis, SSEBDD, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_sse_bis, SSEBDE, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_sse_bis, SSEBDF, false, { Zz, Zz, Zz }, 0, 0 },
/* E0 */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
Expand Down Expand Up @@ -5522,6 +5541,36 @@ static ia32_entry sseMapBis[][5] = {
{ e_No_Entry, t_sse_bis_mult, SSEBCD_66, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 }
}, { /* SSEBDB */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_aesimc, t_sse_bis_mult, SSEBDB_66, true, { Vps, Wps, Zz }, 0, s1W2R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBDC */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_aesenc, t_sse_bis_mult, SSEBDC_66, true, { Vps, Wps, Zz }, 0, s1RW2R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBDD */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_aesenclast, t_sse_bis_mult, SSEBDD_66, true, { Vps, Wps, Zz }, 0, s1RW2R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBDE */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_aesdec, t_sse_bis_mult, SSEBDE_66, true, { Vps, Wps, Zz }, 0, s1RW2R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBDF */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_aeskeygenassist, t_sse_bis_mult, SSEBDF_66, true, { Vps, Wps, Ib }, 0, s1W2R3R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBF0 */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
Expand Down Expand Up @@ -7240,6 +7289,26 @@ ia32_entry sseMapBisMult[][3] =
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_No_Entry, t_vexw, VEXW90, false, { Zz, Zz, Zz }, 0, 0 }
}, { /* SSEBDB_66 */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_vaesimc, t_done, 0, true, { Vps, Wps, Zz }, 0, s1W2R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBDC_66 */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_vaesenc, t_done, 0, true, { Vps, Hps, Wps }, 0, s1W2R3R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBDD_66 */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_vaesenclast, t_done, 0, true, { Vps, Hps, Wps }, 0, s1W2R3R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBDE_66 */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_vaesdec, t_done, 0, true, { Vps, Hps, Wps }, 0, s1W2R3R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBDF_66 */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_vaeskeygenassist, t_done, 0, true, { Vps, Wps, Ib }, 0, s1W2R3R },
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
}, { /* SSEBF2_NO */
{ e_No_Entry, t_ill, 0, false, { Zz, Zz, Zz }, 0, 0 },
{ e_andn, t_done, 0, true, { Vps, Hps, Wps }, 0, s1W2R3R },
Expand Down

0 comments on commit 16fce86

Please sign in to comment.