Why Go use JMP instead J for RISC-V?

I noted that Go use JMP for unconditional jump for RISC-V, when should be J.

JMP doesn’t exists in that arch, so I want to know if exists a file with alias for instructions by arch or is a mistake.

Example file: https://github.com/golang/go/blob/release-branch.go1.16/src/math/big/arith_riscv64.s

Thanks.

Please see: https://golang.org/doc/asm

Go uses its own standardized pseudo-assembly language across all platforms and the “instructions” don’t always map to actual hardware instructions for all platforms. Unlike other assemblers that map assembly mnemonics almost exactly to specific instructions, the Go assembler is “smart” and translates the pseudo-assembly to real assembly for the real hardware.

EDIT: This is also a useful link: https://www.youtube.com/watch?v=KINIAgRpkDA

2 Likes

Thanks a lot!