8000 [LA64_DYNAREC] Added AES opcodes by xiangzhai · Pull Request #2122 · ptitSeb/box64 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[LA64_DYNAREC] Added AES opcodes #2122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Changes from all commits
Commits
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
76 changes: 76 additions & 0 deletions src/dynarec/la64/dynarec_la64_660f.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,82 @@ uintptr_t dynarec64_660F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int
GETEX(q1, 0, 0);
VSIGNCOV_W(q0, q1, q0);
break;
case 0xDB:
INST_NAME("AESIMC Gx, Ex"); // AES-NI
nextop = F8;
GETEX(q1, 0, 0);
GETGX_empty(q0);
if (q0 != q1) {
VOR_V(q0, q1, q1);
}
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
CALL(native_aesimc, -1);
break;
case 0xDC:
INST_NAME("AESENC Gx, Ex"); // AES-NI
nextop = F8;
GETG;
GETEX(q1, 0, 0);
if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) {
d0 = fpu_get_scratch(dyn);
VOR_V(d0, q1, q1);
} else
d0 = -1;
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
CALL(native_aese, -1);
GETGX(q0, 1);
VXOR_V(q0, q0, (d0 != -1) ? d0 : q1);
break;
case 0xDD:
INST_NAME("AESENCLAST Gx, Ex"); // AES-NI
nextop = F8;
GETG;
GETEX(q1, 0, 0);
if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) {
d0 = fpu_get_scratch(dyn);
VOR_V(d0, q1, q1);
} else
d0 = -1;
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
CALL(native_aeselast, -1);
GETGX(q0, 1);
VXOR_V(q0, q0, (d0 != -1) ? d0 : q1);
break;
case 0xDE:
INST_NAME("AESDEC Gx, Ex"); // AES-NI
nextop = F8;
GETG;
GETEX(q1, 0, 0);
if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) {
d0 = fpu_get_scratch(dyn);
VOR_V(d0, q1, q1);
} else
d0 = -1;
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
CALL(native_aesd, -1);
GETGX(q0, 1);
VXOR_V(q0, q0, (d0 != -1) ? d0 : q1);
break;
case 0xDF:
INST_NAME("AESDECLAST Gx, Ex"); // AES-NI
nextop = F8;
GETG;
GETEX(q1, 0, 0);
if (MODREG && (gd == (nextop & 7) + (rex.b << 3))) {
d0 = fpu_get_scratch(dyn);
VOR_V(d0, q1, q1);
} else
d0 = -1;
sse_forget_reg(dyn, ninst, gd);
MOV32w(x1, gd);
CALL(native_aesdlast, -1);
GETGX(q0, 1);
VXOR_V(q0, q0, (d0 != -1) ? d0 : q1);
break;
default:
DEFAULT;
}
Expand Down
Loading
0