aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoel Sing <joel@sing.id.au>2025-02-20 22:53:31 +1100
committerJoel Sing <joel@sing.id.au>2025-03-25 04:03:02 -0700
commitdab10bca372165432931a44d9783a82db7d1a33f (patch)
treec23839c0ad225a98e71bb24c278dd92f747385a1 /src
parent4f11f8ff7db476c534b9b1ad8910dcdd8bbcf022 (diff)
downloadgo-dab10bca372165432931a44d9783a82db7d1a33f.tar.xz
cmd/internal/obj/arm64: replace range checks with isaddcon2
isaddcon2 tests for the range 0 <= v <= 0xffffff - replace duplicated range checks with calls to isaddcon2. Change-Id: Ia6f331852ed3d77715b265cb4fcc500579eac711 Reviewed-on: https://go-review.googlesource.com/c/go/+/650935 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Fannie Zhang <Fannie.Zhang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src')
-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 f8d4c7aa98..680384da3f 100644
--- a/src/cmd/internal/obj/arm64/asm7.go
+++ b/src/cmd/internal/obj/arm64/asm7.go
@@ -1953,7 +1953,7 @@ func (c *ctxt7) con32class(a *obj.Addr) int {
return C_BITCON
}
- if 0 <= v && v <= 0xffffff {
+ if isaddcon2(int64(v)) {
return C_ADDCON2
}
return C_LCON
@@ -2205,7 +2205,7 @@ func (c *ctxt7) aclass(a *obj.Addr) int {
return C_BITCON
}
- if 0 <= v && v <= 0xffffff {
+ if isaddcon2(v) {
return C_ADDCON2
}