]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/riscv: use signed immediates for U-instructions
authorJoel Sing <joel@sing.id.au>
Wed, 22 Jan 2020 16:38:31 +0000 (03:38 +1100)
committerJoel Sing <joel@sing.id.au>
Tue, 28 Jan 2020 02:39:28 +0000 (02:39 +0000)
commitd8e052667f6bb93eb444cc372d03a866973d4c1b
treeb10a7f27b7095cffe33af8166e19ac3ed762e3b0
parent8f14f33f96d35416786d65664ca731ae75d1c733
cmd/internal/obj/riscv: use signed immediates for U-instructions

On RISCV64, the U-instructions (AUIPC and LUI) take 20 bits, append 12 bits
of zeros and sign extend to 64-bits. As such, the 20 bit immediate value is
signed not unsigned.

Updates #27532

Change-Id: I725215a1dc500106dbfdc0a4425f3c0b2a6f411e
Reviewed-on: https://go-review.googlesource.com/c/go/+/216257
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/asm/internal/asm/testdata/riscvenc.s
src/cmd/internal/obj/riscv/obj.go