Skip to content

Conversation

vcoracolombo
Copy link

No description provided.

@vcoracolombo vcoracolombo self-assigned this Jan 19, 2022
@vcoracolombo vcoracolombo marked this pull request as ready for review March 4, 2022 16:32
Copy link

@mferst mferst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving old instructions first may give you more readable patches. Also, handling simpler instructions first can help. I'd suggest the following order for this patch series:

  • target/ppc: Fix insn32.decode style issues
  • target/ppc: Move mffs[.] to decodetree
  • target/ppc: Move mffsl to decodetree
  • target/ppc: Move mffsce to decodetree
  • target/ppc: Move mffscrn[i] to decodetree
  • target/ppc: Implement mffscdrn[i] instructions

So you can add do_mffsc parameters incrementally.

tcg_gen_andi_i64(fpscr, fpscr, clear_mask);
tcg_gen_or_i64(fpscr, fpscr, t1);

gen_helper_store_fpscr(cpu_env, fpscr, tcg_constant_i32(fpscr_mask));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't call gen_helper_store_fpscr if the instruction is not setting FPSCR.
(Also, we should probably resolve the TODO in this helper...)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't understand the issue with gen_helper_store_fpscr here. Could you give an example?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trans_MFFS and trans_MFFSL call do_mffsc, but they don't set FPSCR, so the call to gen_helper_store_fpscr is unnecessary. You can use set_mask/clear_mask values or add another parameter to control whether the helper should be called. Or split do_mffsc in two methods.

@vcoracolombo vcoracolombo requested a review from mferst March 10, 2022 20:12
tcg_temp_free_i64(t0);
}

static void do_mffsc(int rt, TCGv_i64 t1, uint64_t set_mask)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's odd to have t1 unused and the only caller using set_mask as 0xFFFFFFFFFFFFFFFFULL. It's obvious from the following patches, but reviewers will read the patch series sequentially. I think it'd be better to add set_mask only when you move mffsl (or move it in the same commit) and t1 when you move mffsce.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented the changes you suggested, thanks again!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking better, but you should also drop the tcg_gen_andi_i64 with 0xFFFFFFFFFFFFFFFFULL in the second patch.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my bad, didn't notice it. Fixed

@vcoracolombo vcoracolombo requested a review from mferst March 17, 2022 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants