golang/go

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

Open

#20,173 opened on Apr 29, 2017

View on GitHub
 (8 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
NeedsFixProposalProposal-Acceptedcompiler/runtimehelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide