[go] [dev.simd] cmd/internal/obj/arm64: fix VFCM* compare-against-zero to accept $0

0 views
Skip to first unread message

Jonathan Swinney (Gerrit)

unread,
Apr 8, 2026, 4:42:42 PM (8 hours ago) Apr 8
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Jonathan Swinney has uploaded the change for review

Commit message

[dev.simd] cmd/internal/obj/arm64: fix VFCM* compare-against-zero to accept $0

The optab entries for AVFCMEQ and AVFCMLE used C_FCON as the operand
class for the compare-against-zero forms. However, the integer literal
$0 is parsed as C_ZCON, not C_FCON. This caused "illegal combination"
errors for instructions like:

VFCMEQ $0, V17.D2, V22.D2
VFCMLE $0, V28.S2, V20.S2

Add C_ZCON variants alongside the existing C_FCON entries, matching
the pattern used by the integer compare-against-zero instructions
AVCMEQ and AVCMLE. The C_FCON entries are retained to support the
$(0.0) floating-point literal syntax.

Uncomment the 5 corresponding encoding tests in arm64enc.s.
Change-Id: I4bc8fef02ec1b301b513cce77602ece8bd397ed3

Change diff

diff --git a/src/cmd/asm/internal/asm/testdata/arm64enc.s b/src/cmd/asm/internal/asm/testdata/arm64enc.s
index 76151a3..c6ce1dd 100644
--- a/src/cmd/asm/internal/asm/testdata/arm64enc.s
+++ b/src/cmd/asm/internal/asm/testdata/arm64enc.s
@@ -445,19 +445,19 @@
//TODO FCMEQ F7, F11, F26 // 7ae5675e
//TODO VFCMEQ V29.S4, V26.S4, V30.S4 // 5ee73d4e
//TODO FCMEQ $0, F17, F22 // 36daa05e
- //TODO VFCMEQ $0, V17.D2, V22.D2 // 36dae04e
+ VFCMEQ $0, V17.D2, V22.D2 // 36dae04e
//TODO FCMGE F29, F31, F13 // ede77d7e
//TODO VFCMGE V8.S2, V31.S2, V2.S2 // e2e7282e
//TODO FCMGE $0, F18, F27 // e2e7282e
- //TODO VFCMGE $0, V14.S2, V8.S2 // c8c9a02e
+ VFCMGE $0, V14.S2, V8.S2 // c8c9a02e
//TODO FCMGT F20, F2, F8 // 48e4b47e
//TODO VFCMGT V26.D2, V15.D2, V23.D2 // f7e5fa6e
//TODO FCMGT $0, F14, F3 // c3c9e05e
- //TODO VFCMGT $0, V6.S2, V28.S2 // dcc8a00e
+ VFCMGT $0, V6.S2, V28.S2 // dcc8a00e
//TODO FCMLE $0, F26, F25 // 59dba07e
- //TODO VFCMLE $0, V28.S2, V20.S2 // 94dba02e
+ VFCMLE $0, V28.S2, V20.S2 // 94dba02e
//TODO FCMLT $0, F17, F3 // 23eae05e
- //TODO VFCMLT $0, V8.S4, V7.S4 // 07e9a04e
+ VFCMLT $0, V8.S4, V7.S4 // 07e9a04e
FCMPS F3, F17 // 2022231e
FCMPS $(0.0), F8 // 0821201e
FCMPD F11, F27 // 60236b1e
diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
index aa1c763..ed5f680 100644
--- a/src/cmd/internal/obj/arm64/asm7.go
+++ b/src/cmd/internal/obj/arm64/asm7.go
@@ -380,7 +380,9 @@
{AVCMLE, C_ZCON, C_ARNG, C_NONE, C_ARNG, C_NONE, 109, 4, 0, 0, 0},
{AVFCMEQ, C_ARNG, C_ARNG, C_NONE, C_ARNG, C_NONE, 72, 4, 0, 0, 0},
{AVFCMEQ, C_FCON, C_ARNG, C_NONE, C_ARNG, C_NONE, 109, 4, 0, 0, 0},
+ {AVFCMEQ, C_ZCON, C_ARNG, C_NONE, C_ARNG, C_NONE, 109, 4, 0, 0, 0},
{AVFCMLE, C_FCON, C_ARNG, C_NONE, C_ARNG, C_NONE, 109, 4, 0, 0, 0},
+ {AVFCMLE, C_ZCON, C_ARNG, C_NONE, C_ARNG, C_NONE, 109, 4, 0, 0, 0},

{AVADD, C_ARNG, C_ARNG, C_NONE, C_ARNG, C_NONE, 72, 4, 0, 0, 0},
{AVADD, C_VREG, C_VREG, C_NONE, C_VREG, C_NONE, 89, 4, 0, 0, 0},

Change information

Files:
  • M src/cmd/asm/internal/asm/testdata/arm64enc.s
  • M src/cmd/internal/obj/arm64/asm7.go
Change size: S
Delta: 2 files changed, 7 insertions(+), 5 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4bc8fef02ec1b301b513cce77602ece8bd397ed3
Gerrit-Change-Number: 764221
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Swinney <jswi...@amazon.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Jonathan Swinney (Gerrit)

unread,
Apr 8, 2026, 4:55:22 PM (8 hours ago) Apr 8
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Cherry Mui

Jonathan Swinney uploaded new patchset

Jonathan Swinney uploaded patch set #2 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I4bc8fef02ec1b301b513cce77602ece8bd397ed3
Gerrit-Change-Number: 764221
Gerrit-PatchSet: 2
Gerrit-Owner: Jonathan Swinney <jswi...@amazon.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Cherry Mui <cher...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages