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

HOTFIX: cannot bind to packed field #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
38 changes: 19 additions & 19 deletions src/cpu/cpu_jitc_x86_64/ppc_fpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ void ppc_opc_faddx(PPC_CPU_State &aCPU)
aCPU.fpscr |= FPSCR_VXISI;
}
ppc_fpu_add(aCPU.fpscr, D, A, B);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)(aCPU.fpr[frD]));
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fadd.\n");
Expand Down Expand Up @@ -1067,7 +1067,7 @@ void ppc_opc_faddsx(PPC_CPU_State &aCPU)
aCPU.fpscr |= FPSCR_VXISI;
}
ppc_fpu_add(aCPU.fpscr, D, A, B);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fadds.\n");
Expand Down Expand Up @@ -1293,7 +1293,7 @@ void ppc_opc_fdivx(PPC_CPU_State &aCPU)
aCPU.fpscr |= FPSCR_VXIDI;
}
ppc_fpu_div(D, A, B);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fdiv.\n");
Expand Down Expand Up @@ -1339,7 +1339,7 @@ void ppc_opc_fdivsx(PPC_CPU_State &aCPU)
aCPU.fpscr |= FPSCR_VXIDI;
}
ppc_fpu_div(D, A, B);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fdivs.\n");
Expand All @@ -1363,7 +1363,7 @@ void ppc_opc_fmaddx(PPC_CPU_State &aCPU)
ppc_fpu_unpack_double(B, aCPU.fpr[frB]);
ppc_fpu_unpack_double(C, aCPU.fpr[frC]);
ppc_fpu_mul_add(aCPU.fpscr, D, A, C, B);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fmadd.\n");
Expand Down Expand Up @@ -1397,7 +1397,7 @@ void ppc_opc_fmaddsx(PPC_CPU_State &aCPU)
ppc_fpu_unpack_double(B, aCPU.fpr[frB]);
ppc_fpu_unpack_double(C, aCPU.fpr[frC]);
ppc_fpu_mul_add(aCPU.fpscr, D, A, C, B);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fmadds.\n");
Expand Down Expand Up @@ -1475,7 +1475,7 @@ void ppc_opc_fmsubx(PPC_CPU_State &aCPU)
ppc_fpu_unpack_double(C, aCPU.fpr[frC]);
B.s ^= 1;
ppc_fpu_mul_add(aCPU.fpscr, D, A, C, B);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fmsub.\n");
Expand Down Expand Up @@ -1510,7 +1510,7 @@ void ppc_opc_fmsubsx(PPC_CPU_State &aCPU)
ppc_fpu_unpack_double(C, aCPU.fpr[frC]);
B.s ^= 1;
ppc_fpu_mul_add(aCPU.fpscr, D, A, C, B);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fmsubs.\n");
Expand Down Expand Up @@ -1538,7 +1538,7 @@ void ppc_opc_fmulx(PPC_CPU_State &aCPU)
aCPU.fpscr |= FPSCR_VXIMZ;
}
ppc_fpu_mul(D, A, C);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fmul.\n");
Expand Down Expand Up @@ -1578,7 +1578,7 @@ void ppc_opc_fmulsx(PPC_CPU_State &aCPU)
aCPU.fpscr |= FPSCR_VXIMZ;
}
ppc_fpu_mul(D, A, C);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fmuls.\n");
Expand Down Expand Up @@ -1700,7 +1700,7 @@ void ppc_opc_fnmaddx(PPC_CPU_State &aCPU)
ppc_fpu_unpack_double(C, aCPU.fpr[frC]);
ppc_fpu_mul_add(aCPU.fpscr, D, A, C, B);
D.s ^= 1;
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fnmadd.\n");
Expand Down Expand Up @@ -1735,7 +1735,7 @@ void ppc_opc_fnmaddsx(PPC_CPU_State &aCPU)
ppc_fpu_unpack_double(C, aCPU.fpr[frC]);
ppc_fpu_mul_add(aCPU.fpscr, D, A, C, B);
D.s ^= 1;
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fnmadds.\n");
Expand All @@ -1761,7 +1761,7 @@ void ppc_opc_fnmsubx(PPC_CPU_State &aCPU)
B.s ^= 1;
ppc_fpu_mul_add(aCPU.fpscr, D, A, C, B);
D.s ^= 1;
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fnmsub.\n");
Expand Down Expand Up @@ -1797,7 +1797,7 @@ void ppc_opc_fnmsubsx(PPC_CPU_State &aCPU)
B.s ^= 1;
ppc_fpu_mul_add(aCPU.fpscr, D, A, C, B);
D.s ^= 1;
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fnmsubs.\n");
Expand Down Expand Up @@ -1839,7 +1839,7 @@ void ppc_opc_frspx(PPC_CPU_State &aCPU)
PPC_OPC_ASSERT(frA==0);
ppc_double B;
ppc_fpu_unpack_double(B, aCPU.fpr[frB]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, B, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, B, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("frsp.\n");
Expand Down Expand Up @@ -1867,7 +1867,7 @@ void ppc_opc_frsqrtex(PPC_CPU_State &aCPU)
aCPU.fpscr |= ppc_fpu_sqrt(aCPU.fpscr, Q, B);
E.type = ppc_fpr_norm; E.s = 0; E.e = 0; E.m = 0x80000000000000ULL;
ppc_fpu_div(D, E, Q);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("frsqrte.\n");
Expand Down Expand Up @@ -1934,7 +1934,7 @@ void ppc_opc_fsqrtx(PPC_CPU_State &aCPU)
ppc_double D;
ppc_fpu_unpack_double(B, aCPU.fpr[frB]);
ppc_fpu_sqrt(aCPU.fpscr, D, B);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fsqrt.\n");
Expand Down Expand Up @@ -1995,7 +1995,7 @@ void ppc_opc_fsubx(PPC_CPU_State &aCPU)
aCPU.fpscr |= FPSCR_VXISI;
}
ppc_fpu_add(aCPU.fpscr, D, A, B);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fsub.\n");
Expand Down Expand Up @@ -2042,7 +2042,7 @@ void ppc_opc_fsubsx(PPC_CPU_State &aCPU)
aCPU.fpscr |= FPSCR_VXISI;
}
ppc_fpu_add(aCPU.fpscr, D, A, B);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, aCPU.fpr[frD]);
aCPU.fpscr |= ppc_fpu_pack_double_as_single(aCPU.fpscr, D, (uint64&)aCPU.fpr[frD]);
if (aCPU.current_opc & PPC_OPC_Rc) {
// update cr1 flags
PPC_FPU_ERR("fsubs.\n");
Expand Down
10 changes: 5 additions & 5 deletions src/cpu/cpu_jitc_x86_64/ppc_mmu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ void ppc_opc_lfs(PPC_CPU_State &aCPU)
ppc_double d;
ppc_fpu_unpack_single(s, r);
ppc_fpu_single_to_double(s, d);
ppc_fpu_pack_double(aCPU.fpscr, d, aCPU.fpr[frD]);
ppc_fpu_pack_double(aCPU.fpscr, d, (uint64&)aCPU.fpr[frD]);
}
}
JITCFlow ppc_opc_gen_lfs(JITC &jitc)
Expand Down Expand Up @@ -1606,7 +1606,7 @@ void ppc_opc_lfsu(PPC_CPU_State &aCPU)
ppc_double d;
ppc_fpu_unpack_single(s, r);
ppc_fpu_single_to_double(s, d);
ppc_fpu_pack_double(aCPU.fpscr, d, aCPU.fpr[frD]);
ppc_fpu_pack_double(aCPU.fpscr, d, (uint64&)aCPU.fpr[frD]);
aCPU.gpr[rA] += imm;
}
}
Expand Down Expand Up @@ -1650,7 +1650,7 @@ void ppc_opc_lfsux(PPC_CPU_State &aCPU)
ppc_double d;
ppc_fpu_unpack_single(s, r);
ppc_fpu_single_to_double(s, d);
ppc_fpu_pack_double(aCPU.fpscr, d, aCPU.fpr[frD]);
ppc_fpu_pack_double(aCPU.fpscr, d, (uint64&)aCPU.fpr[frD]);
}
}
JITCFlow ppc_opc_gen_lfsux(JITC &jitc)
Expand Down Expand Up @@ -1689,7 +1689,7 @@ void ppc_opc_lfsx(PPC_CPU_State &aCPU)
ppc_double d;
ppc_fpu_unpack_single(s, r);
ppc_fpu_single_to_double(s, d);
ppc_fpu_pack_double(aCPU.fpscr, d, aCPU.fpr[frD]);
ppc_fpu_pack_double(aCPU.fpscr, d, (uint64&)aCPU.fpr[frD]);
}
}
JITCFlow ppc_opc_gen_lfsx(JITC &jitc)
Expand Down Expand Up @@ -1968,7 +1968,7 @@ void ppc_opc_lmw(PPC_CPU_State &aCPU)
PPC_OPC_TEMPL_D_SImm(aCPU.current_opc, rD, rA, imm);
uint32 ea = (rA ? aCPU.gpr[rA] : 0) + imm;
while (rD <= 31) {
if (ppc_read_effective_word(aCPU, ea, aCPU.gpr[rD])) {
if (ppc_read_effective_word(aCPU, ea, (uint32&)aCPU.gpr[rD])) {
return;
}
rD++;
Expand Down