Skip to content

Commit

Permalink
[ARM64_DYNAREC] Improved a bit MULX opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Jan 1, 2025
1 parent 495c98a commit 0893038
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions src/dynarec/arm64/dynarec_arm64_67_avx.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,21 @@ uintptr_t dynarec64_67_AVX(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int
GETGD;
GETED32(0);
GETVD;
if(rex.w) {
// 64bits mul
UMULH(x3, xRDX, ed);
MULx(vd, xRDX, ed);
MOVx_REG(gd, x3);
if(rex.w) {
// 64bits mul
if((gd==xRDX) || (gd==ed) || (gd==vd))
gb1 = x3;
else
gb1 = gd;
UMULH(gb1, xRDX, ed);
if(gd!=vd) {MULx(vd, xRDX, ed);}
if(gb1==x3) {
MOVx_REG(gd, gb1);
}
} else {
// 32bits mul
UMULL(x3, xRDX, ed);
MOVw_REG(vd, x3);
if(gd!=vd) {MOVw_REG(vd, x3);}
LSRx(gd, x3, 32);
}
break;
Expand Down
4 changes: 2 additions & 2 deletions src/dynarec/arm64/dynarec_arm64_avx_f2_0f38.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ uintptr_t dynarec64_AVX_F2_0F38(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip
else
gb1 = gd;
UMULH(gb1, xRDX, ed);
MULx(vd, xRDX, ed);
if(gd!=vd) {MULx(vd, xRDX, ed);}
if(gb1==x3) {
MOVx_REG(gd, gb1);
}
} else {
// 32bits mul
UMULL(x3, xRDX, ed);
MOVw_REG(vd, x3);
if(gd!=vd) {MOVw_REG(vd, x3);}
LSRx(gd, x3, 32);
}
break;
Expand Down

0 comments on commit 0893038

Please sign in to comment.