aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/arm64/asm7.go
diff options
context:
space:
mode:
authoreric fang <eric.fang@arm.com>2022-08-24 03:28:16 +0000
committerCherry Mui <cherryyz@google.com>2022-08-29 17:03:10 +0000
commiteeb1ba7a89975beb1993242d8f2db05a6237e01c (patch)
treeab2820f86ed551fbf3c822261bdeae72cb097584 /src/cmd/internal/obj/arm64/asm7.go
parent739304978086143a5d8c3b9bfa4f9f25aef23e90 (diff)
downloadgo-eeb1ba7a89975beb1993242d8f2db05a6237e01c.tar.gz
go-eeb1ba7a89975beb1993242d8f2db05a6237e01c.zip
cmd/compile/obj/arm64: fix encoding error of FMOVD/FMOVS $0|ZR
Previously the first operand of FMOVD and FMOVS could be $0, which would be converted to the ZR register. This is prohibited by CL 404316, also it broken the encoding of "FMOVD/FMOVS ZR, Rn", this CL restores this instruction format and fixes the encoding issue. Fixes #54655. Fixes #54729. Change-Id: I9c42cd41296bed7ffd601609bd8ecaa27d11e659 Reviewed-on: https://go-review.googlesource.com/c/go/+/425188 Run-TryBot: Eric Fang <eric.fang@arm.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/arm64/asm7.go')
-rw-r--r--src/cmd/internal/obj/arm64/asm7.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
index 027556fc6e..1e36985654 100644
--- a/src/cmd/internal/obj/arm64/asm7.go
+++ b/src/cmd/internal/obj/arm64/asm7.go
@@ -3884,13 +3884,13 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
case 29: /* op Rn, Rd */
fc := c.aclass(&p.From)
tc := c.aclass(&p.To)
- if (p.As == AFMOVD || p.As == AFMOVS) && (fc == C_REG || tc == C_REG) {
+ if (p.As == AFMOVD || p.As == AFMOVS) && (fc == C_REG || fc == C_ZREG || tc == C_REG) {
// FMOV Rx, Fy or FMOV Fy, Rx
o1 = FPCVTI(0, 0, 0, 0, 6)
if p.As == AFMOVD {
o1 |= 1<<31 | 1<<22 // 64-bit
}
- if fc == C_REG {
+ if fc == C_REG || fc == C_ZREG {
o1 |= 1 << 16 // FMOV Rx, Fy
}
} else {