]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/arm64: fix 32-bit BITCON test
authorCherry Zhang <cherryyz@google.com>
Fri, 8 May 2020 19:08:55 +0000 (15:08 -0400)
committerCherry Zhang <cherryyz@google.com>
Fri, 8 May 2020 20:57:01 +0000 (20:57 +0000)
commitf1ac85c8d10e16fbc07e8b7ef93aa04bdc4c67e9
treeda491b7f48dfc0a625fa08e3a670b574fdaa3247
parent7cbee1244437bafa1e52ca761d7c32d7587a9fdd
cmd/internal/obj/arm64: fix 32-bit BITCON test

The BITCON test, isbitcon, assumes 32-bit constants are expanded
repeatedly, i.e. by copying the low 32 bits to high 32 bits,
instead of zero extending. We already do such expansion in
progedit. In con32class when classifying 32-bit constants, we
should use the expanded constant, instead of zero-extending it.

TODO: we could have better encoding for things like ANDW $-1, Rx.

Fixes #38946.

Change-Id: I37d0c95d744834419db5c897fd1f6c187595c926
Reviewed-on: https://go-review.googlesource.com/c/go/+/232984
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/asm/internal/asm/testdata/arm64.s
src/cmd/internal/obj/arm64/asm7.go