]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/riscv: clean up immediate checking
authorJoel Sing <joel@sing.id.au>
Sun, 27 Aug 2023 15:22:02 +0000 (01:22 +1000)
committerJoel Sing <joel@sing.id.au>
Sun, 17 Sep 2023 09:04:09 +0000 (09:04 +0000)
commit38b2c06e144c6ea7087c575c76c66e41265ae0b7
tree74da66ff5fcb62090fe57ab167ecb00c3e7d3a5c
parent561a5079057e3a660ab638e1ba957a96c4ff3fd1
cmd/internal/obj/riscv: clean up immediate checking

Change immIFits to return an error in the case that it does not fit.
This allows for deduplication and consistency of error messages.
Additionally, since we've already calculated the min and max values,
we can easily include these in the message. Also provide and use
immEven, for the same reasons.

Change-Id: Ie680558744f3e9bc19d6913c4144ce9ddbd0429c
Reviewed-on: https://go-review.googlesource.com/c/go/+/523458
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Run-TryBot: M Zhuo <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: M Zhuo <mzh@golangcn.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/internal/obj/riscv/obj.go