Skip to content
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

[LA64_DYNAREC] Added more opcodes #2213

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
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
36 changes: 33 additions & 3 deletions src/dynarec/la64/dynarec_la64_f0.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
nextop = F8;
SMDMB();
switch ((nextop >> 3) & 7) {
case 0: // ADD
case 0:
if (opcode == 0x81) {
INST_NAME("LOCK ADD Ed, Id");
} else {
Expand Down Expand Up @@ -488,7 +488,7 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
SMDMB();
}
break;
case 1: // OR
case 1:
if (opcode == 0x81) {
INST_NAME("LOCK OR Ed, Id");
} else {
Expand Down Expand Up @@ -526,7 +526,37 @@ uintptr_t dynarec64_F0(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
emit_or32c(dyn, ninst, rex, x1, i64, x3, x4);
}
break;
case 5: // SUB
case 4:
if (opcode == 0x81) {
INST_NAME("LOCK AND Ed, Id");
} else {
INST_NAME("LOCK AND Ed, Ib");
}
SETFLAGS(X_ALL, SF_SET_PENDING, NAT_FLAGS_FUSION);
if (MODREG) {
if (opcode == 0x81)
i64 = F32S;
else
i64 = F8S;
ed = TO_NAT((nextop & 7) + (rex.b << 3));
emit_and32c(dyn, ninst, rex, ed, i64, x3, x4);
} else {
addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, LOCK_LOCK, 0, (opcode == 0x81) ? 4 : 1);
if (opcode == 0x81)
i64 = F32S;
else
i64 = F8S;
MOV64xw(x7, i64);
if (rex.w) {
AMAND_DB_D(x1, x7, wback);
} else {
AMAND_DB_W(x1, x7, wback);
}
IFXORNAT (X_ALL | X_PEND)
emit_and32c(dyn, ninst, rex, x1, i64, x3, x4);
}
break;
case 5:
if (opcode == 0x81) {
INST_NAME("LOCK SUB Ed, Id");
} else {
Expand Down
10 changes: 10 additions & 0 deletions src/dynarec/la64/dynarec_la64_f20f.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,16 @@ uintptr_t dynarec64_F20F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int
MOVGR2FR_D(q1, x2);
VEXTRINS_D(v0, q1, 0);
break;
case 0xE6: // TODO: !fastround
INST_NAME("CVTPD2DQ Gx, Ex");
nextop = F8;
GETEX(v1, 0, 0);
GETGX_empty(v0);
u8 = sse_setround(dyn, ninst, x1, x2);
VFTINT_W_D(v0, v1, v1);
x87_restoreround(dyn, ninst, u8);
VINSGR2VR_D(v0, xZR, 1);
break;
default:
DEFAULT;
}
Expand Down
Loading