Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[RISC-V] Use srli instead of srai for 32-bit unsigned mulhi#122014

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
credo-quia-absurdum wants to merge1 commit intodotnet:main
base:main
Choose a base branch
Loading
fromvmolab:fix/riscv-mulhi-unsigend-4byte

Conversation

@credo-quia-absurdum
Copy link
Contributor

The 32-bit unsigned mulhi implementation previously used an arithmetic right shift (srai) to extract the high 32 bits from the widened 64-bit product. While this happens to produce correct results because the sign-extended high bits are discarded, the instruction does not semantically match the unsigned operation.

Usingsrli better reflects the intended semantics of an unsigned high-half multiply and avoids relying on sign-extension behavior.

No functional behavior change is expected.

Part of#84834, cc @dotnet/samsung
@namu-lee

namu-lee reacted with thumbs up emoji
CopilotAI review requested due to automatic review settingsNovember 27, 2025 07:25
@github-actionsgithub-actionsbot added the area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labelNov 27, 2025
@dotnet-policy-servicedotnet-policy-servicebot added the community-contributionIndicates that the PR has been added by a community member labelNov 27, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area:@JulieLeeMSFT,@jakobbotsch
See info inarea-owners.md if you want to be subscribed.

Copilot finished reviewing on behalf ofcredo-quia-absurdumNovember 27, 2025 07:27
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the semantic correctness of the RISC-V 32-bit unsigned multiply-high implementation by replacing an arithmetic right shift (srai) with a logical right shift (srli). While both instructions produce the same functional result due to how the high bits are discarded,srli better represents the unsigned nature of the operation and aligns with established patterns elsewhere in the codebase.

  • ReplacedINS_srai withINS_srli in the 32-bit unsigned mulhi code path
  • Aligned instruction choice with the semantic meaning of unsigned operations
  • Maintained consistency with other zero-extend patterns in the file (e.g., lines 5851, 5866-5867)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

arch-riscvRelated to the RISC-V architecturearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIcommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@credo-quia-absurdum@am11

[8]ページ先頭

©2009-2025 Movatter.jp