Skip to content

cmd/compile: several arm64 code-gen issues #38740

@shawndx

Description

@shawndx

What version of Go are you using (go version)?

$ go version
tip

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

Several code-gen (optimization) issues relevant to utilizing CMN/CMP instructions on arm64 were spotted recently, it will take time to identify all of them, create a placeholder issue tracker for updating.

example:

A condition like "if (x1+3) < 0" gets translated to the following instructions, that is transforming to "if x1 < -3"
cmn x0, #0x3
b.ge

But such transformation doesn't hold true, in case executing 'cmn' set the overflow flag, internally 'cmn' is an alias of the 'adds' instruction which performs add with carry set operation.

What did you expect to see?

What did you see instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.Performanceokay-after-beta1Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions