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

cmd/compile: PPC64 folds (MOVWZreg (RLWINM x)) incorrectly in some cases #67844

Closed
pmur opened this issue Jun 5, 2024 · 4 comments
Closed

cmd/compile: PPC64 folds (MOVWZreg (RLWINM x)) incorrectly in some cases #67844

pmur opened this issue Jun 5, 2024 · 4 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@pmur
Copy link
Contributor

pmur commented Jun 5, 2024

Go version

master

Output of go env in your module/workspace:

GOARCH=ppc64le

What did you do?

Adding the following codegen test to bitRotateAndMask:

        // ppc64x: "MOVWZ", "RLWNM\t[$]1, R[0-9]*, [$]28, [$]3, R"
        io64[3] = uint64(bits.RotateLeft32(io32[0],1) & 0xF000000F)

What did you see happen?

The MOVWZ is missing.

What did you expect to see?

The MOVWZ opcode should be present for certain usages of RLWINM to ensure the upper 32 bits are cleared when the value is expected to be zero-extended.

@pmur pmur added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jun 5, 2024
@pmur pmur self-assigned this Jun 5, 2024
@gopherbot

This comment was marked as duplicate.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/590896 mentions this issue: cmd/compile/ssa: fix (MOVWZreg (RLWINM)) folding on PPC64

@randall77 randall77 added this to the Go1.23 milestone Jun 7, 2024
@randall77
Copy link
Contributor

Do we need this fix backported?

@pmur
Copy link
Contributor Author

pmur commented Jun 7, 2024

No, I added this rule in 1.23.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. FixPending Issues that have a fix which has not yet been reviewed or submitted. labels Jun 7, 2024
@dmitshur dmitshur moved this to In Progress in Release Blockers Jun 7, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Release Blockers Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
Status: Done
Development

No branches or pull requests

4 participants