Skip to content

cmd/compile: use NEGL for DIVL #23310

@mdempsky

Description

@mdempsky

When emitting the code to handle x / -1 on amd64, we should use the size-appropriate negation operation. For example, NEGL for DIVL.

This probably also means using NEGW for DIVW, which might also apply to the 386 backend?

Fixing this should allow reverting https://go-review.googlesource.com/c/go/+/85736. See also #23305.

/cc @TocarIP @cherrymui

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions