aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal
diff options
context:
space:
mode:
authoreric fang <eric.fang@arm.com>2023-06-13 10:02:33 +0000
committerEric Fang <eric.fang@arm.com>2023-06-15 01:59:49 +0000
commit9fc84363d1c317fd8d8f963de3bb10f8a8df05ac (patch)
tree57a11bc4bb834efce18057a7d81c173a5d68e9b9 /src/cmd/internal
parentda94586aa3767c38ccb625ac653e038bb842444a (diff)
downloadgo-9fc84363d1c317fd8d8f963de3bb10f8a8df05ac.tar.xz
cmd/asm: fix encoding errors for FMOVD and FMOVS instructions on arm64
The encoding of instructions "FMOVD F1, ZR" and "FMOVS F1, ZR" is wrong, the assembler encodes them as "FMOVD F1, F31" and "FMOVS F1, F31". This CL fixes the bug. Change-Id: I2d31520b58f9950ce2534a04f4a3275bf103a673 Reviewed-on: https://go-review.googlesource.com/c/go/+/503135 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/internal')
-rw-r--r--src/cmd/internal/obj/arm64/asm7.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
index 77c60812ac..ff8daad857 100644
--- a/src/cmd/internal/obj/arm64/asm7.go
+++ b/src/cmd/internal/obj/arm64/asm7.go
@@ -3880,7 +3880,7 @@ 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 || fc == C_ZREG || tc == C_REG) {
+ if (p.As == AFMOVD || p.As == AFMOVS) && (fc == C_REG || fc == C_ZREG || tc == C_REG || tc == C_ZREG) {
// FMOV Rx, Fy or FMOV Fy, Rx
o1 = FPCVTI(0, 0, 0, 0, 6)
if p.As == AFMOVD {