Skip to content

cmd/asm: change canonical spelling of CMOVLEQ to CMOVL.EQ etc #20173

Open

Description

@dlespiau

This proposal is originally from @rsc in issue #14069 and is about CMOVLEQ being ambiguous. I Extracted it as I believe it deserves its own issue.

Recounting this to @aclements I figured out what is going on with CMOVLEQ. The GNU form is CMOV[cond][size] but the form added for Go is CMOV[size][cond]. So GNU's cmovleq is cmov-le-q while Go's CMOVLEQ is CMOV-L-EQ. The Intel syntax has no size suffix and is CMOVEQ/CMOVLE, but it seems clear that Go should not be inserting a size suffix in the middle of the defined opcode name. While in general I feel that we need to put up with past mistakes in our assembly definitions to avoid breaking existing assembly programs, this one seems so egregious and error-prone that I think we have no choice but to change these names for Go 1.7 to match the Intel and GNU syntax.

Unfortunately it seems too late for such a breaking change so the proposal evolved into introducing new aliases like CMOVL.EQ (CMOV%size.%cond) to lift the ambiguity and then, later on, remove the old versions. Maybe.

Activity

  1. added this to the Proposal milestone on Apr 29, 2017
  2. gopherbot commented on Apr 29, 2017

    @gopherbot
    Contributor

    CL https://golang.org/cl/42092 mentions this issue.

  3. rsc commented on May 1, 2017

    @rsc
    Contributor

    At this point I don't think we can rename instructions like this - it will silently change the meaning of existing (one assumes debugged) code. If we need to do something at all, I would suggest adding CMOVL.EQ as an alias for current Go CMOVLEQ, and so on, and then in a later release removing the dot-free variants.

  4. changed the title [-]Proposal: swap [size] and [cond] in CMOV[size][cond][/-] [+]cmd/asm: change canonical spelling of CMOVLEQ to CMOVL.EQ etc[/+] on Jun 12, 2017
  5. rsc commented on Jun 12, 2017

    @rsc
    Contributor

    No one replied to previous comment (but two thumbs up) so I'm repurposing for that "clearer new spelling" instead of "change existing meaning" fix.

  6. modified the milestones: Go1.10, Proposal on Jun 12, 2017
  7. dlespiau commented on Jun 15, 2017

    @dlespiau
    ContributorAuthor

    Yes, thank you for renaming the issue. Updated the proposal text accordingly as well.

  8. gopherbot commented on Sep 27, 2017

    @gopherbot
    Contributor

    Change https://golang.org/cl/66451 mentions this issue: cmd/asm: add CMOVL.EQ->CMOVLEQ alias

  9. modified the milestones: Go1.10, Go1.11 on Nov 22, 2017
  10. quasilyte commented on May 18, 2018

    @quasilyte
    Contributor

    Should this be done for 1.11?

    Suffixes are used for AVX-512 things, should we reconsider CMOVL.EQ or add additional suffixes for these? (see #22779)

  11. modified the milestones: Go1.11, Go1.12 on Jun 15, 2018
  12. gopherbot commented on Apr 13, 2019

    @gopherbot
    Contributor

    Change https://golang.org/cl/171732 mentions this issue: cmd/internal/obj/x86: permit new CMOVL syntax with suffix

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions